commit
fdde3201d4
|
@ -21,6 +21,7 @@
|
||||||
1. [#2040](https://github.com/influxdata/chronograf/pull/2040): Prevent the legend from overlapping graphs at the bottom of the screen
|
1. [#2040](https://github.com/influxdata/chronograf/pull/2040): Prevent the legend from overlapping graphs at the bottom of the screen
|
||||||
1. [#2054](https://github.com/influxdata/chronograf/pull/2054): Add a "Plus" icon to every button with an Add or Create action for clarity and consistency
|
1. [#2054](https://github.com/influxdata/chronograf/pull/2054): Add a "Plus" icon to every button with an Add or Create action for clarity and consistency
|
||||||
1. [#2052](https://github.com/influxdata/chronograf/pull/2052): Make hovering over series smoother
|
1. [#2052](https://github.com/influxdata/chronograf/pull/2052): Make hovering over series smoother
|
||||||
|
1. [#2072](https://github.com/influxdata/chronograf/pull/2072): Remove tabs from Data Explorer
|
||||||
1. [#2057](https://github.com/influxdata/chronograf/pull/2057): Improve appearance of placeholder text in inputs
|
1. [#2057](https://github.com/influxdata/chronograf/pull/2057): Improve appearance of placeholder text in inputs
|
||||||
1. [#2057](https://github.com/influxdata/chronograf/pull/2057): Add ability to use "Default" values in Source Connection form
|
1. [#2057](https://github.com/influxdata/chronograf/pull/2057): Add ability to use "Default" values in Source Connection form
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import React, {PropTypes} from 'react'
|
import React, {PropTypes} from 'react'
|
||||||
|
|
||||||
import QueryEditor from './QueryEditor'
|
import QueryEditor from './QueryEditor'
|
||||||
import EmptyQuery from 'src/shared/components/EmptyQuery'
|
|
||||||
import QueryTabList from 'src/shared/components/QueryTabList'
|
|
||||||
import SchemaExplorer from 'src/shared/components/SchemaExplorer'
|
import SchemaExplorer from 'src/shared/components/SchemaExplorer'
|
||||||
import buildInfluxQLQuery from 'utils/influxql'
|
import buildInfluxQLQuery from 'utils/influxql'
|
||||||
|
|
||||||
|
@ -12,28 +10,9 @@ const rawTextBinder = (links, id, action) => text =>
|
||||||
const buildText = (q, timeRange) =>
|
const buildText = (q, timeRange) =>
|
||||||
q.rawText || buildInfluxQLQuery(timeRange, q) || ''
|
q.rawText || buildInfluxQLQuery(timeRange, q) || ''
|
||||||
|
|
||||||
const QueryMaker = ({
|
const QueryMaker = ({source, actions, timeRange, activeQuery}) =>
|
||||||
source,
|
|
||||||
actions,
|
|
||||||
queries,
|
|
||||||
timeRange,
|
|
||||||
onAddQuery,
|
|
||||||
activeQuery,
|
|
||||||
onDeleteQuery,
|
|
||||||
activeQueryIndex,
|
|
||||||
setActiveQueryIndex,
|
|
||||||
}) =>
|
|
||||||
<div className="query-maker query-maker--panel">
|
<div className="query-maker query-maker--panel">
|
||||||
<QueryTabList
|
<div className="query-maker--tab-contents">
|
||||||
queries={queries}
|
|
||||||
timeRange={timeRange}
|
|
||||||
onAddQuery={onAddQuery}
|
|
||||||
onDeleteQuery={onDeleteQuery}
|
|
||||||
activeQueryIndex={activeQueryIndex}
|
|
||||||
setActiveQueryIndex={setActiveQueryIndex}
|
|
||||||
/>
|
|
||||||
{activeQuery && activeQuery.id
|
|
||||||
? <div className="query-maker--tab-contents">
|
|
||||||
<QueryEditor
|
<QueryEditor
|
||||||
query={buildText(activeQuery, timeRange)}
|
query={buildText(activeQuery, timeRange)}
|
||||||
config={activeQuery}
|
config={activeQuery}
|
||||||
|
@ -43,16 +22,11 @@ const QueryMaker = ({
|
||||||
actions.editRawTextAsync
|
actions.editRawTextAsync
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<SchemaExplorer
|
<SchemaExplorer query={activeQuery} actions={actions} />
|
||||||
query={activeQuery}
|
|
||||||
actions={actions}
|
|
||||||
onAddQuery={onAddQuery}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
: <EmptyQuery onAddQuery={onAddQuery} />}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
const {arrayOf, func, number, shape, string} = PropTypes
|
const {func, shape, string} = PropTypes
|
||||||
|
|
||||||
QueryMaker.propTypes = {
|
QueryMaker.propTypes = {
|
||||||
source: shape({
|
source: shape({
|
||||||
|
@ -60,7 +34,6 @@ QueryMaker.propTypes = {
|
||||||
queries: string.isRequired,
|
queries: string.isRequired,
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
queries: arrayOf(shape({})).isRequired,
|
|
||||||
timeRange: shape({
|
timeRange: shape({
|
||||||
upper: string,
|
upper: string,
|
||||||
lower: string,
|
lower: string,
|
||||||
|
@ -77,11 +50,7 @@ QueryMaker.propTypes = {
|
||||||
applyFuncsToField: func.isRequired,
|
applyFuncsToField: func.isRequired,
|
||||||
editRawTextAsync: func.isRequired,
|
editRawTextAsync: func.isRequired,
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
setActiveQueryIndex: func.isRequired,
|
|
||||||
onDeleteQuery: func.isRequired,
|
|
||||||
onAddQuery: func.isRequired,
|
|
||||||
activeQuery: shape({}),
|
activeQuery: shape({}),
|
||||||
activeQueryIndex: number,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default QueryMaker
|
export default QueryMaker
|
||||||
|
|
|
@ -23,34 +23,16 @@ class DataExplorer extends Component {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
activeQueryIndex: 0,
|
|
||||||
showWriteForm: false,
|
showWriteForm: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSetActiveQueryIndex = index => {
|
|
||||||
this.setState({activeQueryIndex: index})
|
|
||||||
}
|
|
||||||
|
|
||||||
handleDeleteQuery = index => {
|
|
||||||
const {queryConfigs, queryConfigActions} = this.props
|
|
||||||
const query = queryConfigs[index]
|
|
||||||
queryConfigActions.deleteQuery(query.id)
|
|
||||||
}
|
|
||||||
|
|
||||||
handleAddQuery = () => {
|
|
||||||
const newIndex = this.props.queryConfigs.length
|
|
||||||
this.props.queryConfigActions.addQuery()
|
|
||||||
this.handleSetActiveQueryIndex(newIndex)
|
|
||||||
}
|
|
||||||
|
|
||||||
getActiveQuery = () => {
|
getActiveQuery = () => {
|
||||||
const {activeQueryIndex} = this.state
|
|
||||||
const {queryConfigs} = this.props
|
const {queryConfigs} = this.props
|
||||||
const activeQuery = queryConfigs[activeQueryIndex]
|
if (queryConfigs.length === 0) {
|
||||||
const defaultQuery = queryConfigs[0]
|
this.props.queryConfigActions.addQuery()
|
||||||
|
}
|
||||||
return activeQuery || defaultQuery
|
return queryConfigs[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
handleCloseWriteData = () => {
|
handleCloseWriteData = () => {
|
||||||
|
@ -109,14 +91,8 @@ class DataExplorer extends Component {
|
||||||
>
|
>
|
||||||
<QueryMaker
|
<QueryMaker
|
||||||
source={source}
|
source={source}
|
||||||
queries={queryConfigs}
|
|
||||||
actions={queryConfigActions}
|
actions={queryConfigActions}
|
||||||
autoRefresh={autoRefresh}
|
|
||||||
timeRange={timeRange}
|
timeRange={timeRange}
|
||||||
setActiveQueryIndex={this.handleSetActiveQueryIndex}
|
|
||||||
onDeleteQuery={this.handleDeleteQuery}
|
|
||||||
onAddQuery={this.handleAddQuery}
|
|
||||||
activeQueryIndex={activeQueryIndex}
|
|
||||||
activeQuery={this.getActiveQuery()}
|
activeQuery={this.getActiveQuery()}
|
||||||
/>
|
/>
|
||||||
<Visualization
|
<Visualization
|
||||||
|
|
Loading…
Reference in New Issue