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 {proxy} from 'utils/queryUrlGenerator';
|
||||
|
||||
export function saveExplorer({name, panels, queryConfigs, explorerID}) {
|
||||
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 {fetchExplorers} from '../actions/view';
|
||||
import DataExplorer from './DataExplorer';
|
||||
import {verifySource} from '../api';
|
||||
|
||||
const App = React.createClass({
|
||||
propTypes: {
|
||||
|
@ -20,23 +19,15 @@ const App = React.createClass({
|
|||
params: PropTypes.shape({
|
||||
base64ExplorerID: PropTypes.string,
|
||||
}).isRequired,
|
||||
addFlashMessage: PropTypes.func,
|
||||
},
|
||||
|
||||
componentDidMount() {
|
||||
verifySource(this.props.source.links.proxy).then(() => {
|
||||
const {base64ExplorerID} = this.props.params;
|
||||
this.props.fetchExplorers({
|
||||
source: this.props.source,
|
||||
userID: 1, // TODO: get the userID
|
||||
explorerID: base64ExplorerID ? this.decodeID(base64ExplorerID) : null,
|
||||
push: this.props.router.push,
|
||||
});
|
||||
}).catch(() => {
|
||||
this.props.addFlashMessage({
|
||||
type: 'error',
|
||||
text: `Connection error. Check that your server is running.`,
|
||||
});
|
||||
const {base64ExplorerID} = this.props.params;
|
||||
this.props.fetchExplorers({
|
||||
source: this.props.source,
|
||||
userID: 1, // TODO: get the userID
|
||||
explorerID: base64ExplorerID ? this.decodeID(base64ExplorerID) : null,
|
||||
push: this.props.router.push,
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue