Clarify timeRange lookup by matching on explicit Lower string
Update initial timeRange for status reducerpull/10616/head
parent
e24d5bcc92
commit
b1499cc0e1
|
@ -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: [],
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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'),
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -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'),
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue