Show measurement list after clicking a database
parent
645fb6e143
commit
635e883127
|
@ -15,8 +15,7 @@ const MeasurementList = React.createClass({
|
|||
},
|
||||
|
||||
contextTypes: {
|
||||
dataNodes: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,
|
||||
clusterID: PropTypes.string,
|
||||
sources: PropTypes.arrayOf(PropTypes.shape().isRequired).isRequired,
|
||||
},
|
||||
|
||||
getInitialState() {
|
||||
|
@ -32,7 +31,7 @@ const MeasurementList = React.createClass({
|
|||
}
|
||||
|
||||
const {sources} = this.context;
|
||||
const source = sources[0].link.href;
|
||||
const source = sources[0].links.proxy;
|
||||
showMeasurements(source, this.props.query.database).then((resp) => {
|
||||
const {errors, measurementSets} = showMeasurementsParser(resp.data);
|
||||
if (errors.length) {
|
||||
|
|
|
@ -19,8 +19,7 @@ const Visualization = React.createClass({
|
|||
},
|
||||
|
||||
contextTypes: {
|
||||
dataNodes: arrayOf(string.isRequired).isRequired,
|
||||
clusterID: string.isRequired,
|
||||
sources: arrayOf(shape).isRequired,
|
||||
},
|
||||
|
||||
getInitialState() {
|
||||
|
|
|
@ -36,7 +36,6 @@ const DataExplorer = React.createClass({
|
|||
},
|
||||
|
||||
getChildContext() {
|
||||
console.log("here are your sources: ", this.props.sources)
|
||||
return {sources: this.props.sources};
|
||||
},
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ const Header = React.createClass({
|
|||
lower: PropTypes.string,
|
||||
}).isRequired,
|
||||
explorers: PropTypes.shape({}).isRequired,
|
||||
explorerID: PropTypes.number.isRequired,
|
||||
explorerID: PropTypes.string.isRequired,
|
||||
actions: PropTypes.shape({
|
||||
setTimeRange: PropTypes.func.isRequired,
|
||||
createExplorer: PropTypes.func.isRequired,
|
||||
|
|
|
@ -22,10 +22,10 @@ export function killQuery(host, queryId, clusterID) {
|
|||
return proxy(url, clusterID);
|
||||
}
|
||||
|
||||
export function showMeasurements(source, database) {
|
||||
export function showMeasurements(source, db) {
|
||||
const query = 'SHOW MEASUREMENTS';
|
||||
|
||||
return proxy({source, database, query});
|
||||
return proxy({source, db, query});
|
||||
}
|
||||
|
||||
export function showRetentionPolicies(source, databases) {
|
||||
|
|
|
@ -2,14 +2,14 @@ import React, {PropTypes} from 'react';
|
|||
import _ from 'lodash';
|
||||
import {proxy, buildInfluxUrl} from 'utils/queryUrlGenerator';
|
||||
|
||||
function _fetchTimeSeries(host, database, query, clusterID) {
|
||||
function _fetchTimeSeries(host, database, query) {
|
||||
const url = buildInfluxUrl({
|
||||
host,
|
||||
database,
|
||||
statement: query,
|
||||
});
|
||||
|
||||
return proxy(url, clusterID);
|
||||
return proxy(url);
|
||||
}
|
||||
|
||||
export default function AutoRefresh(ComposedComponent) {
|
||||
|
@ -22,7 +22,6 @@ export default function AutoRefresh(ComposedComponent) {
|
|||
host: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
|
||||
text: PropTypes.string,
|
||||
}).isRequired).isRequired,
|
||||
clusterID: PropTypes.string.isRequired,
|
||||
},
|
||||
getInitialState() {
|
||||
return {timeSeries: []};
|
||||
|
@ -66,7 +65,7 @@ export default function AutoRefresh(ComposedComponent) {
|
|||
let count = 0;
|
||||
const newSeries = [];
|
||||
queries.forEach(({host, database, text}) => {
|
||||
_fetchTimeSeries(host, database, text, this.props.clusterID).then((resp) => {
|
||||
_fetchTimeSeries(host, database, text).then((resp) => {
|
||||
newSeries.push({identifier: host, response: resp.data});
|
||||
count += 1;
|
||||
if (count === queries.length) {
|
||||
|
|
|
@ -19,7 +19,6 @@ export function buildInfluxUrl() {
|
|||
}
|
||||
|
||||
export function proxy({source, query, db, rp}) {
|
||||
debugger;
|
||||
return AJAX({
|
||||
method: 'POST',
|
||||
url: source,
|
||||
|
|
Loading…
Reference in New Issue