]>
Commit | Line | Data |
---|---|---|
9f95a23c | 1 | <cd-modal [modalRef]="bsModalRef"> |
a4b75251 | 2 | <ng-container i18n="form title" |
9f95a23c | 3 | class="modal-title">{{ action | titlecase }} {{ resource | upperFirst }}</ng-container> |
9f95a23c TL |
4 | <ng-container class="modal-content"> |
5 | <form #frm="ngForm" | |
6 | [formGroup]="formGroup" | |
7 | novalidate> | |
8 | <div class="modal-body"> | |
11fdf7f2 | 9 | |
9f95a23c TL |
10 | <!-- Username --> |
11 | <div class="form-group row"> | |
12 | <label class="cd-col-form-label" | |
13 | for="uid" | |
14 | i18n>Username</label> | |
15 | <div class="cd-col-form-input"> | |
16 | <input id="uid" | |
17 | class="form-control" | |
18 | type="text" | |
19 | formControlName="uid" | |
20 | [readonly]="true"> | |
11fdf7f2 TL |
21 | </div> |
22 | </div> | |
11fdf7f2 | 23 | |
9f95a23c TL |
24 | <!-- Subuser --> |
25 | <div class="form-group row"> | |
26 | <label class="cd-col-form-label" | |
27 | [ngClass]="{'required': !editing}" | |
28 | for="subuid" | |
29 | i18n>Subuser</label> | |
30 | <div class="cd-col-form-input"> | |
31 | <input id="subuid" | |
11fdf7f2 | 32 | class="form-control" |
9f95a23c TL |
33 | type="text" |
34 | formControlName="subuid" | |
35 | [readonly]="editing" | |
36 | autofocus> | |
37 | <span class="invalid-feedback" | |
38 | *ngIf="formGroup.showError('subuid', frm, 'required')" | |
39 | i18n>This field is required.</span> | |
40 | <span class="invalid-feedback" | |
41 | *ngIf="formGroup.showError('subuid', frm, 'subuserIdExists')" | |
42 | i18n>The chosen subuser ID is already in use.</span> | |
11fdf7f2 | 43 | </div> |
11fdf7f2 | 44 | </div> |
11fdf7f2 | 45 | |
9f95a23c TL |
46 | <!-- Permission --> |
47 | <div class="form-group row"> | |
48 | <label class="cd-col-form-label required" | |
49 | for="perm" | |
50 | i18n>Permission</label> | |
51 | <div class="cd-col-form-input"> | |
52 | <select id="perm" | |
33c7a0ef | 53 | class="form-control" |
9f95a23c TL |
54 | formControlName="perm"> |
55 | <option i18n | |
56 | [ngValue]="null">-- Select a permission --</option> | |
57 | <option *ngFor="let perm of ['read', 'write']" | |
58 | [value]="perm"> | |
59 | {{ perm }} | |
60 | </option> | |
61 | <option i18n | |
62 | value="read-write">read, write</option> | |
63 | <option i18n | |
64 | value="full-control">full</option> | |
65 | </select> | |
66 | <span class="invalid-feedback" | |
67 | *ngIf="formGroup.showError('perm', frm, 'required')" | |
68 | i18n>This field is required.</span> | |
69 | </div> | |
70 | </div> | |
71 | ||
72 | <!-- Swift key --> | |
73 | <fieldset *ngIf="!editing"> | |
74 | <legend i18n>Swift key</legend> | |
11fdf7f2 | 75 | |
9f95a23c TL |
76 | <!-- Auto-generate key --> |
77 | <div class="form-group row"> | |
78 | <div class="cd-col-form-offset"> | |
79 | <div class="custom-control custom-checkbox"> | |
80 | <input class="custom-control-input" | |
81 | id="generate_secret" | |
82 | type="checkbox" | |
83 | formControlName="generate_secret"> | |
84 | <label class="custom-control-label" | |
85 | for="generate_secret" | |
86 | i18n>Auto-generate secret</label> | |
87 | </div> | |
88 | </div> | |
89 | </div> | |
90 | ||
91 | <!-- Secret key --> | |
92 | <div class="form-group row" | |
93 | *ngIf="!editing && !formGroup.getValue('generate_secret')"> | |
94 | <label class="cd-col-form-label required" | |
95 | for="secret_key" | |
96 | i18n>Secret key</label> | |
97 | <div class="cd-col-form-input"> | |
98 | <div class="input-group"> | |
99 | <input id="secret_key" | |
100 | class="form-control" | |
101 | type="password" | |
102 | formControlName="secret_key"> | |
103 | <span class="input-group-append"> | |
104 | <button type="button" | |
105 | class="btn btn-light" | |
106 | cdPasswordButton="secret_key"> | |
107 | </button> | |
f67539c2 TL |
108 | <cd-copy-2-clipboard-button source="secret_key"> |
109 | </cd-copy-2-clipboard-button> | |
9f95a23c TL |
110 | </span> |
111 | </div> | |
112 | <span class="invalid-feedback" | |
113 | *ngIf="formGroup.showError('secret_key', frm, 'required')" | |
114 | i18n>This field is required.</span> | |
115 | </div> | |
116 | </div> | |
117 | ||
118 | </fieldset> | |
119 | ||
120 | </div> | |
121 | <div class="modal-footer"> | |
f67539c2 TL |
122 | <cd-form-button-panel (submitActionEvent)="onSubmit()" |
123 | [form]="formGroup" | |
124 | [submitText]="(action | titlecase) + ' ' + (resource | upperFirst)"></cd-form-button-panel> | |
9f95a23c TL |
125 | </div> |
126 | </form> | |
127 | </ng-container> | |
128 | </cd-modal> |