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
291dd9bd
Commit
291dd9bd
authored
Mar 01, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
absolute time ranges (zoom in) works with influxdb
parent
549eeeb2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
9 deletions
+29
-9
src/app/panels/graphite/module.js
+3
-4
src/app/partials/influxdb/editor.html
+5
-4
src/app/services/influxdb/influxdbDatasource.js
+21
-1
No files found.
src/app/panels/graphite/module.js
View file @
291dd9bd
...
...
@@ -207,8 +207,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
$scope
.
datasources
=
datasourceSrv
.
listOptions
();
$scope
.
datasourceChanged
();
$scope
.
get_data
();
};
$scope
.
datasourceChanged
=
function
()
{
...
...
@@ -225,12 +223,13 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
$scope
.
updateTimeRange
=
function
()
{
$scope
.
range
=
filterSrv
.
timeRange
();
$scope
.
rangeUnparsed
=
filterSrv
.
timeRange
(
false
);
$scope
.
resolution
=
(
$
(
window
).
width
()
/
(
$scope
.
panel
.
span
/
12
))
/
2
;
$scope
.
interval
=
'10m'
;
if
(
$scope
.
range
)
{
$scope
.
interval
=
kbn
.
secondsToHms
(
kbn
.
calculate_interval
(
$scope
.
range
.
from
,
$scope
.
range
.
to
,
$scope
.
panel
.
resolution
,
0
)
/
1000
kbn
.
calculate_interval
(
$scope
.
range
.
from
,
$scope
.
range
.
to
,
$scope
.
resolution
,
0
)
/
1000
);
}
};
...
...
@@ -247,7 +246,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
interval
:
$scope
.
interval
,
targets
:
$scope
.
panel
.
targets
,
format
:
$scope
.
panel
.
renderer
===
'png'
?
'png'
:
'json'
,
maxDataPoints
:
$scope
.
panel
.
span
*
50
,
maxDataPoints
:
$scope
.
resolution
,
datasource
:
$scope
.
panel
.
datasource
};
...
...
src/app/partials/influxdb/editor.html
View file @
291dd9bd
...
...
@@ -46,7 +46,7 @@
<ul
class=
"grafana-segment-list"
role=
"menu"
>
<li>
<a
class=
"grafana-target-segment"
>
F
rom series
f
rom series
</a>
</li>
<li>
...
...
@@ -59,7 +59,7 @@
</li>
<li>
<a
class=
"grafana-target-segment"
>
S
elect
s
elect
</a>
</li>
<li>
...
...
@@ -72,7 +72,7 @@
</li>
<li>
<a
class=
"grafana-target-segment"
>
F
unction
f
unction
</a>
</li>
<li>
...
...
@@ -88,5 +88,5 @@
</div>
<div
class=
"editor-row"
style=
"margin-top: 20px"
ng-show=
"editor.index == 1"
>
<button
class=
"btn btn-success pull-right"
ng-click=
"add_target(panel.target)"
>
Add
target
</button>
<button
class=
"btn btn-success pull-right"
ng-click=
"add_target(panel.target)"
>
Add
query
</button>
</div>
\ No newline at end of file
src/app/services/influxdb/influxdbDatasource.js
View file @
291dd9bd
...
...
@@ -86,7 +86,27 @@ function (angular, _) {
};
function
getTimeFilter
(
options
)
{
return
"time > now() - 6h"
;
var
from
=
options
.
range
.
from
;
var
until
=
options
.
range
.
to
;
if
(
_
.
isString
(
from
))
{
return
'time > now() - '
+
from
.
substring
(
4
);
}
else
{
from
=
to_utc_epoch_seconds
(
from
);
}
if
(
until
===
'now'
)
{
return
'time > '
+
from
;
}
else
{
until
=
to_utc_epoch_seconds
(
until
);
return
'time > '
+
from
+
' and time < '
+
until
;
}
}
function
to_utc_epoch_seconds
(
date
)
{
return
(
date
.
getTime
()
/
1000
).
toFixed
(
0
)
+
's'
;
}
...
...
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