Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
0ff5ff5d
Commit
0ff5ff5d
authored
Nov 25, 2015
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enabled refresh interval for absolute time range
parent
85382dc2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
public/app/features/dashboard/timeSrv.js
+1
-6
public/test/specs/time_srv_specs.js
+9
-2
No files found.
public/app/features/dashboard/timeSrv.js
View file @
0ff5ff5d
...
...
@@ -93,12 +93,7 @@ define([
this
.
setTime
=
function
(
time
)
{
_
.
extend
(
this
.
time
,
time
);
// disable refresh if we have an absolute time
if
(
moment
.
isMoment
(
time
.
to
))
{
this
.
old_refresh
=
this
.
dashboard
.
refresh
||
this
.
old_refresh
;
this
.
setAutoRefresh
(
false
);
}
else
if
(
this
.
old_refresh
&&
this
.
old_refresh
!==
this
.
dashboard
.
refresh
)
{
if
(
this
.
old_refresh
&&
this
.
old_refresh
!==
this
.
dashboard
.
refresh
)
{
this
.
setAutoRefresh
(
this
.
old_refresh
);
this
.
old_refresh
=
null
;
}
...
...
public/test/specs/time_srv_specs.js
View file @
0ff5ff5d
...
...
@@ -78,17 +78,24 @@ define([
});
describe
(
'setTime'
,
function
()
{
it
(
'should return disable refresh
for absolute times
'
,
function
()
{
it
(
'should return disable refresh
if refresh is disabled for any range
'
,
function
()
{
_dashboard
.
refresh
=
false
;
ctx
.
service
.
setTime
({
from
:
'2011-01-01'
,
to
:
'2015-01-01'
});
expect
(
_dashboard
.
refresh
).
to
.
be
(
false
);
});
it
(
'should restore refresh for absolute time range'
,
function
()
{
_dashboard
.
refresh
=
'30s'
;
ctx
.
service
.
setTime
({
from
:
'2011-01-01'
,
to
:
'2015-01-01'
});
expect
(
_dashboard
.
refresh
).
to
.
be
(
'30s'
);
});
it
(
'should restore refresh after relative time range is set'
,
function
()
{
_dashboard
.
refresh
=
'10s'
;
ctx
.
service
.
setTime
({
from
:
moment
([
2011
,
1
,
1
]),
to
:
moment
([
2015
,
1
,
1
])});
expect
(
_dashboard
.
refresh
).
to
.
be
(
false
);
expect
(
_dashboard
.
refresh
).
to
.
be
(
'10s'
);
ctx
.
service
.
setTime
({
from
:
'2011-01-01'
,
to
:
'now'
});
expect
(
_dashboard
.
refresh
).
to
.
be
(
'10s'
);
});
...
...
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