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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
56a10f02
Commit
56a10f02
authored
Aug 16, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
eddb464e
0baadb42
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
14 deletions
+29
-14
app/assets/javascripts/monitoring/components/charts/area.vue
app/assets/javascripts/monitoring/components/charts/area.vue
+9
-1
app/assets/javascripts/monitoring/components/embed.vue
app/assets/javascripts/monitoring/components/embed.vue
+15
-13
changelogs/unreleased/62971-embed-specific-metrics-chart-in-issue.yml
...nreleased/62971-embed-specific-metrics-chart-in-issue.yml
+5
-0
No files found.
app/assets/javascripts/monitoring/components/charts/area.vue
View file @
56a10f02
...
...
@@ -45,6 +45,11 @@ export default {
required
:
false
,
default
:
()
=>
false
,
},
singleEmbed
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
thresholds
:
{
type
:
Array
,
required
:
false
,
...
...
@@ -240,7 +245,10 @@ export default {
</
script
>
<
template
>
<div
class=
"prometheus-graph col-12 col-lg-6"
:class=
"[showBorder ? 'p-2' : 'p-0']"
>
<div
class=
"prometheus-graph col-12"
:class=
"[showBorder ? 'p-2' : 'p-0',
{ 'col-lg-6': !singleEmbed }]"
>
<div
:class=
"
{ 'prometheus-graph-embed w-100 p-3': showBorder }">
<div
class=
"prometheus-graph-header"
>
<h5
ref=
"graphTitle"
class=
"prometheus-graph-title"
>
{{
graphData
.
title
}}
</h5>
...
...
app/assets/javascripts/monitoring/components/embed.vue
View file @
56a10f02
...
...
@@ -36,12 +36,15 @@ export default {
},
computed
:
{
...
mapState
(
'
monitoringDashboard
'
,
[
'
groups
'
,
'
metricsWithData
'
]),
groupData
()
{
const
groupsWithData
=
this
.
groups
.
filter
(
group
=>
this
.
chartsWithData
(
group
.
metrics
).
length
);
if
(
groupsWithData
.
length
)
{
return
groupsWithData
[
0
];
}
return
null
;
charts
()
{
const
groupWithMetrics
=
this
.
groups
.
find
(
group
=>
group
.
metrics
.
find
(
chart
=>
this
.
chartHasData
(
chart
)),
)
||
{
metrics
:
[]
};
return
groupWithMetrics
.
metrics
.
filter
(
chart
=>
this
.
chartHasData
(
chart
));
},
isSingleChart
()
{
return
this
.
charts
.
length
===
1
;
},
},
mounted
()
{
...
...
@@ -66,10 +69,8 @@ export default {
'
setFeatureFlags
'
,
'
setShowErrorBanner
'
,
]),
chartsWithData
(
charts
)
{
return
charts
.
filter
(
chart
=>
chart
.
metrics
.
some
(
metric
=>
this
.
metricsWithData
.
includes
(
metric
.
metric_id
)),
);
chartHasData
(
chart
)
{
return
chart
.
metrics
.
some
(
metric
=>
this
.
metricsWithData
.
includes
(
metric
.
metric_id
));
},
onSidebarMutation
()
{
setTimeout
(()
=>
{
...
...
@@ -89,16 +90,17 @@ export default {
};
</
script
>
<
template
>
<div
class=
"metrics-embed"
>
<div
v-if=
"
groupData
"
class=
"row w-100 m-n2 pb-4"
>
<div
class=
"metrics-embed"
:class=
"
{ 'd-inline-flex col-lg-6 p-0': isSingleChart }"
>
<div
v-if=
"
charts.length
"
class=
"row w-100 m-n2 pb-4"
>
<monitor-area-chart
v-for=
"graphData in charts
WithData(groupData.metrics)
"
v-for=
"graphData in charts"
:key=
"graphData.title"
:graph-data=
"graphData"
:container-width=
"elWidth"
group-id=
"monitor-area-chart"
:project-path=
"null"
:show-border=
"true"
:single-embed=
"isSingleChart"
/>
</div>
</div>
...
...
changelogs/unreleased/62971-embed-specific-metrics-chart-in-issue.yml
0 → 100644
View file @
56a10f02
---
title
:
Embed specific metrics chart in issue
merge_request
:
31644
author
:
type
:
added
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