mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-14 03:57:40 +00:00
ui: form/Priv.Selector: eslint fixes and code cleanup/refactoring
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
65c6c5d592
commit
93365f47d7
@ -5,19 +5,15 @@ Ext.define('PVE.form.PrivilegesSelector', {
|
||||
multiSelect: true,
|
||||
|
||||
initComponent: function() {
|
||||
var me = this;
|
||||
let me = this;
|
||||
|
||||
// So me.store is available.
|
||||
me.callParent();
|
||||
|
||||
Proxmox.Utils.API2Request({
|
||||
url: '/access/roles/Administrator',
|
||||
method: 'GET',
|
||||
success: function(response, options) {
|
||||
var data = [], key;
|
||||
for (key in response.result.data) {
|
||||
data.push([key, key]);
|
||||
}
|
||||
let data = Object.keys(response.result.data).map(key => [key, key]);
|
||||
|
||||
me.store.setData(data);
|
||||
|
||||
@ -26,10 +22,7 @@ Ext.define('PVE.form.PrivilegesSelector', {
|
||||
direction: 'ASC',
|
||||
});
|
||||
},
|
||||
|
||||
failure: function(response, opts) {
|
||||
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
|
||||
},
|
||||
failure: (response, opts) => Ext.Msg.alert(gettext('Error'), response.htmlStatus),
|
||||
});
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user