2018-10-31 20:39:01 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Projects::ClustersController < Clusters::ClustersController
|
|
|
|
prepend_before_action :project
|
|
|
|
before_action :repository
|
|
|
|
|
2019-06-06 15:57:28 -04:00
|
|
|
before_action do
|
|
|
|
push_frontend_feature_flag(:prometheus_computed_alerts)
|
2022-05-06 11:09:03 -04:00
|
|
|
push_frontend_feature_flag(:show_gitlab_agent_feedback, type: :ops)
|
2019-06-06 15:57:28 -04:00
|
|
|
end
|
|
|
|
|
2018-10-31 20:39:01 -04:00
|
|
|
layout 'project'
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def clusterable
|
|
|
|
@clusterable ||= ClusterablePresenter.fabricate(project, current_user: current_user)
|
|
|
|
end
|
|
|
|
|
|
|
|
def project
|
2021-08-19 11:10:29 -04:00
|
|
|
@project ||= find_routable!(Project, File.join(params[:namespace_id], params[:project_id]), request.fullpath)
|
2018-10-31 20:39:01 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def repository
|
|
|
|
@repository ||= project.repository
|
|
|
|
end
|
2019-09-18 10:02:45 -04:00
|
|
|
|
2020-07-13 11:09:08 -04:00
|
|
|
def metrics_dashboard_params
|
|
|
|
params.permit(:embedded, :group, :title, :y_label).merge(
|
|
|
|
{
|
|
|
|
cluster: cluster,
|
|
|
|
cluster_type: :project
|
|
|
|
}
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|