Implement iframe reload on deployment

This commit is contained in:
Kristóf Tóth
2018-05-17 15:58:08 +02:00
parent 4df50e165d
commit 454507615d
4 changed files with 24 additions and 10 deletions

View File

@ -62,7 +62,10 @@ export class IdeComponent implements OnInit {
this.subscribeWS();
this.requestCode();
this.processManagerService.init();
this.processManagerService.subscribeCallback(config.ide.deployProcessName, (event) => { this.setDeployButtonState('DEPLOYED'); });
this.processManagerService.subscribeCallback(config.ide.deployProcessName, (event) => {
this.setDeployButtonState('DEPLOYED');
this.deploymentNotificationService.deploying.next(false);
});
this.processManagerService.subscribeErrorCallback(config.ide.deployProcessName, (event) => { this.setDeployButtonState('FAILED'); });
this.resetAutoSaveCountdown();
}
@ -126,13 +129,15 @@ export class IdeComponent implements OnInit {
}
setDeployButtonState(state: string) {
this.deployButtonState = state;
this.deploymentNotificationService.deploying.next(state === 'DEPLOYING' ? true : false);
if (state.match('DEPLOYED|DEPLOYING|FAILED|TODEPLOY')) {
this.deployButtonState = state;
}
}
deployCode() {
this.processManagerService.restartProcess(config.ide.deployProcessName);
this.setDeployButtonState('DEPLOYING');
this.deploymentNotificationService.deploying.next(true);
}
sendCodeIfDirty() {