Commit 243be386 authored by Emmanuel Garette's avatar Emmanuel Garette
Browse files

a

parent 3c188aea
......@@ -98,7 +98,7 @@ function update({ serverid, servername, serverdescription }) {
return Zephir.v1.server.update({
servername,
serverdescription,
serverid: serverid.toString(),
serverid: serverid,
})
.then(({response}) => {
dispatch(success(response));
......
......@@ -26,13 +26,17 @@ class ActionApp extends React.Component {
}
componentDidUpdate() {
const { instance } = this.props;
const { server } = instance.opts;
const { jobsOutdated, isLoading } = this.state;
if (jobsOutdated && !isLoading) this.refreshJobs();
if (jobsOutdated && !isLoading) this.refreshJobs(server.serverid);
}
componentDidMount() {
const { instance } = this.props;
const { server } = instance.opts;
const { jobsOutdated, isLoading } = this.state;
if (jobsOutdated && !isLoading) this.refreshJobs();
if (jobsOutdated && !isLoading) this.refreshJobs(server.serverid);
}
render() {
......@@ -72,9 +76,9 @@ class ActionApp extends React.Component {
);
}
refreshJobs() {
refreshJobs(serverId) {
this.setState({isLoading: true}, () => {
this.props.dispatch(execActions.listJobs())
this.props.dispatch(execActions.listJobs(serverId))
.then(result => {
const filteredJobs = this.filterJobs(result.jobs);
this.setState({ jobs: filteredJobs});
......@@ -88,7 +92,9 @@ class ActionApp extends React.Component {
}
onRefreshClick() {
this.refreshJobs();
const { instance } = this.props;
const { server } = instance.opts;
this.refreshJobs(server.serverid);
}
filterJobs(jobs) {
......@@ -147,4 +153,4 @@ const mapStateToProps = () => {
const styledActionApp = withStyles(styles)(ActionApp);
const connectedActionApp = connect(mapStateToProps)(styledActionApp);
export { connectedActionApp as ActionApp };
\ No newline at end of file
export { connectedActionApp as ActionApp };
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment