Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
9aa2205a
Commit
9aa2205a
authored
Jul 26, 2017
by
Tim Zallmann
Committed by
Phil Hughes
Jul 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Memory usage notice doesn't link anywhere"
parent
f2da36f1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
3 deletions
+24
-3
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_deployment.js
...e_merge_request_widget/components/mr_widget_deployment.js
+2
-1
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_memory_usage.js
...merge_request_widget/components/mr_widget_memory_usage.js
+9
-2
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+6
-0
changelogs/unreleased/34110-memory-usage-notice-doesn-t-link-anywhere.yml
...eased/34110-memory-usage-notice-doesn-t-link-anywhere.yml
+4
-0
spec/javascripts/vue_mr_widget/components/mr_widget_deployment_spec.js
...pts/vue_mr_widget/components/mr_widget_deployment_spec.js
+1
-0
spec/javascripts/vue_mr_widget/components/mr_widget_memory_usage_spec.js
...s/vue_mr_widget/components/mr_widget_memory_usage_spec.js
+2
-0
No files found.
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_deployment.js
View file @
9aa2205a
...
@@ -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>
...
...
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_memory_usage.js
View file @
9aa2205a
...
@@ -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"
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
9aa2205a
...
@@ -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
,
...
...
changelogs/unreleased/34110-memory-usage-notice-doesn-t-link-anywhere.yml
0 → 100644
View file @
9aa2205a
---
title
:
Added link to the MR widget that directs to the monitoring dashboard
merge_request
:
author
:
spec/javascripts/vue_mr_widget/components/mr_widget_deployment_spec.js
View file @
9aa2205a
...
@@ -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
'
,
...
...
spec/javascripts/vue_mr_widget/components/mr_widget_memory_usage_spec.js
View file @
9aa2205a
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment