X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=webapp%2Fsrc%2Fapp%2Fservices%2Fconfig.service.ts;fp=webapp%2Fsrc%2Fapp%2Fcommon%2Fconfig.service.ts;h=390340a75adc23a8500609a950c863cba036e545;hb=66496d63e16635d72f15abe48dc3dadb473f0b6b;hp=091ee06bc0ef14a84d8274ef6459894166f65af8;hpb=7f1db509a2076311c280964715962df71a1631ce;p=src%2Fxds%2Fxds-server.git
diff --git a/webapp/src/app/common/config.service.ts b/webapp/src/app/services/config.service.ts
similarity index 89%
rename from webapp/src/app/common/config.service.ts
rename to webapp/src/app/services/config.service.ts
index 091ee06..390340a 100644
--- a/webapp/src/app/common/config.service.ts
+++ b/webapp/src/app/services/config.service.ts
@@ -13,11 +13,11 @@ import 'rxjs/add/observable/throw';
import 'rxjs/add/operator/mergeMap';
-import { XDSServerService, IXDSConfigProject } from "../common/xdsserver.service";
-import { XDSAgentService } from "../common/xdsagent.service";
-import { SyncthingService, ISyncThingProject, ISyncThingStatus } from "../common/syncthing.service";
-import { AlertService, IAlert } from "../common/alert.service";
-import { UtilsService } from "../common/utils.service";
+import { XDSServerService, IXDSConfigProject } from "../services/xdsserver.service";
+import { XDSAgentService } from "../services/xdsagent.service";
+import { SyncthingService, ISyncThingProject, ISyncThingStatus } from "../services/syncthing.service";
+import { AlertService, IAlert } from "../services/alert.service";
+import { UtilsService } from "../services/utils.service";
export enum ProjectType {
NATIVE = 1,
@@ -150,9 +150,27 @@ export class ConfigService {
this.AgentConnectObs = this.xdsAgentSvr.connect(cfg.retry, cfg.URL)
.subscribe((sts) => {
//console.log("Agent sts", sts);
- }, error => this.alert.error(error)
- );
+ // FIXME: load projects from local XDS Agent and
+ // not directly from local syncthing
+ this._loadProjectFromLocalST();
+
+ }, error => {
+ if (error.indexOf("XDS local Agent not responding") !== -1) {
+ let msg = "" + error + "
";
+ msg += "You may need to download and execute XDS-Agent.
";
+ if (this.confStore.xdsAgentZipUrl !== "") {
+ msg += "";
+ msg += " Download XDS-Agent tarball.";
+ }
+ msg += "";
+ this.alert.error(msg);
+ } else {
+ this.alert.error(error);
+ }
+ });
+ }
+ private _loadProjectFromLocalST() {
// Remove previous subscriber if existing
if (this.stConnectObs) {
try {
@@ -198,11 +216,7 @@ export class ConfigService {
}, error => {
if (error.indexOf("Syncthing local daemon not responding") !== -1) {
let msg = "" + error + "
";
- msg += "You may need to download and execute XDS-Agent.
";
- if (this.confStore.xdsAgentZipUrl !== "") {
- msg += "";
- msg += " Download XDS-Agent tarball.";
- }
+ msg += "Please check that local XDS-Agent is running.
";
msg += "";
this.alert.error(msg);
} else {