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
712a4202
Commit
712a4202
authored
Nov 29, 2015
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed refresh setting for absolute time
parent
0ff5ff5d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
public/app/features/dashboard/timeSrv.js
+7
-2
public/app/features/dashboard/timepicker/timepicker.ts
+1
-1
public/test/specs/time_srv_specs.js
+8
-1
No files found.
public/app/features/dashboard/timeSrv.js
View file @
712a4202
...
...
@@ -90,10 +90,15 @@ define([
timer
.
cancel
(
this
.
refresh_timer
);
};
this
.
setTime
=
function
(
time
)
{
this
.
setTime
=
function
(
time
,
enableRefresh
)
{
_
.
extend
(
this
.
time
,
time
);
if
(
this
.
old_refresh
&&
this
.
old_refresh
!==
this
.
dashboard
.
refresh
)
{
// disable refresh if zoom in or zoom out
if
(
!
enableRefresh
&&
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
)
{
this
.
setAutoRefresh
(
this
.
old_refresh
);
this
.
old_refresh
=
null
;
}
...
...
public/app/features/dashboard/timepicker/timepicker.ts
View file @
712a4202
...
...
@@ -115,7 +115,7 @@ export class TimePickerCtrl {
this
.
timeSrv
.
setAutoRefresh
(
this
.
refresh
.
value
);
}
this
.
timeSrv
.
setTime
(
this
.
timeRaw
);
this
.
timeSrv
.
setTime
(
this
.
timeRaw
,
true
);
this
.
$rootScope
.
appEvent
(
'hide-dash-editor'
);
}
...
...
public/test/specs/time_srv_specs.js
View file @
712a4202
...
...
@@ -92,10 +92,17 @@ define([
expect
(
_dashboard
.
refresh
).
to
.
be
(
'30s'
);
});
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
(
'10s'
);
expect
(
_dashboard
.
refresh
).
to
.
be
(
false
);
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