tilde: string;
}
+export interface IxdsAgentPackage {
+ os: string;
+ arch: string;
+ version: string;
+ url: string;
+}
+
export interface IConfig {
xdsServerURL: string;
xdsAgent: IXDSAgentConfig;
- xdsAgentZipUrl: string;
+ xdsAgentPackages: IxdsAgentPackage[];
projectsRootDir: string;
projects: IProject[];
localSThg: ILocalSTConfig;
private confStore: IConfig;
private AgentConnectObs = null;
private stConnectObs = null;
- private xdsAgentZipUrl = "";
constructor(private _window: Window,
private cookie: CookieService,
URL: 'http://localhost:8000',
retry: 10,
},
- xdsAgentZipUrl: "",
+ xdsAgentPackages: [],
projectsRootDir: "",
projects: [],
localSThg: {
}
// Update XDS Agent tarball url
- this.confStore.xdsAgentZipUrl = "";
this.xdsServerSvr.getXdsAgentInfo().subscribe(nfo => {
- let os = this.utils.getOSName(true);
- let zurl = nfo.tarballs && nfo.tarballs.filter(elem => elem.os === os);
- if (zurl && zurl.length) {
- this.confStore.xdsAgentZipUrl = zurl[0].fileUrl;
- this.confSubject.next(Object.assign({}, this.confStore));
- }
+ this.confStore.xdsAgentPackages = [];
+ nfo.tarballs && nfo.tarballs.forEach(el =>
+ this.confStore.xdsAgentPackages.push({
+ os: el.os,
+ arch: el.arch,
+ version: el.version,
+ url: el.fileUrl
+ })
+ );
+ this.confSubject.next(Object.assign({}, this.confStore));
});
}
if (error.indexOf("XDS local Agent not responding") !== -1) {
let msg = "<span><strong>" + error + "<br></strong>";
msg += "You may need to download and execute XDS-Agent.<br>";
- if (this.confStore.xdsAgentZipUrl !== "") {
- msg += "<a class=\"fa fa-download\" href=\"" + this.confStore.xdsAgentZipUrl + "\" target=\"_blank\"></a>";
- msg += " Download XDS-Agent tarball.";
+
+ let os = this.utils.getOSName(true);
+ let zurl = this.confStore.xdsAgentPackages && this.confStore.xdsAgentPackages.filter(elem => elem.os === os);
+ if (zurl && zurl.length) {
+ msg += " Download XDS-Agent tarball for " + zurl[0].os + " host OS ";
+ msg += "<a class=\"fa fa-download\" href=\"" + zurl[0].url + "\" target=\"_blank\"></a>";
}
msg += "</span>";
this.alert.error(msg);