From afe1f83bdbec2c369c0840c94df1d12c8faa0eeb Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Fri, 24 Nov 2017 14:21:37 +0100 Subject: Improved and fixed connection to XDS Server Signed-off-by: Sebastien Douheret --- .../app/@core-xds/services/xds-config.service.ts | 3 ++- .../config/config-xds/config-xds.component.html | 24 ++++++++++++---------- .../config/config-xds/config-xds.component.scss | 2 +- .../config/config-xds/config-xds.component.ts | 23 ++++++++------------- webapp/tslint.json | 2 +- 5 files changed, 26 insertions(+), 28 deletions(-) (limited to 'webapp') diff --git a/webapp/src/app/@core-xds/services/xds-config.service.ts b/webapp/src/app/@core-xds/services/xds-config.service.ts index 2f751a7..2a43f2b 100644 --- a/webapp/src/app/@core-xds/services/xds-config.service.ts +++ b/webapp/src/app/@core-xds/services/xds-config.service.ts @@ -74,9 +74,10 @@ export class XDSConfigService { return Observable.of(curSvr); } - private _updateCurServer() { + private _updateCurServer(): IXDServerCfg { this._curServer = this._getCurServer(); this.curServer$.next(this._curServer); + return this._curServer; } private _getCurServer(url?: string): IXDServerCfg { diff --git a/webapp/src/app/pages/config/config-xds/config-xds.component.html b/webapp/src/app/pages/config/config-xds/config-xds.component.html index 31559e2..ebfaa36 100644 --- a/webapp/src/app/pages/config/config-xds/config-xds.component.html +++ b/webapp/src/app/pages/config/config-xds/config-xds.component.html @@ -7,28 +7,30 @@
- +
- - +
-
+
- -
-
- -
-
+ +
+
+ +
+
+
diff --git a/webapp/src/app/pages/config/config-xds/config-xds.component.scss b/webapp/src/app/pages/config/config-xds/config-xds.component.scss index d7571b9..027f0fc 100644 --- a/webapp/src/app/pages/config/config-xds/config-xds.component.scss +++ b/webapp/src/app/pages/config/config-xds/config-xds.component.scss @@ -16,7 +16,7 @@ nb-card.inline-form-card nb-card-body { } .fa-size-x2 { - font-size: 20px; + font-size: 22px; } .vcenter { diff --git a/webapp/src/app/pages/config/config-xds/config-xds.component.ts b/webapp/src/app/pages/config/config-xds/config-xds.component.ts index ffd236d..396115b 100644 --- a/webapp/src/app/pages/config/config-xds/config-xds.component.ts +++ b/webapp/src/app/pages/config/config-xds/config-xds.component.ts @@ -15,10 +15,10 @@ import 'rxjs/add/operator/catch'; styleUrls: ['./config-xds.component.scss'], templateUrl: './config-xds.component.html', }) -export class ConfigXdsComponent implements OnInit { +export class ConfigXdsComponent { // TODO: cleanup agentStatus$: Observable; - connecting = false; + applying = false; xdsServerUrl = ''; server: IXDServerCfg; @@ -28,17 +28,10 @@ export class ConfigXdsComponent implements OnInit { private XdsConfigSvr: XDSConfigService, private alert: AlertService, ) { - } - - ngOnInit() { // FIXME support multiple servers - - this.server = this.XdsConfigSvr.getCurServer(); - this.xdsServerUrl = this.server.url; - this.XdsConfigSvr.onCurServer().subscribe(svr => { this.xdsServerUrl = svr.url; - this.server = svr; + this.server = Object.assign({}, svr); }); } @@ -47,14 +40,16 @@ export class ConfigXdsComponent implements OnInit { return; } this.configFormChanged = false; - this.connecting = true; + this.applying = true; this.server.url = this.xdsServerUrl; this.XdsConfigSvr.setCurServer(this.server) .subscribe(cfg => { - this.connecting = false; - }, + this.alert.info('XDS Server successfully connected (' + cfg.url + ')'); + this.server = Object.assign({}, cfg); + this.applying = false; + }, err => { - this.connecting = false; + this.applying = false; this.alert.error(err); }); } diff --git a/webapp/tslint.json b/webapp/tslint.json index 6cd34e9..9bfdcb2 100644 --- a/webapp/tslint.json +++ b/webapp/tslint.json @@ -131,7 +131,7 @@ "use-pipe-transform-interface": true, "component-class-suffix": true, "directive-class-suffix": true, - "no-access-missing-member": true, + "no-access-missing-member": false, "templates-use-public": true, "invoke-injectable": true } -- cgit 1.2.3-korg