From: Sebastien Douheret Date: Mon, 22 May 2017 19:35:15 +0000 (+0200) Subject: Fix Agent download link when no tarball detected. X-Git-Tag: v0.0.1-alpha~14 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=271ffeae46af55459270c3480816c76aa9c80638;hp=61ca475685c6b7b33654edaad637c7d53bdf8d34;p=src%2Fxds%2Fxds-server.git Fix Agent download link when no tarball detected. Signed-off-by: Sebastien Douheret --- diff --git a/webapp/src/app/common/config.service.ts b/webapp/src/app/common/config.service.ts index a04ac13..091ee06 100644 --- a/webapp/src/app/common/config.service.ts +++ b/webapp/src/app/common/config.service.ts @@ -115,10 +115,14 @@ export class ConfigService { } // Update XDS Agent tarball url + this.confStore.xdsAgentZipUrl = ""; this.xdsServerSvr.getXdsAgentInfo().subscribe(nfo => { let os = this.utils.getOSName(true); let zurl = nfo.tarballs.filter(elem => elem.os === os); - this.confStore.xdsAgentZipUrl = zurl && zurl[0].fileUrl; + if (zurl && zurl.length) { + this.confStore.xdsAgentZipUrl = zurl[0].fileUrl; + this.confSubject.next(Object.assign({}, this.confStore)); + } }); } @@ -128,7 +132,7 @@ export class ConfigService { this.confSubject.next(Object.assign({}, this.confStore)); // Don't save projects in cookies (too big!) - let cfg = this.confStore; + let cfg = Object.assign({}, this.confStore); delete (cfg.projects); this.cookie.putObject("xds-config", cfg); } @@ -145,7 +149,7 @@ export class ConfigService { let cfg = this.confStore.xdsAgent; this.AgentConnectObs = this.xdsAgentSvr.connect(cfg.retry, cfg.URL) .subscribe((sts) => { - console.log("Agent sts", sts); + //console.log("Agent sts", sts); }, error => this.alert.error(error) ); @@ -195,8 +199,10 @@ export class ConfigService { if (error.indexOf("Syncthing local daemon not responding") !== -1) { let msg = "" + error + "
"; msg += "You may need to download and execute XDS-Agent.
"; - msg += ""; - msg += " Download XDS-Agent tarball."; + if (this.confStore.xdsAgentZipUrl !== "") { + msg += ""; + msg += " Download XDS-Agent tarball."; + } msg += "
"; this.alert.error(msg); } else { diff --git a/webapp/src/app/config/config.component.html b/webapp/src/app/config/config.component.html index 77d90c5..f707bbe 100644 --- a/webapp/src/app/config/config.component.html +++ b/webapp/src/app/config/config.component.html @@ -20,7 +20,10 @@ - +