<div class="modal-header bg-info">
<h4 class="modal-title">{{dialogTitle}}</h4>
<button type="button" class="close"
- i18n-aria-label aria-label="Close" (click)="close()">
+ i18n-aria-label aria-label="Close" (click)="closeAndClear()">
<span aria-hidden="true">×</span>
</button>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success"
- (click)="close(promptValue)" i18n>Confirm</button>
+ (click)="closeAndClear(promptValue)" i18n>Confirm</button>
<button type="button" class="btn btn-warning"
- (click)="close()" i18n>Cancel</button>
+ (click)="closeAndClear()" i18n>Cancel</button>
</div>
</ng-template>
@Input() public promptValue: string;
// 'password', etc.
@Input() promptType = 'text';
+
+ closeAndClear(value?: any) {
+ this.close(value);
+ this.promptValue = '';
+ }
}
</button>
</a>
+<ng-container *ngIf="!createMode">
+ <a routerLink="/staff/admin/server/sip/account/new">
+ <button class="btn btn-outline-dark label-with-material-icon ml-2">
+ <span class="material-icons">add</span>
+ <span i18n>New Account</span>
+ </button>
+ </a>
+</ng-container>
+
<eg-sip-group-delete-dialog *ngIf="account && account.setting_group()"
#deleteGroupDialog
[group]="account.setting_group()" [settingGroups]="settingGroups">
<ng-container *ngIf="createMode">
<eg-prompt-dialog #passwordDialog i18n-dialogTitle i18n-dialogBody
- dialogTitle="Create SIP Password" i18n-dialogBody="Create a new password"
+ dialogTitle="Create SIP Password" dialogBody="Create a new password"
promptType="password">
</eg-prompt-dialog>
</ng-container>
<ng-container *ngIf="!createMode">
<eg-prompt-dialog #passwordDialog i18n-dialogTitle i18n-dialogBody
- dialogTitle="Create SIP Password" i18n-dialogBody="Create a new password"
+ dialogTitle="Modify SIP Password" dialogBody="Change SIP account password"
promptType="password">
</eg-prompt-dialog>
</ng-container>
this.account = this.idl.create('sipacc'); // dummy
this.createMode = true;
return;
+ } else {
+ this.createMode = false;
}
+ this.usrId = null;
this.accountId = Number(params.get('id'));
this.loadAccount().toPromise(); // force it to run
});