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
519dfd08
Unverified
Commit
519dfd08
authored
Feb 11, 2019
by
Marcus Efraimsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make sure influx takes dashboard timezone into consideration
parent
37a73b6b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
public/app/plugins/datasource/influxdb/datasource.ts
+6
-6
No files found.
public/app/plugins/datasource/influxdb/datasource.ts
View file @
519dfd08
...
@@ -127,7 +127,7 @@ export default class InfluxDatasource {
...
@@ -127,7 +127,7 @@ export default class InfluxDatasource {
});
});
}
}
const
timeFilter
=
this
.
getTimeFilter
({
rangeRaw
:
options
.
rangeRaw
});
const
timeFilter
=
this
.
getTimeFilter
({
rangeRaw
:
options
.
rangeRaw
,
timezone
:
options
.
timezone
});
let
query
=
options
.
annotation
.
query
.
replace
(
'$timeFilter'
,
timeFilter
);
let
query
=
options
.
annotation
.
query
.
replace
(
'$timeFilter'
,
timeFilter
);
query
=
this
.
templateSrv
.
replace
(
query
,
null
,
'regex'
);
query
=
this
.
templateSrv
.
replace
(
query
,
null
,
'regex'
);
...
@@ -184,7 +184,7 @@ export default class InfluxDatasource {
...
@@ -184,7 +184,7 @@ export default class InfluxDatasource {
}
}
if
(
options
&&
options
.
range
)
{
if
(
options
&&
options
.
range
)
{
const
timeFilter
=
this
.
getTimeFilter
({
rangeRaw
:
options
.
range
});
const
timeFilter
=
this
.
getTimeFilter
({
rangeRaw
:
options
.
range
,
timezone
:
options
.
timezone
});
query
=
query
.
replace
(
'$timeFilter'
,
timeFilter
);
query
=
query
.
replace
(
'$timeFilter'
,
timeFilter
);
}
}
...
@@ -291,8 +291,8 @@ export default class InfluxDatasource {
...
@@ -291,8 +291,8 @@ export default class InfluxDatasource {
}
}
getTimeFilter
(
options
)
{
getTimeFilter
(
options
)
{
const
from
=
this
.
getInfluxTime
(
options
.
rangeRaw
.
from
,
false
);
const
from
=
this
.
getInfluxTime
(
options
.
rangeRaw
.
from
,
false
,
options
.
timezone
);
const
until
=
this
.
getInfluxTime
(
options
.
rangeRaw
.
to
,
true
);
const
until
=
this
.
getInfluxTime
(
options
.
rangeRaw
.
to
,
true
,
options
.
timezone
);
const
fromIsAbsolute
=
from
[
from
.
length
-
1
]
===
'ms'
;
const
fromIsAbsolute
=
from
[
from
.
length
-
1
]
===
'ms'
;
if
(
until
===
'now()'
&&
!
fromIsAbsolute
)
{
if
(
until
===
'now()'
&&
!
fromIsAbsolute
)
{
...
@@ -302,7 +302,7 @@ export default class InfluxDatasource {
...
@@ -302,7 +302,7 @@ export default class InfluxDatasource {
return
'time >= '
+
from
+
' and time <= '
+
until
;
return
'time >= '
+
from
+
' and time <= '
+
until
;
}
}
getInfluxTime
(
date
,
roundUp
)
{
getInfluxTime
(
date
,
roundUp
,
timezone
)
{
if
(
_
.
isString
(
date
))
{
if
(
_
.
isString
(
date
))
{
if
(
date
===
'now'
)
{
if
(
date
===
'now'
)
{
return
'now()'
;
return
'now()'
;
...
@@ -314,7 +314,7 @@ export default class InfluxDatasource {
...
@@ -314,7 +314,7 @@ export default class InfluxDatasource {
const
unit
=
parts
[
2
];
const
unit
=
parts
[
2
];
return
'now() - '
+
amount
+
unit
;
return
'now() - '
+
amount
+
unit
;
}
}
date
=
dateMath
.
parse
(
date
,
roundUp
);
date
=
dateMath
.
parse
(
date
,
roundUp
,
timezone
);
}
}
return
date
.
valueOf
()
+
'ms'
;
return
date
.
valueOf
()
+
'ms'
;
...
...
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