import LoopProperties from './components/dialogs/LoopProperties';
import UserInfo from './components/dialogs/UserInfo';
import LoopService from './api/LoopService';
+import PerformAction from './components/menu/PerformActions';
+import RefreshStatus from './components/menu/RefreshStatus';
const ProjectNameStyled = styled.a`
vertical-align: middle;
state = {
userName: null,
loopName: LoopUI.defaultLoopName,
- loopCache: new LoopCache({}),
+ loopCache: new LoopCache({})
};
constructor() {
renderMenuNavBar() {
return (
- <MenuBar loopCache={this.state.loopCache}/>
+ <MenuBar/>
);
}
return this.state.loopCache;
}
+
renderLoopViewer() {
return (
<LoopViewDivStyled>
this.setState({ loopName: this.state.loopCache.getLoopName() });
console.info(this.state.loopName+" loop loaded successfully");
}
-
+
loadLoop(loopName) {
LoopService.getLoop(loopName).then(loop => {
console.debug("Updating loopCache");
<Route path="/loopProperties" render={(routeProps) => (<LoopProperties {...routeProps} loopCache={this.getLoopCache()} loadLoopFunction={this.loadLoop}/>)} />
<Route path="/userInfo" render={(routeProps) => (<UserInfo {...routeProps} />)} />
<Route path="/closeLoop" render={(routeProps) => (<Redirect to='/'/>)} />
+ <Route path="/submit" render={(routeProps) => (<PerformAction {...routeProps} loopAction="submit" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache}/>)} />
+ <Route path="/stop" render={(routeProps) => (<PerformAction {...routeProps} loopAction="stop" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache}/>)} />
+ <Route path="/restart" render={(routeProps) => (<PerformAction {...routeProps} loopAction="restart" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache}/>)} />
+ <Route path="/delete" render={(routeProps) => (<PerformAction {...routeProps} loopAction="delete" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache}/>)} />
+ <Route path="/undeploy" render={(routeProps) => (<PerformAction {...routeProps} loopAction="undeploy" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache}/>)} />
+ <Route path="/refreshStatus" render={(routeProps) => (<RefreshStatus {...routeProps} loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache}/>)} />
<GlobalClampStyle />
{this.renderNavBar()}
{this.renderLoopViewer()}