diff options
3 files changed, 11 insertions, 3 deletions
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 ebfaa36..e4bd0d5 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 @@ -16,7 +16,7 @@ <div class="form-group row"> <label class="col-sm-3 col-form-label">XDS Server connection retry</label> <div class="col-sm-8" *ngIf="server"> - <input type="number" class="form-control" id="inputServerConnRetry" [(ngModel)]="server.connRetry" name="serverRetry" (ngModelChange)="configFormChanged=true"> + <input type="number" class="form-control" id="inputServerConnRetry" [(ngModel)]="server.connRetry" name="serverRetry" (ngModelChange)="configFormChanged=true" [disabled]="applying"> </div> </div> </form> @@ -25,7 +25,7 @@ <div class="col-12"> <div class="offset-sm-5 col-sm-2"> <button class="btn btn-primary" (click)="onSubmit()" [disabled]=" - applying || (server?.connected && !configFormChanged)">{{ applying ?"Applying... ":"Apply" }} + applying || !isApplyBtnEnable()">{{ applying ?"Applying... ":"Apply" }} <span *ngIf="applying" class="fa fa-gear faa-spin animated fa-size-x2"></span> </button> </div> 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 027f0fc..42e04ee 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 @@ -24,3 +24,7 @@ nb-card.inline-form-card nb-card-body { //vertical-align: middle; margin-top: 33%; } + +.form-control:disabled { + font-weight: lighter; +} 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 396115b..e62cd37 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 @@ -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; |