proxmox-widget-toolkit/window/PasswordEdit.js
Thomas Lamprecht 18a6f207ef window password edit: refactor to more schematic code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-22 11:27:28 +02:00

46 lines
925 B
JavaScript

Ext.define('Proxmox.window.PasswordEdit', {
extend: 'Proxmox.window.Edit',
alias: 'proxmoxWindowPasswordEdit',
mixins: ['Proxmox.Mixin.CBind'],
subject: gettext('Password'),
url: '/api2/extjs/access/password',
fieldDefaults: {
labelWidth: 120,
},
items: [
{
xtype: 'textfield',
inputType: 'password',
fieldLabel: gettext('Password'),
minLength: 5,
allowBlank: false,
name: 'password',
listeners: {
change: (field) => field.next().validate(),
blur: (field) => field.next().validate(),
},
},
{
xtype: 'textfield',
inputType: 'password',
fieldLabel: gettext('Confirm password'),
name: 'verifypassword',
allowBlank: false,
vtype: 'password',
initialPassField: 'password',
submitValue: false,
},
{
xtype: 'hiddenfield',
name: 'userid',
cbind: {
value: '{userid}',
},
},
],
});