Add :interval: to DataExplorer
parent
de352b0f16
commit
80b88beaad
|
@ -8,10 +8,9 @@ import Dropdown from 'shared/components/Dropdown'
|
|||
import {AUTO_GROUP_BY} from 'shared/constants'
|
||||
|
||||
const isInRuleBuilder = pathname => pathname.includes('alert-rules')
|
||||
const isInDataExplorer = pathname => pathname.includes('data-explorer')
|
||||
|
||||
const getOptions = pathname =>
|
||||
isInDataExplorer(pathname) || isInRuleBuilder(pathname)
|
||||
isInRuleBuilder(pathname)
|
||||
? groupByTimeOptions.filter(({menuOption}) => menuOption !== AUTO_GROUP_BY)
|
||||
: groupByTimeOptions
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import ResizeContainer from 'shared/components/ResizeContainer'
|
|||
import OverlayTechnologies from 'shared/components/OverlayTechnologies'
|
||||
import ManualRefresh from 'src/shared/components/ManualRefresh'
|
||||
|
||||
import {VIS_VIEWS, INITIAL_GROUP_BY_TIME} from 'shared/constants'
|
||||
import {VIS_VIEWS, AUTO_GROUP_BY} from 'shared/constants'
|
||||
import {MINIMUM_HEIGHTS, INITIAL_HEIGHTS} from '../constants'
|
||||
import {errorThrown} from 'shared/actions/errors'
|
||||
import {setAutoRefresh} from 'shared/actions/app'
|
||||
|
@ -88,6 +88,26 @@ class DataExplorer extends Component {
|
|||
|
||||
const {showWriteForm} = this.state
|
||||
const selectedDatabase = _.get(queryConfigs, ['0', 'database'], null)
|
||||
const interval = {
|
||||
id: 'interval',
|
||||
type: 'autoGroupBy',
|
||||
tempVar: ':interval:',
|
||||
label: 'automatically determine the best group by time',
|
||||
values: [
|
||||
{
|
||||
value: '1000', // pixels
|
||||
type: 'resolution',
|
||||
selected: true,
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
type: 'pointsPerPixel',
|
||||
selected: true,
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const templates = [interval]
|
||||
|
||||
return (
|
||||
<div className="data-explorer">
|
||||
|
@ -122,12 +142,13 @@ class DataExplorer extends Component {
|
|||
actions={queryConfigActions}
|
||||
timeRange={timeRange}
|
||||
activeQuery={this.getActiveQuery()}
|
||||
initialGroupByTime={INITIAL_GROUP_BY_TIME}
|
||||
initialGroupByTime={AUTO_GROUP_BY}
|
||||
/>
|
||||
<Visualization
|
||||
views={VIS_VIEWS}
|
||||
activeQueryIndex={0}
|
||||
timeRange={timeRange}
|
||||
templates={templates}
|
||||
autoRefresh={autoRefresh}
|
||||
queryConfigs={queryConfigs}
|
||||
manualRefresh={manualRefresh}
|
||||
|
|
Loading…
Reference in New Issue