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