Clarify timeRange lookup by matching on explicit Lower string

Update initial timeRange for status reducer
pull/10616/head
Jared Scheib 2017-06-08 02:28:24 -05:00
parent e24d5bcc92
commit b1499cc0e1
5 changed files with 5 additions and 8 deletions

View File

@ -1,7 +1,7 @@
import _ from 'lodash'
import timeRanges from 'hson!shared/data/timeRanges.hson'
const {lower, upper} = timeRanges[2]
const {lower, upper} = timeRanges.find(tr => tr.lower === 'now() - 1h')
const initialState = {
dashboards: [],

View File

@ -1,6 +1,6 @@
import timeRanges from 'hson!shared/data/timeRanges.hson'
const {lower, upper} = timeRanges[2]
const {lower, upper} = timeRanges.find(tr => tr.lower === 'now() - 1h')
const initialState = {
upper,

View File

@ -47,12 +47,10 @@ export const HostPage = React.createClass({
},
getInitialState() {
const timeRange = timeRanges[2]
return {
layouts: [],
hosts: [],
timeRange,
timeRange: timeRanges.find(tr => tr.lower === 'now() - 1h'),
}
},

View File

@ -29,9 +29,8 @@ export const KapacitorRule = React.createClass({
},
getInitialState() {
const fifteenMinutesIndex = 1
return {
timeRange: timeRanges[fifteenMinutesIndex],
timeRange: timeRanges.find(tr => tr.lower === 'now() - 15m'),
}
},

View File

@ -1,7 +1,7 @@
import {AUTOREFRESH_DEFAULT} from 'shared/constants'
import timeRanges from 'hson!shared/data/timeRanges.hson'
const {lower, upper} = timeRanges[2]
const {lower, upper} = timeRanges.find(tr => tr.lower === 'now() - 30d')
const initialState = {
autoRefresh: AUTOREFRESH_DEFAULT,