mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-27 05:52:32 +00:00
ui: user edit: use new pmxExpireDate field
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
1efbcdfad0
commit
3d3199a6bf
@ -84,12 +84,8 @@ Ext.define('PVE.dc.UserEdit', {
|
|||||||
fieldLabel: gettext('Group')
|
fieldLabel: gettext('Group')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
xtype: 'datefield',
|
xtype: 'pmxExpireDate',
|
||||||
name: 'expire',
|
name: 'expire',
|
||||||
emptyText: 'never',
|
|
||||||
format: 'Y-m-d',
|
|
||||||
submitFormat: 'U',
|
|
||||||
fieldLabel: gettext('Expire')
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
xtype: 'proxmoxcheckbox',
|
xtype: 'proxmoxcheckbox',
|
||||||
@ -156,11 +152,6 @@ Ext.define('PVE.dc.UserEdit', {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
onGetValues: function(values) {
|
onGetValues: function(values) {
|
||||||
// hack: ExtJS datefield does not submit 0, so we need to set that
|
|
||||||
if (!values.expire) {
|
|
||||||
values.expire = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (realm) {
|
if (realm) {
|
||||||
values.userid = values.userid + '@' + realm;
|
values.userid = values.userid + '@' + realm;
|
||||||
}
|
}
|
||||||
@ -189,14 +180,6 @@ Ext.define('PVE.dc.UserEdit', {
|
|||||||
me.load({
|
me.load({
|
||||||
success: function(response, options) {
|
success: function(response, options) {
|
||||||
var data = response.result.data;
|
var data = response.result.data;
|
||||||
if (Ext.isDefined(data.expire)) {
|
|
||||||
if (data.expire) {
|
|
||||||
data.expire = new Date(data.expire * 1000);
|
|
||||||
} else {
|
|
||||||
// display 'never' instead of '1970-01-01'
|
|
||||||
data.expire = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
me.setValues(data);
|
me.setValues(data);
|
||||||
if (data.keys) {
|
if (data.keys) {
|
||||||
if ( data.keys === 'x!oath' || data.keys === 'x!u2f' ) {
|
if ( data.keys === 'x!oath' || data.keys === 'x!u2f' ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user