Fix the table view
parent
0f9cb6aef7
commit
13b2af3b09
|
@ -35,10 +35,6 @@ const ChronoTable = React.createClass({
|
||||||
containerWidth: number.isRequired,
|
containerWidth: number.isRequired,
|
||||||
},
|
},
|
||||||
|
|
||||||
contextTypes: {
|
|
||||||
clusterID: string,
|
|
||||||
},
|
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
return {
|
return {
|
||||||
cellData: {
|
cellData: {
|
||||||
|
@ -52,7 +48,7 @@ const ChronoTable = React.createClass({
|
||||||
fetchCellData(query) {
|
fetchCellData(query) {
|
||||||
this.setState({isLoading: true});
|
this.setState({isLoading: true});
|
||||||
// second param is db, we want to leave this blank
|
// second param is db, we want to leave this blank
|
||||||
fetchTimeSeries(query.host, undefined, query.text, this.context.clusterID).then((resp) => {
|
fetchTimeSeries(query.host, undefined, query.text).then((resp) => {
|
||||||
const cellData = _.get(resp.data, ['results', '0', 'series', '0'], false);
|
const cellData = _.get(resp.data, ['results', '0', 'series', '0'], false);
|
||||||
if (!cellData) {
|
if (!cellData) {
|
||||||
return this.setState({isLoading: false});
|
return this.setState({isLoading: false});
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
import {proxy, buildInfluxUrl} from 'utils/queryUrlGenerator';
|
import {proxy} from 'utils/queryUrlGenerator';
|
||||||
|
|
||||||
export default function fetchTimeSeries(host, database, query, clusterID) {
|
export default function fetchTimeSeries(source, database, query) {
|
||||||
const url = buildInfluxUrl({
|
return proxy({source, query, database});
|
||||||
host,
|
|
||||||
database,
|
|
||||||
statement: query,
|
|
||||||
});
|
|
||||||
|
|
||||||
return proxy(url, clusterID);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue