summaryrefslogtreecommitdiff
path: root/app/helpers/environments_helper.rb
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-06-25 10:57:29 +0100
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-07-25 09:39:39 +0100
commiteb7c08c7a644fa07b274b83624005ac53acf7faf (patch)
tree08102d7589a06e1aa550d1703a79f845b9333610 /app/helpers/environments_helper.rb
parent4063141223f9b89248e3c33df5711201f75d3718 (diff)
downloadgitlab-ce-eb7c08c7a644fa07b274b83624005ac53acf7faf.tar.gz
Backports relevant changes made in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/5163 to CE
Diffstat (limited to 'app/helpers/environments_helper.rb')
-rw-r--r--app/helpers/environments_helper.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/helpers/environments_helper.rb b/app/helpers/environments_helper.rb
index 4ce89f89fa9..c005ecbb56b 100644
--- a/app/helpers/environments_helper.rb
+++ b/app/helpers/environments_helper.rb
@@ -4,4 +4,23 @@ module EnvironmentsHelper
endpoint: project_environments_path(@project, format: :json)
}
end
+
+ def metrics_data(project, environment)
+ {
+ "settings-path" => edit_project_service_path(project, 'prometheus'),
+ "clusters-path" => project_clusters_path(project),
+ "current-environment-name": environment.name,
+ "documentation-path" => help_page_path('administration/monitoring/prometheus/index.md'),
+ "empty-getting-started-svg-path" => image_path('illustrations/monitoring/getting_started.svg'),
+ "empty-loading-svg-path" => image_path('illustrations/monitoring/loading.svg'),
+ "empty-no-data-svg-path" => image_path('illustrations/monitoring/no_data.svg'),
+ "empty-unable-to-connect-svg-path" => image_path('illustrations/monitoring/unable_to_connect.svg'),
+ "metrics-endpoint" => additional_metrics_project_environment_path(project, environment, format: :json),
+ "deployment-endpoint" => project_environment_deployments_path(project, environment, format: :json),
+ "environments-endpoint": project_environments_path(project, format: :json),
+ "project-path" => project_path(project),
+ "tags-path" => project_tags_path(project),
+ "has-metrics" => "#{environment.has_metrics?}"
+ }
+ end
end