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
316aa05d
Commit
316aa05d
authored
Jul 23, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed timepicker
parent
4774a7a6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
common/css/timepicker.css
+0
-0
common/lib/timepicker.js
+0
-0
panels/timepicker/module.js
+10
-4
No files found.
common/css/timepicker.css
View file @
316aa05d
This diff is collapsed.
Click to expand it.
common/lib/timepicker.js
View file @
316aa05d
This diff is collapsed.
Click to expand it.
panels/timepicker/module.js
View file @
316aa05d
...
...
@@ -86,6 +86,7 @@ angular.module('kibana.timepicker', [])
// In case some other panel broadcasts a time, set us to an absolute range
$scope
.
$on
(
'refresh'
,
function
()
{
/*
if(filterSrv.idsByType('time').length > 0) {
var time = filterSrv.timeRange('min');
...
...
@@ -93,6 +94,8 @@ angular.module('kibana.timepicker', [])
$scope.time.to.diff(moment.utc(time.to),'seconds') !== 0)
{
console.log('time mismatch!')
return;
$scope.set_mode('absolute');
// These 3 statements basicly do everything time_apply() does
...
...
@@ -101,6 +104,7 @@ angular.module('kibana.timepicker', [])
update_panel();
}
}
*/
});
};
...
...
@@ -176,12 +180,12 @@ angular.module('kibana.timepicker', [])
//
$scope
.
time_calc
=
function
(){
var
from
,
to
;
// If time picker is defined (usually is)
// If time picker is defined (usually is)
TOFIX: Horrible parsing
if
(
!
(
_
.
isUndefined
(
$scope
.
timepicker
)))
{
from
=
$scope
.
panel
.
mode
===
'relative'
?
moment
(
kbn
.
time_ago
(
$scope
.
panel
.
timespan
))
:
moment
(
$scope
.
timepicker
.
from
.
date
+
" "
+
$scope
.
timepicker
.
from
.
time
,
'MM/DD/YYYY HH:mm:ss'
);
moment
(
moment
.
utc
(
$scope
.
timepicker
.
from
.
date
).
format
(
'MM/DD/YYYY'
)
+
" "
+
$scope
.
timepicker
.
from
.
time
,
'MM/DD/YYYY HH:mm:ss'
);
to
=
$scope
.
panel
.
mode
!==
'absolute'
?
moment
()
:
moment
(
$scope
.
timepicker
.
to
.
date
+
" "
+
$scope
.
timepicker
.
to
.
time
,
'MM/DD/YYYY HH:mm:ss'
);
moment
(
moment
.
utc
(
$scope
.
timepicker
.
to
.
date
).
format
(
'MM/DD/YYYY'
)
+
" "
+
$scope
.
timepicker
.
to
.
time
,
'MM/DD/YYYY HH:mm:ss'
);
// Otherwise (probably initialization)
}
else
{
from
=
$scope
.
panel
.
mode
===
'relative'
?
moment
(
kbn
.
time_ago
(
$scope
.
panel
.
timespan
))
:
...
...
@@ -211,11 +215,13 @@ angular.module('kibana.timepicker', [])
// Remove all other time filters
filterSrv
.
removeByType
(
'time'
);
$scope
.
time
=
$scope
.
time_calc
();
$scope
.
time
.
field
=
$scope
.
panel
.
timefield
;
update_panel
();
update_panel
();
set_time_filter
(
$scope
.
time
);
dashboard
.
refresh
();
};
...
...
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