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
7da57e0a
Commit
7da57e0a
authored
Mar 02, 2016
by
Mitsuhiro Tanda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
align refresh interval
parent
0da41688
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
public/app/features/dashboard/timeSrv.js
+8
-2
public/app/features/dashboard/timepicker/dropdown.html
+1
-0
public/app/features/dashboard/timepicker/timepicker.ts
+1
-1
No files found.
public/app/features/dashboard/timeSrv.js
View file @
7da57e0a
...
@@ -65,11 +65,17 @@ define([
...
@@ -65,11 +65,17 @@ define([
}
}
};
};
this
.
setAutoRefresh
=
function
(
interval
)
{
this
.
setAutoRefresh
=
function
(
interval
,
align
)
{
this
.
dashboard
.
refresh
=
interval
;
this
.
dashboard
.
refresh
=
interval
;
if
(
interval
)
{
if
(
interval
)
{
var
_i
=
kbn
.
interval_to_ms
(
interval
);
var
_i
=
kbn
.
interval_to_ms
(
interval
);
this
.
start_scheduled_refresh
(
_i
);
var
wait_ms
=
0
;
if
(
align
)
{
wait_ms
=
_i
-
(
Date
.
now
()
%
_i
);
}
$timeout
(
function
()
{
self
.
start_scheduled_refresh
(
_i
);
},
wait_ms
);
}
else
{
}
else
{
this
.
cancel_scheduled_refresh
();
this
.
cancel_scheduled_refresh
();
}
}
...
...
public/app/features/dashboard/timepicker/dropdown.html
View file @
7da57e0a
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
<div
class=
"gf-form max-width-28"
>
<div
class=
"gf-form max-width-28"
>
<select
ng-model=
"ctrl.refresh.value"
class=
"gf-form-input input-medium"
ng-options=
"f.value as f.text for f in ctrl.refresh.options"
></select>
<select
ng-model=
"ctrl.refresh.value"
class=
"gf-form-input input-medium"
ng-options=
"f.value as f.text for f in ctrl.refresh.options"
></select>
</div>
</div>
<editor-checkbox
text=
"Align"
model=
"ctrl.refresh.align"
></editor-checkbox>
<div
class=
"gf-form"
>
<div
class=
"gf-form"
>
<button
type=
"submit"
class=
"btn gf-form-btn btn-secondary"
ng-click=
"ctrl.applyCustom();"
ng-disabled=
"!timeForm.$valid"
>
Apply
</button>
<button
type=
"submit"
class=
"btn gf-form-btn btn-secondary"
ng-click=
"ctrl.applyCustom();"
ng-disabled=
"!timeForm.$valid"
>
Apply
</button>
</div>
</div>
...
...
public/app/features/dashboard/timepicker/timepicker.ts
View file @
7da57e0a
...
@@ -109,7 +109,7 @@ export class TimePickerCtrl {
...
@@ -109,7 +109,7 @@ export class TimePickerCtrl {
applyCustom
()
{
applyCustom
()
{
if
(
this
.
refresh
.
value
!==
this
.
dashboard
.
refresh
)
{
if
(
this
.
refresh
.
value
!==
this
.
dashboard
.
refresh
)
{
this
.
timeSrv
.
setAutoRefresh
(
this
.
refresh
.
value
);
this
.
timeSrv
.
setAutoRefresh
(
this
.
refresh
.
value
,
this
.
refresh
.
align
);
}
}
this
.
timeSrv
.
setTime
(
this
.
timeRaw
,
true
);
this
.
timeSrv
.
setTime
(
this
.
timeRaw
,
true
);
...
...
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