summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-29 16:02:35 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-29 16:24:27 +0100
commite3b0261be7cacf2653703c3543c33a83c3be16e4 (patch)
treebb5e64f8611aee98e6a450772d30d3ece780395e
parent32791ffed5bdfaa698e90f9c067dc6e8ababbfc3 (diff)
Fixed XDS server connection config - dashboard
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
-rw-r--r--webapp/src/app/pages/config/config-xds/config-xds.component.html4
-rw-r--r--webapp/src/app/pages/config/config-xds/config-xds.component.scss4
-rw-r--r--webapp/src/app/pages/config/config-xds/config-xds.component.ts6
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;