1 <cd-modal [modalRef]="activeModal">
2 <ng-container i18n="form title"
3 class="modal-title">{{ action | titlecase }} {{ resource | upperFirst }}</ng-container>
5 <ng-container class="modal-content">
7 [formGroup]="formGroup"
9 <div class="modal-body">
12 <div class="form-group row">
13 <label class="cd-col-form-label"
14 [ngClass]="{'required': !viewing}"
17 <div class="cd-col-form-input">
23 formControlName="user">
25 class="form-control custom-select"
26 formControlName="user"
30 *ngIf="userCandidates !== null"
31 [ngValue]="null">-- Select a username --</option>
32 <option *ngFor="let userCandidate of userCandidates"
33 [value]="userCandidate">{{ userCandidate }}</option>
35 <span class="invalid-feedback"
36 *ngIf="formGroup.showError('user', frm, 'required')"
37 i18n>This field is required.</span>
41 <!-- Auto-generate key -->
42 <div class="form-group row"
44 <div class="cd-col-form-offset">
45 <div class="custom-control custom-checkbox">
46 <input class="custom-control-input"
49 formControlName="generate_key">
50 <label class="custom-control-label"
52 i18n>Auto-generate key</label>
58 <div class="form-group row"
59 *ngIf="!formGroup.getValue('generate_key')">
60 <label class="cd-col-form-label"
61 [ngClass]="{'required': !viewing}"
63 i18n>Access key</label>
64 <div class="cd-col-form-input">
65 <div class="input-group">
66 <input id="access_key"
70 formControlName="access_key">
71 <span class="input-group-append">
74 cdPasswordButton="access_key">
76 <cd-copy-2-clipboard-button source="access_key">
77 </cd-copy-2-clipboard-button>
80 <span class="invalid-feedback"
81 *ngIf="formGroup.showError('access_key', frm, 'required')"
82 i18n>This field is required.</span>
87 <div class="form-group row"
88 *ngIf="!formGroup.getValue('generate_key')">
89 <label class="cd-col-form-label"
90 [ngClass]="{'required': !viewing}"
92 i18n>Secret key</label>
93 <div class="cd-col-form-input">
94 <div class="input-group">
95 <input id="secret_key"
99 formControlName="secret_key">
100 <span class="input-group-append">
101 <button type="button"
102 class="btn btn-light"
103 cdPasswordButton="secret_key">
105 <cd-copy-2-clipboard-button source="secret_key">
106 </cd-copy-2-clipboard-button>
109 <span class="invalid-feedback"
110 *ngIf="formGroup.showError('secret_key', frm, 'required')"
111 i18n>This field is required.</span>
117 <div class="modal-footer">
118 <cd-form-button-panel (submitActionEvent)="onSubmit()"
120 [submitText]="(action | titlecase) + ' ' + (resource | upperFirst)"
121 [showSubmit]="!viewing"></cd-form-button-panel>