]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.html
import 15.2.0 Octopus source
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / core / auth / user-form / user-form.component.html
CommitLineData
9f95a23c
TL
1<cd-loading-panel *ngIf="!pwdExpirationSettings"
2 i18n>Loading...</cd-loading-panel>
3
4<div class="cd-col-form">
11fdf7f2 5 <form name="userForm"
11fdf7f2
TL
6 #formDir="ngForm"
7 [formGroup]="userForm"
9f95a23c 8 *ngIf="pwdExpirationSettings"
11fdf7f2 9 novalidate>
9f95a23c
TL
10 <div class="card">
11 <div i18n="form title|Example: Create Pool@@formTitle"
12 class="card-header">{{ action | titlecase }} {{ resource | upperFirst }}</div>
13 <div class="card-body">
11fdf7f2
TL
14
15 <!-- Username -->
9f95a23c
TL
16 <div class="form-group row">
17 <label class="cd-col-form-label"
18 [ngClass]="{'required': mode !== userFormMode.editing}"
19 for="username"
20 i18n>Username</label>
21 <div class="cd-col-form-input">
11fdf7f2
TL
22 <input class="form-control"
23 type="text"
24 placeholder="Username..."
25 id="username"
26 name="username"
27 formControlName="username"
28 autofocus>
9f95a23c 29 <span class="invalid-feedback"
11fdf7f2
TL
30 *ngIf="userForm.showError('username', formDir, 'required')"
31 i18n>This field is required.</span>
32 </div>
33 </div>
34
35 <!-- Password -->
9f95a23c
TL
36 <div class="form-group row">
37 <label class="cd-col-form-label"
38 for="password">
39 <ng-container i18n>Password</ng-container>
40 <cd-helper *ngIf="passwordPolicyHelpText.length > 0"
41 class="text-pre"
42 html="{{ passwordPolicyHelpText }}">
43 </cd-helper>
44 </label>
45 <div class="cd-col-form-input">
11fdf7f2
TL
46 <div class="input-group">
47 <input class="form-control"
48 type="password"
49 placeholder="Password..."
50 id="password"
51 name="password"
52 autocomplete="new-password"
53 formControlName="password">
9f95a23c 54 <span class="input-group-append">
11fdf7f2 55 <button type="button"
9f95a23c 56 class="btn btn-light"
11fdf7f2
TL
57 cdPasswordButton="password">
58 </button>
59 </span>
60 </div>
9f95a23c
TL
61 <div class="password-strength-level">
62 <div class="{{ passwordStrengthLevelClass }}"
63 data-toggle="tooltip"
64 title="{{ passwordValuation }}">
65 </div>
66 </div>
67 <span class="invalid-feedback"
11fdf7f2
TL
68 *ngIf="userForm.showError('password', formDir, 'required')"
69 i18n>This field is required.</span>
9f95a23c
TL
70 <span class="invalid-feedback"
71 *ngIf="userForm.showError('password', formDir, 'passwordPolicy')">
72 {{ passwordValuation }}
73 </span>
11fdf7f2
TL
74 </div>
75 </div>
76
77 <!-- Confirm password -->
9f95a23c 78 <div class="form-group row">
11fdf7f2 79 <label i18n
9f95a23c
TL
80 class="cd-col-form-label"
81 for="confirmpassword">Confirm password</label>
82 <div class="cd-col-form-input">
11fdf7f2
TL
83 <div class="input-group">
84 <input class="form-control"
85 type="password"
86 placeholder="Confirm password..."
87 id="confirmpassword"
88 name="confirmpassword"
89 formControlName="confirmpassword">
9f95a23c 90 <span class="input-group-append">
11fdf7f2 91 <button type="button"
9f95a23c 92 class="btn btn-light"
11fdf7f2
TL
93 cdPasswordButton="confirmpassword">
94 </button>
95 </span>
96 </div>
9f95a23c 97 <span class="invalid-feedback"
11fdf7f2
TL
98 *ngIf="userForm.showError('confirmpassword', formDir, 'required')"
99 i18n>This field is required.</span>
9f95a23c 100 <span class="invalid-feedback"
11fdf7f2
TL
101 *ngIf="userForm.showError('confirmpassword', formDir, 'match')"
102 i18n>Password confirmation doesn't match the password.</span>
103 </div>
104 </div>
105
9f95a23c
TL
106 <!-- Password expiration date -->
107 <div class="form-group row"
108 *ngIf="!authStorageService.isSSO()">
109 <label class="cd-col-form-label"
110 [ngClass]="{'required': pwdExpirationSettings.pwdExpirationSpan > 0}"
111 for="pwdExpirationDate">
112 <ng-container i18n>Password expiration date</ng-container>
113 <cd-helper class="text-pre"
114 *ngIf="pwdExpirationSettings.pwdExpirationSpan == 0">
115 <p>
116 The Dashboard setting defining the expiration interval of
117 passwords is currently set to <strong>0</strong>. This means
118 if a date is set, the user password will only expire once.
119 </p>
120 <p>
121 Consider configuring the Dashboard setting
122 <a routerLink="/mgr-modules/edit/dashboard"
123 class="alert-link">USER_PWD_EXPIRATION_SPAN</a>
124 in order to let passwords expire periodically.
125 </p>
126 </cd-helper>
127 </label>
128 <div class="cd-col-form-input">
129 <div class="input-group">
130 <input type="text"
131 class="form-control"
132 i18n-placeholder
133 placeholder="Password expiration date..."
134 [bsConfig]="bsConfig"
135 [minDate]="minDate"
136 bsDatepicker
137 id="pwdExpirationDate"
138 name="pwdExpirationDate"
139 formControlName="pwdExpirationDate">
140 <span class="input-group-append">
141 <button type="button"
142 class="btn btn-light"
143 (click)="clearExpirationDate()">
144 <i class="icon-prepend {{ icons.destroy }}"></i>
145 </button>
146 </span>
147 <span class="invalid-feedback"
148 *ngIf="userForm.showError('pwdExpirationDate', formDir, 'required')"
149 i18n>This field is required.</span>
150 </div>
151 </div>
152 </div>
153
11fdf7f2 154 <!-- Name -->
9f95a23c 155 <div class="form-group row">
11fdf7f2 156 <label i18n
9f95a23c 157 class="cd-col-form-label"
11fdf7f2 158 for="name">Full name</label>
9f95a23c 159 <div class="cd-col-form-input">
11fdf7f2
TL
160 <input class="form-control"
161 type="text"
162 placeholder="Full name..."
163 id="name"
164 name="name"
165 formControlName="name">
166 </div>
167 </div>
168
169 <!-- Email -->
9f95a23c 170 <div class="form-group row">
11fdf7f2 171 <label i18n
9f95a23c 172 class="cd-col-form-label"
11fdf7f2 173 for="email">Email</label>
9f95a23c 174 <div class="cd-col-form-input">
11fdf7f2
TL
175 <input class="form-control"
176 type="email"
177 placeholder="Email..."
178 id="email"
179 name="email"
180 formControlName="email">
181
9f95a23c 182 <span class="invalid-feedback"
11fdf7f2
TL
183 *ngIf="userForm.showError('email', formDir, 'email')"
184 i18n>Invalid email.</span>
185 </div>
186 </div>
187
188 <!-- Roles -->
9f95a23c
TL
189 <div class="form-group row">
190 <label class="cd-col-form-label"
191 i18n>Roles</label>
192 <div class="cd-col-form-input">
193 <span class="no-border full-height"
194 *ngIf="allRoles">
195 <cd-select-badges [data]="userForm.controls.roles.value"
196 [options]="allRoles"
197 [messages]="messages"></cd-select-badges>
198 </span>
199 </div>
200 </div>
201
202 <!-- Enabled -->
203 <div class="form-group row"
204 *ngIf="!isCurrentUser()">
205 <div class="cd-col-form-offset">
206 <div class="custom-control custom-checkbox">
207 <input type="checkbox"
208 class="custom-control-input"
209 id="enabled"
210 name="enabled"
211 formControlName="enabled">
212 <label class="custom-control-label"
213 for="enabled"
214 i18n>Enabled</label>
215 </div>
216 </div>
217 </div>
218
219 <!-- Force change password -->
220 <div class="form-group row"
221 *ngIf="!isCurrentUser() && !authStorageService.isSSO()">
222 <div class="cd-col-form-offset">
223 <div class="custom-control custom-checkbox">
224 <input type="checkbox"
225 class="custom-control-input"
226 id="pwdUpdateRequired"
227 name="pwdUpdateRequired"
228 formControlName="pwdUpdateRequired">
229 <label class="custom-control-label"
230 for="pwdUpdateRequired"
231 i18n>User must change password at next logon</label>
232 </div>
233 </div>
11fdf7f2
TL
234 </div>
235
236 </div>
9f95a23c 237 <div class="card-footer">
11fdf7f2 238 <div class="button-group text-right">
9f95a23c
TL
239 <cd-submit-button (submitAction)="submit()"
240 i18n="form action button|Example: Create Pool@@formActionButton"
241 [form]="formDir">{{ action | titlecase }} {{ resource | upperFirst }}</cd-submit-button>
11fdf7f2
TL
242 <cd-back-button></cd-back-button>
243 </div>
244 </div>
245 </div>
246 </form>
247</div>
248
249<ng-template #removeSelfUserReadUpdatePermissionTpl>
250 <p><strong i18n>You are about to remove "user read / update" permissions from your own user.</strong></p>
251 <br>
252 <p i18n>If you continue, you will no longer be able to add or remove roles from any user.</p>
253
254 <ng-container i18n>Are you sure you want to continue?</ng-container>
255</ng-template>