Commit d9c8c995 authored by Mike Greiling's avatar Mike Greiling

add link to cluster configuration from prometheus "getting started" state

parent 3a565d5d
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
hasMetrics: convertPermissionToBoolean(metricsData.hasMetrics), hasMetrics: convertPermissionToBoolean(metricsData.hasMetrics),
documentationPath: metricsData.documentationPath, documentationPath: metricsData.documentationPath,
settingsPath: metricsData.settingsPath, settingsPath: metricsData.settingsPath,
clustersPath: metricsData.clustersPath,
tagsPath: metricsData.tagsPath, tagsPath: metricsData.tagsPath,
projectPath: metricsData.projectPath, projectPath: metricsData.projectPath,
metricsEndpoint: metricsData.additionalMetrics, metricsEndpoint: metricsData.additionalMetrics,
...@@ -132,6 +133,7 @@ ...@@ -132,6 +133,7 @@
:selected-state="state" :selected-state="state"
:documentation-path="documentationPath" :documentation-path="documentationPath"
:settings-path="settingsPath" :settings-path="settingsPath"
:clusters-path="clustersPath"
:empty-getting-started-svg-path="emptyGettingStartedSvgPath" :empty-getting-started-svg-path="emptyGettingStartedSvgPath"
:empty-loading-svg-path="emptyLoadingSvgPath" :empty-loading-svg-path="emptyLoadingSvgPath"
:empty-unable-to-connect-svg-path="emptyUnableToConnectSvgPath" :empty-unable-to-connect-svg-path="emptyUnableToConnectSvgPath"
......
...@@ -10,6 +10,11 @@ ...@@ -10,6 +10,11 @@
required: false, required: false,
default: '', default: '',
}, },
clustersPath: {
type: String,
required: false,
default: '',
},
selectedState: { selectedState: {
type: String, type: String,
required: true, required: true,
...@@ -35,7 +40,10 @@ ...@@ -35,7 +40,10 @@
title: 'Get started with performance monitoring', title: 'Get started with performance monitoring',
description: `Stay updated about the performance and health description: `Stay updated about the performance and health
of your environment by configuring Prometheus to monitor your deployments.`, of your environment by configuring Prometheus to monitor your deployments.`,
buttonText: 'Configure Prometheus', buttonText: 'Install Prometheus on clusters',
buttonPath: this.clustersPath,
secondaryButtonText: 'Configure existing Prometheus',
secondaryButtonPath: this.settingsPath,
}, },
loading: { loading: {
svgUrl: this.emptyLoadingSvgPath, svgUrl: this.emptyLoadingSvgPath,
...@@ -43,6 +51,7 @@ ...@@ -43,6 +51,7 @@
description: `Creating graphs uses the data from the Prometheus server. description: `Creating graphs uses the data from the Prometheus server.
If this takes a long time, ensure that data is available.`, If this takes a long time, ensure that data is available.`,
buttonText: 'View documentation', buttonText: 'View documentation',
buttonPath: this.documentationPath,
}, },
noData: { noData: {
svgUrl: this.emptyUnableToConnectSvgPath, svgUrl: this.emptyUnableToConnectSvgPath,
...@@ -50,12 +59,14 @@ ...@@ -50,12 +59,14 @@
description: `You are connected to the Prometheus server, but there is currently description: `You are connected to the Prometheus server, but there is currently
no data to display.`, no data to display.`,
buttonText: 'Configure Prometheus', buttonText: 'Configure Prometheus',
buttonPath: this.settingsPath,
}, },
unableToConnect: { unableToConnect: {
svgUrl: this.emptyUnableToConnectSvgPath, svgUrl: this.emptyUnableToConnectSvgPath,
title: 'Unable to connect to Prometheus server', title: 'Unable to connect to Prometheus server',
description: 'Ensure connectivity is available from the GitLab server to the ', description: 'Ensure connectivity is available from the GitLab server to the ',
buttonText: 'View documentation', buttonText: 'View documentation',
buttonPath: this.documentationPath,
}, },
}, },
}; };
...@@ -65,13 +76,6 @@ ...@@ -65,13 +76,6 @@
return this.states[this.selectedState]; return this.states[this.selectedState];
}, },
buttonPath() {
if (this.selectedState === 'gettingStarted') {
return this.settingsPath;
}
return this.documentationPath;
},
showButtonDescription() { showButtonDescription() {
if (this.selectedState === 'unableToConnect') return true; if (this.selectedState === 'unableToConnect') return true;
return false; return false;
...@@ -99,11 +103,21 @@ ...@@ -99,11 +103,21 @@
</p> </p>
<div class="state-button"> <div class="state-button">
<a <a
v-if="currentState.buttonPath"
class="btn btn-success" class="btn btn-success"
:href="buttonPath" :href="currentState.buttonPath"
> >
{{ currentState.buttonText }} {{ currentState.buttonText }}
</a> </a>
</div> </div>
<div class="state-button">
<a
v-if="currentState.secondaryButtonPath"
class="btn"
:href="currentState.secondaryButtonPath"
>
{{ currentState.secondaryButtonText }}
</a>
</div>
</div> </div>
</template> </template>
...@@ -205,7 +205,7 @@ ...@@ -205,7 +205,7 @@
} }
.prometheus-state { .prometheus-state {
max-width: 430px; max-width: 460px;
margin: 10px auto; margin: 10px auto;
text-align: center; text-align: center;
...@@ -213,6 +213,10 @@ ...@@ -213,6 +213,10 @@
max-width: 80vw; max-width: 80vw;
margin: 0 auto; margin: 0 auto;
} }
.state-button {
padding: $gl-padding / 2;
}
} }
.environments-actions { .environments-actions {
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
= link_to @environment.name, environment_path(@environment) = link_to @environment.name, environment_path(@environment)
#prometheus-graphs{ data: { "settings-path": edit_project_service_path(@project, 'prometheus'), #prometheus-graphs{ data: { "settings-path": edit_project_service_path(@project, 'prometheus'),
"clusters-path": project_clusters_path(@project),
"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": image_path('illustrations/monitoring/getting_started.svg'), "empty-getting-started-svg-path": image_path('illustrations/monitoring/getting_started.svg'),
"empty-loading-svg-path": image_path('illustrations/monitoring/loading.svg'), "empty-loading-svg-path": image_path('illustrations/monitoring/loading.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