ngOnInit() {
this.config$ = this.configSvr.conf;
this.config$.subscribe((cfg) => {
- this.curProject = cfg.projects[0];
-
- this.confValid = (cfg.projects.length && this.curProject.id != null);
+ if ("projects" in cfg) {
+ this.curProject = cfg.projects[0];
+ this.confValid = (cfg.projects.length && this.curProject.id != null);
+ } else {
+ this.curProject = null;
+ this.confValid = false;
+ }
});
// Command output data tunneling
}
make(args: string) {
+ if (!this.curProject) {
+ this.alertSvr.warning('No active project', true);
+ }
+
let prjID = this.curProject.id;
this.cmdOutput += this._outputHeader();
},
err => {
this.cmdInfo = 'Last command duration: ' + this._computeTime(t0);
- this.alertSvr.add({ type: "danger", msg: 'ERROR: ' + err });
+ this.alertSvr.error('ERROR: ' + err);
});
}