debian-mirror-gitlab/app/services/metrics/dashboard/base_embed_service.rb

37 lines
742 B
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
# Base class for embed services. Contains a few basic helper
# methods that the embed services share.
module Metrics
module Dashboard
class BaseEmbedService < ::Metrics::Dashboard::BaseService
def cache_key
"dynamic_metrics_dashboard_#{identifiers}"
end
protected
def dashboard_path
params[:dashboard_path].presence ||
2020-01-01 13:55:28 +05:30
::Metrics::Dashboard::SystemDashboardService::DASHBOARD_PATH
2019-10-12 21:52:04 +05:30
end
def group
params[:group]
end
def title
params[:title]
end
def y_label
params[:y_label]
end
def identifiers
[dashboard_path, group, title, y_label].join('|')
end
end
end
end