Fixed XDS server connection config - dashboard
[src/xds/xds-agent.git] / webapp / src / app / pages / config / config-xds / config-xds.component.ts
index 396115b..e62cd37 100644 (file)
@@ -20,7 +20,7 @@ export class ConfigXdsComponent {
   // TODO: cleanup agentStatus$: Observable<IAgentStatus>;
   applying = false;
   xdsServerUrl = '';
-  server: IXDServerCfg;
+  server: IXDServerCfg = { id: '', url: '', connRetry: 10, connected: false };
 
   configFormChanged = false;
 
@@ -35,6 +35,10 @@ export class ConfigXdsComponent {
     });
   }
 
+  isApplyBtnEnable(): boolean {
+    return this.xdsServerUrl !== '' && (!this.server.connected || this.configFormChanged);
+  }
+
   onSubmit() {
     if (!this.configFormChanged && this.server.connected) {
       return;