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'
|
import {AUTO_GROUP_BY} from 'shared/constants'
|
||||||
|
|
||||||
const isInRuleBuilder = pathname => pathname.includes('alert-rules')
|
const isInRuleBuilder = pathname => pathname.includes('alert-rules')
|
||||||
const isInDataExplorer = pathname => pathname.includes('data-explorer')
|
|
||||||
|
|
||||||
const getOptions = pathname =>
|
const getOptions = pathname =>
|
||||||
isInDataExplorer(pathname) || isInRuleBuilder(pathname)
|
isInRuleBuilder(pathname)
|
||||||
? groupByTimeOptions.filter(({menuOption}) => menuOption !== AUTO_GROUP_BY)
|
? groupByTimeOptions.filter(({menuOption}) => menuOption !== AUTO_GROUP_BY)
|
||||||
: groupByTimeOptions
|
: groupByTimeOptions
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import ResizeContainer from 'shared/components/ResizeContainer'
|
||||||
import OverlayTechnologies from 'shared/components/OverlayTechnologies'
|
import OverlayTechnologies from 'shared/components/OverlayTechnologies'
|
||||||
import ManualRefresh from 'src/shared/components/ManualRefresh'
|
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 {MINIMUM_HEIGHTS, INITIAL_HEIGHTS} from '../constants'
|
||||||
import {errorThrown} from 'shared/actions/errors'
|
import {errorThrown} from 'shared/actions/errors'
|
||||||
import {setAutoRefresh} from 'shared/actions/app'
|
import {setAutoRefresh} from 'shared/actions/app'
|
||||||
|
@ -88,6 +88,26 @@ class DataExplorer extends Component {
|
||||||
|
|
||||||
const {showWriteForm} = this.state
|
const {showWriteForm} = this.state
|
||||||
const selectedDatabase = _.get(queryConfigs, ['0', 'database'], null)
|
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 (
|
return (
|
||||||
<div className="data-explorer">
|
<div className="data-explorer">
|
||||||
|
@ -122,12 +142,13 @@ class DataExplorer extends Component {
|
||||||
actions={queryConfigActions}
|
actions={queryConfigActions}
|
||||||
timeRange={timeRange}
|
timeRange={timeRange}
|
||||||
activeQuery={this.getActiveQuery()}
|
activeQuery={this.getActiveQuery()}
|
||||||
initialGroupByTime={INITIAL_GROUP_BY_TIME}
|
initialGroupByTime={AUTO_GROUP_BY}
|
||||||
/>
|
/>
|
||||||
<Visualization
|
<Visualization
|
||||||
views={VIS_VIEWS}
|
views={VIS_VIEWS}
|
||||||
activeQueryIndex={0}
|
activeQueryIndex={0}
|
||||||
timeRange={timeRange}
|
timeRange={timeRange}
|
||||||
|
templates={templates}
|
||||||
autoRefresh={autoRefresh}
|
autoRefresh={autoRefresh}
|
||||||
queryConfigs={queryConfigs}
|
queryConfigs={queryConfigs}
|
||||||
manualRefresh={manualRefresh}
|
manualRefresh={manualRefresh}
|
||||||
|
|
Loading…
Reference in New Issue