mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-15 18:29:46 +00:00

This fixes around 20 jslint type confusion warnings. Also reduce the scope and document jslint warnings along the way. No functional changes.
49 lines
1.0 KiB
JavaScript
49 lines
1.0 KiB
JavaScript
Ext.define('PVE.dc.GroupEdit', {
|
|
extend: 'PVE.window.Edit',
|
|
alias: ['widget.pveDcGroupEdit'],
|
|
|
|
initComponent : function() {
|
|
var me = this;
|
|
|
|
me.isCreate = !me.groupid;
|
|
|
|
var url;
|
|
var method;
|
|
|
|
if (me.isCreate) {
|
|
url = '/api2/extjs/access/groups';
|
|
method = 'POST';
|
|
} else {
|
|
url = '/api2/extjs/access/groups/' + me.groupid;
|
|
method = 'PUT';
|
|
}
|
|
|
|
Ext.applyIf(me, {
|
|
subject: gettext('Group'),
|
|
url: url,
|
|
method: method,
|
|
items: [
|
|
{
|
|
xtype: me.isCreate ? 'pvetextfield' : 'displayfield',
|
|
fieldLabel: gettext('Name'),
|
|
name: 'groupid',
|
|
value: me.groupid,
|
|
allowBlank: false
|
|
},
|
|
{
|
|
xtype: 'textfield',
|
|
fieldLabel: gettext('Comment'),
|
|
name: 'comment',
|
|
allowBlank: true
|
|
}
|
|
]
|
|
});
|
|
|
|
me.callParent();
|
|
|
|
if (!me.isCreate) {
|
|
me.load();
|
|
}
|
|
}
|
|
});
|