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
688c21cd
Commit
688c21cd
authored
Apr 08, 2014
by
Aaron Bassett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added little workraround for graphites timezones/DST failures
parent
39e19fdf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletions
+12
-1
src/app/components/settings.js
+11
-1
src/config.sample.js
+1
-0
No files found.
src/app/components/settings.js
View file @
688c21cd
...
@@ -24,7 +24,7 @@ function (_, crypto) {
...
@@ -24,7 +24,7 @@ function (_, crypto) {
default_route
:
'/dashboard/file/default.json'
,
default_route
:
'/dashboard/file/default.json'
,
grafana_index
:
'grafana-dash'
,
grafana_index
:
'grafana-dash'
,
elasticsearch_all_disabled
:
false
,
elasticsearch_all_disabled
:
false
,
timezoneOffset
:
null
,
timezoneOffset
:
'auto'
,
};
};
// This initializes a new hash on purpose, to avoid adding parameters to
// This initializes a new hash on purpose, to avoid adding parameters to
...
@@ -59,6 +59,16 @@ function (_, crypto) {
...
@@ -59,6 +59,16 @@ function (_, crypto) {
};
};
}
}
if
(
settings
.
timezoneOffset
===
'auto'
)
{
//this hack is to deal with graphites poor tz support. It doesn't like
// DST, so we're gonna make a january (non-dst) date and get its offset
var
nonDSTDate
=
new
Date
(
new
Date
().
getFullYear
(),
0
,
1
);
//given "Tue Apr 08 2014 08:24:50 GMT-0400 (EDT)", get "-0400"
settings
.
timezoneOffset
=
nonDSTDate
.
toString
().
split
(
' '
)[
5
].
substring
(
3
);
}
_
.
each
(
settings
.
datasources
,
function
(
datasource
,
key
)
{
_
.
each
(
settings
.
datasources
,
function
(
datasource
,
key
)
{
datasource
.
name
=
key
;
datasource
.
name
=
key
;
parseBasicAuth
(
datasource
);
parseBasicAuth
(
datasource
);
...
...
src/config.sample.js
View file @
688c21cd
...
@@ -38,6 +38,7 @@ function (Settings) {
...
@@ -38,6 +38,7 @@ function (Settings) {
/**
/**
* If your graphite server has another timezone than you & users browsers specify the offset here
* If your graphite server has another timezone than you & users browsers specify the offset here
* Example: "-0500" (for UTC - 5 hours)
* Example: "-0500" (for UTC - 5 hours)
* If your graphite server runs UTC, you can set this to "auto" and it will pick the right timezone for you
*/
*/
timezoneOffset
:
null
,
timezoneOffset
:
null
,
...
...
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