Add format to timeRange
parent
d4f002cc63
commit
d6663a1dcb
|
@ -23,7 +23,12 @@ import {
|
|||
} from 'shared/actions/app'
|
||||
import {presentationButtonDispatcher} from 'shared/dispatchers'
|
||||
|
||||
const defaultTimeRange = {upper: null, lower: 'now() - 15m'}
|
||||
const FORMAT_INFLUXQL = 'influxql'
|
||||
const defaultTimeRange = {
|
||||
upper: null,
|
||||
lower: 'now() - 15m',
|
||||
format: FORMAT_INFLUXQL,
|
||||
}
|
||||
|
||||
class DashboardPage extends Component {
|
||||
constructor(props) {
|
||||
|
@ -92,6 +97,7 @@ class DashboardPage extends Component {
|
|||
dashboardActions.setDashTimeV1(dashboard.id, {
|
||||
upper,
|
||||
lower,
|
||||
format: FORMAT_INFLUXQL,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ const dashTimeV1 = (state = initialState, action) => {
|
|||
}
|
||||
|
||||
case 'SET_DASHBOARD_TIME_V1': {
|
||||
const {dashboardID, timeRange: {upper, lower}} = action.payload
|
||||
const newTimeRange = [{dashboardID, upper, lower}]
|
||||
const {dashboardID, timeRange: {upper, lower, format}} = action.payload
|
||||
const newTimeRange = [{dashboardID, upper, lower, format}]
|
||||
const ranges = _.unionBy(newTimeRange, state.ranges, 'dashboardID')
|
||||
|
||||
return {...state, ranges}
|
||||
|
|
Loading…
Reference in New Issue