|
74 | 74 | </div> |
75 | 75 | </form> |
76 | 76 |
|
77 | | - {{/* Change password */}} |
78 | | - <form hx-post="/configure/users/{{.Name}}/password" hx-swap="none"> |
| 77 | + {{/* Change password. type=text + CSS mask (cfg-input-mask) |
| 78 | + dodges the browser password-manager save prompt, same as |
| 79 | + the keystore secret fields. */}} |
| 80 | + <form hx-post="/configure/users/{{.Name}}/password" hx-swap="none" autocomplete="off"> |
79 | 81 | <div class="section-subtitle">Change Password</div> |
80 | 82 | <table class="info-table"> |
81 | 83 | <tr> |
82 | | - <th>New password</th> |
83 | | - <td><input class="cfg-input" type="password" name="password" |
84 | | - autocomplete="new-password" |
85 | | - placeholder="Leave blank to keep current"></td> |
| 84 | + <th>New password{{template "field-info" (index $.Desc "password")}}</th> |
| 85 | + <td> |
| 86 | + <span class="cfg-secret-wrap"> |
| 87 | + <input class="cfg-input cfg-input-mask" type="text" name="password" |
| 88 | + id="chpw-{{.Name}}" placeholder="Leave blank to keep current" |
| 89 | + autocomplete="off" spellcheck="false" |
| 90 | + data-1p-ignore="true" data-lpignore="true" |
| 91 | + data-bwignore="true" data-form-type="other"> |
| 92 | + <button type="button" class="btn-icon cfg-secret-toggle" |
| 93 | + data-toggle-mask="chpw-{{.Name}}" |
| 94 | + aria-label="Show / hide password">👁</button> |
| 95 | + </span> |
| 96 | + </td> |
| 97 | + </tr> |
| 98 | + <tr> |
| 99 | + <th>Hash{{template "field-info" (index $.Desc "crypt")}}</th> |
| 100 | + <td><select class="cfg-input" name="crypt"> |
| 101 | + {{range $.CryptMethods}}<option value="{{.Value}}" {{if .Default}}selected{{end}}>{{.Label}}</option>{{end}} |
| 102 | + </select></td> |
86 | 103 | </tr> |
87 | 104 | </table> |
88 | 105 | <div class="cfg-card-footer" style="padding-left:0"> |
|
147 | 164 | </tr> |
148 | 165 | {{end}} |
149 | 166 |
|
150 | | - {{/* Hidden add-user row — revealed by the + Add user button */}} |
| 167 | + {{/* Hidden add-user row — revealed by the + Add user button. The |
| 168 | + password is a CSS-masked type=text (cfg-input-mask) to dodge the |
| 169 | + browser password-manager save prompt, same as keystore secrets. */}} |
151 | 170 | <tr id="add-user-row" hidden> |
152 | 171 | <td colspan="4" class="key-detail-cell"> |
153 | | - <form hx-post="/configure/users" hx-swap="none" class="user-add-inline" |
154 | | - autocomplete="off"> |
155 | | - <input class="cfg-input" type="text" name="username" required |
156 | | - autocomplete="off" |
157 | | - pattern="[a-zA-Z0-9_][a-zA-Z0-9_.-]*" placeholder="Username"> |
158 | | - <input class="cfg-input" type="password" name="password" required |
159 | | - autocomplete="new-password" placeholder="Password"> |
160 | | - <select class="cfg-input" name="shell"> |
161 | | - {{range .ShellOptions}}<option value="{{.Value}}" {{if .IsDefault}}selected{{end}}>{{.Label}}{{if .IsDefault}} (default){{end}}</option>{{end}} |
162 | | - </select> |
163 | | - <button class="btn btn-primary btn-sm" type="submit">Add</button> |
164 | | - <button type="button" class="btn btn-sm" data-hide="add-user-row">Cancel</button> |
165 | | - <span class="cfg-save-status"></span> |
| 172 | + <div class="key-detail-body"> |
| 173 | + <form hx-post="/configure/users" hx-swap="none" autocomplete="off"> |
| 174 | + <div class="section-subtitle">Add User</div> |
| 175 | + <table class="info-table"> |
| 176 | + <tr> |
| 177 | + <th>Username{{template "field-info" (index $.Desc "username")}}</th> |
| 178 | + <td><input class="cfg-input" type="text" name="username" required autocomplete="off" |
| 179 | + pattern="[a-zA-Z0-9_][a-zA-Z0-9_.-]*" placeholder="Username"></td> |
| 180 | + </tr> |
| 181 | + <tr> |
| 182 | + <th>Password{{template "field-info" (index $.Desc "password")}}</th> |
| 183 | + <td> |
| 184 | + <span class="cfg-secret-wrap"> |
| 185 | + <input class="cfg-input cfg-input-mask" type="text" name="password" |
| 186 | + id="add-user-password" required placeholder="Password" |
| 187 | + autocomplete="off" spellcheck="false" |
| 188 | + data-1p-ignore="true" data-lpignore="true" |
| 189 | + data-bwignore="true" data-form-type="other"> |
| 190 | + <button type="button" class="btn-icon cfg-secret-toggle" |
| 191 | + data-toggle-mask="add-user-password" |
| 192 | + aria-label="Show / hide password">👁</button> |
| 193 | + </span> |
| 194 | + </td> |
| 195 | + </tr> |
| 196 | + <tr> |
| 197 | + <th>Hash{{template "field-info" (index $.Desc "crypt")}}</th> |
| 198 | + <td><select class="cfg-input" name="crypt"> |
| 199 | + {{range $.CryptMethods}}<option value="{{.Value}}" {{if .Default}}selected{{end}}>{{.Label}}</option>{{end}} |
| 200 | + </select></td> |
| 201 | + </tr> |
| 202 | + <tr> |
| 203 | + <th>Shell{{template "field-info" (index $.Desc "shell")}}</th> |
| 204 | + <td><select class="cfg-input" name="shell"> |
| 205 | + {{range $.ShellOptions}}<option value="{{.Value}}" {{if .IsDefault}}selected{{end}}>{{.Label}}{{if .IsDefault}} (default){{end}}</option>{{end}} |
| 206 | + </select></td> |
| 207 | + </tr> |
| 208 | + </table> |
| 209 | + <div class="cfg-card-footer" style="padding-left:0"> |
| 210 | + <button class="btn btn-primary btn-sm" type="submit">Add</button> |
| 211 | + <button type="button" class="btn btn-sm" data-hide="add-user-row">Cancel</button> |
| 212 | + <span class="cfg-save-status"></span> |
| 213 | + </div> |
166 | 214 | </form> |
| 215 | + </div> |
167 | 216 | </td> |
168 | 217 | </tr> |
169 | 218 |
|
|
0 commit comments