Code Review
/
src
/
xds
/
xds-agent.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Improved and fixed connection to XDS Server
[src/xds/xds-agent.git]
/
webapp
/
src
/
app
/
pages
/
config
/
config-xds
/
config-xds.component.ts
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
(file)
--- 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',
})
styleUrls: ['./config-xds.component.scss'],
templateUrl: './config-xds.component.html',
})
-export class ConfigXdsComponent
implements OnInit
{
+export class ConfigXdsComponent {
// TODO: cleanup agentStatus$: Observable<IAgentStatus>;
// TODO: cleanup agentStatus$: Observable<IAgentStatus>;
-
connect
ing = false;
+
apply
ing = false;
xdsServerUrl = '';
server: IXDServerCfg;
xdsServerUrl = '';
server: IXDServerCfg;
@@
-28,17
+28,10
@@
export class ConfigXdsComponent implements OnInit {
private XdsConfigSvr: XDSConfigService,
private alert: AlertService,
) {
private XdsConfigSvr: XDSConfigService,
private alert: AlertService,
) {
- }
-
- ngOnInit() {
// FIXME support multiple servers
// FIXME support multiple servers
-
- this.server = this.XdsConfigSvr.getCurServer();
- this.xdsServerUrl = this.server.url;
-
this.XdsConfigSvr.onCurServer().subscribe(svr => {
this.xdsServerUrl = svr.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;
return;
}
this.configFormChanged = false;
- this.
connect
ing = true;
+ this.
apply
ing = true;
this.server.url = this.xdsServerUrl;
this.XdsConfigSvr.setCurServer(this.server)
.subscribe(cfg => {
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 => {
err => {
- this.
connect
ing = false;
+ this.
apply
ing = false;
this.alert.error(err);
});
}
this.alert.error(err);
});
}