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
d62e5c92
Commit
d62e5c92
authored
Mar 13, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update timepicker on set_time event
parent
d1169b4b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
12 deletions
+24
-12
panels/histogram/module.js
+1
-1
panels/timepicker/module.js
+23
-11
No files found.
panels/histogram/module.js
View file @
d62e5c92
...
...
@@ -261,7 +261,7 @@ angular.module('kibana.histogram', [])
scope
.
time
.
from
=
new
Date
(
ranges
.
xaxis
.
from
);
scope
.
time
.
to
=
new
Date
(
ranges
.
xaxis
.
to
)
scope
.
set_time
(
scope
.
time
);
eventBus
.
broadcast
(
scope
.
$id
,
scope
.
panel
.
group
,
'time'
,
scope
.
time
)
eventBus
.
broadcast
(
scope
.
$id
,
scope
.
panel
.
group
,
'
set_
time'
,
scope
.
time
)
});
}
};
...
...
panels/timepicker/module.js
View file @
d62e5c92
...
...
@@ -83,6 +83,14 @@ angular.module('kibana.timepicker', [])
eventBus
.
register
(
$scope
,
"get_time"
,
function
(
event
,
id
)
{
eventBus
.
broadcast
(
$scope
.
$id
,
id
,
'time'
,
$scope
.
time
)
});
// In case some other panel broadcasts a time, set us to an absolute range
eventBus
.
register
(
$scope
,
"set_time"
,
function
(
event
,
time
)
{
$scope
.
panel
.
mode
=
'absolute'
;
set_timepicker
(
time
.
from
,
time
.
to
)
$scope
.
time_apply
()
});
$scope
.
$on
(
'render'
,
function
(){
$scope
.
time_apply
();
});
...
...
@@ -157,18 +165,8 @@ angular.module('kibana.timepicker', [])
if
(
from
.
getTime
()
>=
to
.
getTime
())
from
=
new
Date
(
to
.
getTime
()
-
1000
)
// Janky 0s timeout to get around $scope queue processing view issue
$timeout
(
function
(){
$scope
.
timepicker
=
{
from
:
{
time
:
from
.
format
(
"HH:MM:ss"
),
date
:
from
.
format
(
"mm/dd/yyyy"
)
},
to
:
{
time
:
to
.
format
(
"HH:MM:ss"
),
date
:
to
.
format
(
"mm/dd/yyyy"
)
}
}
set_timepicker
(
from
,
to
)
});
return
{
...
...
@@ -202,6 +200,20 @@ angular.module('kibana.timepicker', [])
};
};
function
set_timepicker
(
from
,
to
)
{
// Janky 0s timeout to get around $scope queue processing view issue
$scope
.
timepicker
=
{
from
:
{
time
:
from
.
format
(
"HH:MM:ss"
),
date
:
from
.
format
(
"mm/dd/yyyy"
)
},
to
:
{
time
:
to
.
format
(
"HH:MM:ss"
),
date
:
to
.
format
(
"mm/dd/yyyy"
)
}
}
}
// returns a promise containing an array of all indices matching the index
// pattern that exist in a given range
function
indices
(
from
,
to
)
{
...
...
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