mirror of
https://github.com/google/nomulus
synced 2026-01-06 21:47:31 +00:00
Add console settings update progress status (#2596)
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { switchMap } from 'rxjs';
|
||||
import { switchMap, timeout } from 'rxjs';
|
||||
import {
|
||||
IpAllowListItem,
|
||||
RegistrarService,
|
||||
@@ -69,6 +69,7 @@ export class SecurityService {
|
||||
uiToApiConverter(newSecuritySettings)
|
||||
)
|
||||
.pipe(
|
||||
timeout(2000),
|
||||
switchMap(() => {
|
||||
return this.registrarService.loadRegistrars();
|
||||
})
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<mat-form-field appearance="outline">
|
||||
<input
|
||||
matInput
|
||||
[disabled]="isUpdating"
|
||||
type="text"
|
||||
[(ngModel)]="ip.value"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
@@ -20,12 +21,19 @@
|
||||
mat-icon-button
|
||||
aria-label="Remove"
|
||||
(click)="removeIpEntry(ip)"
|
||||
[disabled]="isUpdating"
|
||||
>
|
||||
<mat-icon>close</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
<button mat-button color="primary" (click)="createIpEntry()" type="button">
|
||||
<button
|
||||
mat-button
|
||||
[disabled]="isUpdating"
|
||||
color="primary"
|
||||
(click)="createIpEntry()"
|
||||
type="button"
|
||||
>
|
||||
+ Add IP
|
||||
</button>
|
||||
|
||||
@@ -35,6 +43,7 @@
|
||||
<textarea
|
||||
class="console-app__clientCertificateValue"
|
||||
matInput
|
||||
[disabled]="isUpdating"
|
||||
[(ngModel)]="dataSource.clientCertificate"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
></textarea>
|
||||
@@ -44,6 +53,7 @@
|
||||
<mat-form-field appearance="outline">
|
||||
<textarea
|
||||
matInput
|
||||
[disabled]="isUpdating"
|
||||
[(ngModel)]="dataSource.failoverClientCertificate"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
></textarea>
|
||||
@@ -51,6 +61,7 @@
|
||||
<button
|
||||
mat-flat-button
|
||||
color="primary"
|
||||
[disabled]="isUpdating"
|
||||
aria-label="Save security settings"
|
||||
type="submit"
|
||||
class="settings-security__edit-save"
|
||||
|
||||
@@ -29,6 +29,7 @@ import { SecurityService, apiToUiConverter } from './security.service';
|
||||
})
|
||||
export default class SecurityEditComponent {
|
||||
dataSource: SecuritySettings = {};
|
||||
isUpdating = false;
|
||||
|
||||
constructor(
|
||||
public securityService: SecurityService,
|
||||
@@ -43,12 +44,15 @@ export default class SecurityEditComponent {
|
||||
}
|
||||
|
||||
save() {
|
||||
this.isUpdating = true;
|
||||
this.securityService.saveChanges(this.dataSource).subscribe({
|
||||
complete: () => {
|
||||
this.isUpdating = false;
|
||||
this.goBack();
|
||||
},
|
||||
error: (err: HttpErrorResponse) => {
|
||||
this._snackBar.open(err.error);
|
||||
this._snackBar.open(err.error || err.message);
|
||||
this.isUpdating = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user