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

38 lines
800 B
Ruby
Raw Normal View History

2020-07-28 23:09:34 +05:30
# frozen_string_literal: true
#
module Metrics
module Dashboard
class ClusterMetricsEmbedService < Metrics::Dashboard::DynamicEmbedService
class << self
def valid_params?(params)
[
params[:cluster],
embedded?(params[:embedded]),
params[:group].present?,
params[:title].present?,
params[:y_label].present?
].all?
end
end
private
# Permissions are handled at the controller level
def allowed?
true
end
def dashboard_path
::Metrics::Dashboard::ClusterDashboardService::DASHBOARD_PATH
end
def sequence
[
STAGES::ClusterEndpointInserter,
STAGES::PanelIdsInserter
]
end
end
end
end