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
976f1feb
Commit
976f1feb
authored
Apr 03, 2019
by
Jose Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document getTimeDifferenceMinutes usage
Also added a finally clause to the getGraphsDataWithTime promise
parent
a6f9f79b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
app/assets/javascripts/monitoring/components/dashboard.vue
app/assets/javascripts/monitoring/components/dashboard.vue
+3
-2
app/assets/javascripts/monitoring/utils.js
app/assets/javascripts/monitoring/utils.js
+6
-0
spec/javascripts/monitoring/dashboard_spec.js
spec/javascripts/monitoring/dashboard_spec.js
+1
-1
No files found.
app/assets/javascripts/monitoring/components/dashboard.vue
View file @
976f1feb
...
...
@@ -178,11 +178,12 @@ export default {
.
then
(
data
=>
{
this
.
store
.
storeMetrics
(
data
);
this
.
selectedTimeWindow
=
this
.
timeWindows
[
timeFrame
];
this
.
showEmptyState
=
false
;
})
.
catch
(()
=>
{
this
.
showEmptyState
=
false
;
Flash
(
s__
(
'
Metrics|Not enough data to display
'
));
})
.
finally
(()
=>
{
this
.
showEmptyState
=
false
;
});
},
onSidebarMutation
()
{
...
...
app/assets/javascripts/monitoring/utils.js
View file @
976f1feb
import
{
timeWindows
,
msPerMinute
}
from
'
./constants
'
;
/**
* method that converts a predetermined time window to minutes
* defaults to 8 hours as the default option
* @param {String} timeWindow - The time window to convert to minutes
* @returns {number} The time window in minutes
*/
const
getTimeDifferenceMinutes
=
timeWindow
=>
{
switch
(
timeWindow
)
{
case
timeWindows
.
thirtyMinutes
:
...
...
spec/javascripts/monitoring/dashboard_spec.js
View file @
976f1feb
...
...
@@ -224,7 +224,7 @@ describe('Dashboard', () => {
});
});
it
(
'
re
w
nders the time window dropdown with a set of options
'
,
done
=>
{
it
(
'
renders the time window dropdown with a set of options
'
,
done
=>
{
const
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
propsData
:
{
...
...
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