Revert "Show flash error if can't connect in data explorer."
This reverts commit b269e4a34d0bda99ac27d6de5218b739c43cefb4.pull/10616/head
parent
b205245c3f
commit
20b835944e
|
@ -1,5 +1,4 @@
|
||||||
import AJAX from 'utils/ajax';
|
import AJAX from 'utils/ajax';
|
||||||
import {proxy} from 'utils/queryUrlGenerator';
|
|
||||||
|
|
||||||
export function saveExplorer({name, panels, queryConfigs, explorerID}) {
|
export function saveExplorer({name, panels, queryConfigs, explorerID}) {
|
||||||
return AJAX({
|
return AJAX({
|
||||||
|
@ -14,11 +13,3 @@ export function saveExplorer({name, panels, queryConfigs, explorerID}) {
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function verifySource(proxyLink) {
|
|
||||||
return proxy({
|
|
||||||
source: proxyLink,
|
|
||||||
query: "select * from cpu limit 1",
|
|
||||||
db: 'telegraf',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ import {connect} from 'react-redux';
|
||||||
import {withRouter} from 'react-router';
|
import {withRouter} from 'react-router';
|
||||||
import {fetchExplorers} from '../actions/view';
|
import {fetchExplorers} from '../actions/view';
|
||||||
import DataExplorer from './DataExplorer';
|
import DataExplorer from './DataExplorer';
|
||||||
import {verifySource} from '../api';
|
|
||||||
|
|
||||||
const App = React.createClass({
|
const App = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
|
@ -20,11 +19,9 @@ const App = React.createClass({
|
||||||
params: PropTypes.shape({
|
params: PropTypes.shape({
|
||||||
base64ExplorerID: PropTypes.string,
|
base64ExplorerID: PropTypes.string,
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
addFlashMessage: PropTypes.func,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
verifySource(this.props.source.links.proxy).then(() => {
|
|
||||||
const {base64ExplorerID} = this.props.params;
|
const {base64ExplorerID} = this.props.params;
|
||||||
this.props.fetchExplorers({
|
this.props.fetchExplorers({
|
||||||
source: this.props.source,
|
source: this.props.source,
|
||||||
|
@ -32,12 +29,6 @@ const App = React.createClass({
|
||||||
explorerID: base64ExplorerID ? this.decodeID(base64ExplorerID) : null,
|
explorerID: base64ExplorerID ? this.decodeID(base64ExplorerID) : null,
|
||||||
push: this.props.router.push,
|
push: this.props.router.push,
|
||||||
});
|
});
|
||||||
}).catch(() => {
|
|
||||||
this.props.addFlashMessage({
|
|
||||||
type: 'error',
|
|
||||||
text: `Connection error. Check that your server is running.`,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
Loading…
Reference in New Issue