Commit 9aa2205a authored by Tim Zallmann's avatar Tim Zallmann Committed by Phil Hughes

Resolve "Memory usage notice doesn't link anywhere"

parent f2da36f1
...@@ -108,7 +108,8 @@ export default { ...@@ -108,7 +108,8 @@ export default {
</div> </div>
<mr-widget-memory-usage <mr-widget-memory-usage
v-if="deployment.metrics_url" v-if="deployment.metrics_url"
:metricsUrl="deployment.metrics_url" :metrics-url="deployment.metrics_url"
:metrics-monitoring-url="deployment.metrics_monitoring_url"
/> />
</div> </div>
</div> </div>
......
...@@ -7,7 +7,14 @@ import MRWidgetService from '../services/mr_widget_service'; ...@@ -7,7 +7,14 @@ import MRWidgetService from '../services/mr_widget_service';
export default { export default {
name: 'MemoryUsage', name: 'MemoryUsage',
props: { props: {
metricsUrl: { type: String, required: true }, metricsUrl: {
type: String,
required: true,
},
metricsMonitoringUrl: {
type: String,
required: true,
},
}, },
data() { data() {
return { return {
...@@ -124,7 +131,7 @@ export default { ...@@ -124,7 +131,7 @@ export default {
<p <p
v-if="shouldShowMemoryGraph" v-if="shouldShowMemoryGraph"
class="usage-info js-usage-info"> class="usage-info js-usage-info">
Memory usage <b>{{memoryChangeType}}</b> from {{memoryFrom}}MB to {{memoryTo}}MB <a :href="metricsMonitoringUrl">Memory</a> usage <b>{{memoryChangeType}}</b> from {{memoryFrom}}MB to {{memoryTo}}MB
</p> </p>
<p <p
v-if="shouldShowLoadFailure" v-if="shouldShowLoadFailure"
......
...@@ -223,12 +223,18 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo ...@@ -223,12 +223,18 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
if can?(current_user, :read_environment, environment) && environment.has_metrics? if can?(current_user, :read_environment, environment) && environment.has_metrics?
metrics_project_environment_deployment_path(environment.project, environment, deployment) metrics_project_environment_deployment_path(environment.project, environment, deployment)
end end
metrics_monitoring_url =
if can?(current_user, :read_environment, environment)
environment_metrics_path(environment)
end
{ {
id: environment.id, id: environment.id,
name: environment.name, name: environment.name,
url: project_environment_path(project, environment), url: project_environment_path(project, environment),
metrics_url: metrics_url, metrics_url: metrics_url,
metrics_monitoring_url: metrics_monitoring_url,
stop_url: stop_url, stop_url: stop_url,
external_url: environment.external_url, external_url: environment.external_url,
external_url_formatted: environment.formatted_external_url, external_url_formatted: environment.formatted_external_url,
......
---
title: Added link to the MR widget that directs to the monitoring dashboard
merge_request:
author:
...@@ -10,6 +10,7 @@ const deploymentMockData = [ ...@@ -10,6 +10,7 @@ const deploymentMockData = [
url: '/root/acets-review-apps/environments/15', url: '/root/acets-review-apps/environments/15',
stop_url: '/root/acets-review-apps/environments/15/stop', stop_url: '/root/acets-review-apps/environments/15/stop',
metrics_url: '/root/acets-review-apps/environments/15/deployments/1/metrics', metrics_url: '/root/acets-review-apps/environments/15/deployments/1/metrics',
metrics_monitoring_url: '/root/acets-review-apps/environments/15/metrics',
external_url: 'http://diplo.', external_url: 'http://diplo.',
external_url_formatted: 'diplo.', external_url_formatted: 'diplo.',
deployed_at: '2017-03-22T22:44:42.258Z', deployed_at: '2017-03-22T22:44:42.258Z',
......
...@@ -3,6 +3,7 @@ import memoryUsageComponent from '~/vue_merge_request_widget/components/mr_widge ...@@ -3,6 +3,7 @@ import memoryUsageComponent from '~/vue_merge_request_widget/components/mr_widge
import MRWidgetService from '~/vue_merge_request_widget/services/mr_widget_service'; import MRWidgetService from '~/vue_merge_request_widget/services/mr_widget_service';
const url = '/root/acets-review-apps/environments/15/deployments/1/metrics'; const url = '/root/acets-review-apps/environments/15/deployments/1/metrics';
const monitoringUrl = '/root/acets-review-apps/environments/15/metrics';
const metricsMockData = { const metricsMockData = {
success: true, success: true,
...@@ -39,6 +40,7 @@ const createComponent = () => { ...@@ -39,6 +40,7 @@ const createComponent = () => {
el: document.createElement('div'), el: document.createElement('div'),
propsData: { propsData: {
metricsUrl: url, metricsUrl: url,
metricsMonitoringUrl: monitoringUrl,
memoryMetrics: [], memoryMetrics: [],
deploymentTime: 0, deploymentTime: 0,
hasMetrics: false, hasMetrics: false,
......
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