Commit beb4d259 authored by Dhiraj Bodicherla's avatar Dhiraj Bodicherla Committed by Robert Speicher

Add base url path for metrics dashboards

Base URL is needed for the metrics
dashboard for the Vue router to function.
This MR adds it on the BE and passes to FE
parent 1a651214
...@@ -68,10 +68,11 @@ module EnvironmentsHelper ...@@ -68,10 +68,11 @@ module EnvironmentsHelper
return {} unless environment return {} unless environment
{ {
'current-environment-name' => environment.name, 'metrics-dashboard-base-path' => environment_metrics_path(environment),
'has-metrics' => "#{environment.has_metrics?}", 'current-environment-name' => environment.name,
'prometheus-status' => "#{environment.prometheus_status}", 'has-metrics' => "#{environment.has_metrics?}",
'environment-state' => "#{environment.state}" 'prometheus-status' => "#{environment.prometheus_status}",
'environment-state' => "#{environment.state}"
} }
end end
......
...@@ -20,6 +20,7 @@ describe EnvironmentsHelper do ...@@ -20,6 +20,7 @@ describe EnvironmentsHelper do
expect(metrics_data).to include( expect(metrics_data).to include(
'settings-path' => edit_project_service_path(project, 'prometheus'), 'settings-path' => edit_project_service_path(project, 'prometheus'),
'clusters-path' => project_clusters_path(project), 'clusters-path' => project_clusters_path(project),
'metrics-dashboard-base-path' => environment_metrics_path(environment),
'current-environment-name' => environment.name, 'current-environment-name' => environment.name,
'documentation-path' => help_page_path('administration/monitoring/prometheus/index.md'), 'documentation-path' => help_page_path('administration/monitoring/prometheus/index.md'),
'empty-getting-started-svg-path' => match_asset_path('/assets/illustrations/monitoring/getting_started.svg'), 'empty-getting-started-svg-path' => match_asset_path('/assets/illustrations/monitoring/getting_started.svg'),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment