debian-mirror-gitlab/app/controllers/projects/clusters_controller.rb

36 lines
771 B
Ruby
Raw Normal View History

2018-12-05 23:21:45 +05:30
# frozen_string_literal: true
2018-12-13 13:39:08 +05:30
class Projects::ClustersController < Clusters::ClustersController
prepend_before_action :project
before_action :repository
2018-03-17 18:26:18 +05:30
2019-09-04 21:01:54 +05:30
before_action do
push_frontend_feature_flag(:prometheus_computed_alerts)
end
2018-12-13 13:39:08 +05:30
layout 'project'
2018-11-08 19:23:39 +05:30
2018-03-17 18:26:18 +05:30
private
2018-12-13 13:39:08 +05:30
def clusterable
@clusterable ||= ClusterablePresenter.fabricate(project, current_user: current_user)
2018-03-17 18:26:18 +05:30
end
2018-12-13 13:39:08 +05:30
def project
2021-09-30 23:02:18 +05:30
@project ||= find_routable!(Project, File.join(params[:namespace_id], params[:project_id]), request.path_info)
2018-03-17 18:26:18 +05:30
end
2018-03-27 19:54:05 +05:30
2018-12-13 13:39:08 +05:30
def repository
@repository ||= project.repository
2018-03-27 19:54:05 +05:30
end
2019-12-04 20:38:33 +05:30
2020-07-28 23:09:34 +05:30
def metrics_dashboard_params
params.permit(:embedded, :group, :title, :y_label).merge(
{
cluster: cluster,
cluster_type: :project
}
)
end
end