mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-14 10:28:14 +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,
|
multiSelect: true,
|
||||||
|
|
||||||
initComponent: function() {
|
initComponent: function() {
|
||||||
var me = this;
|
let me = this;
|
||||||
|
|
||||||
// So me.store is available.
|
|
||||||
me.callParent();
|
me.callParent();
|
||||||
|
|
||||||
Proxmox.Utils.API2Request({
|
Proxmox.Utils.API2Request({
|
||||||
url: '/access/roles/Administrator',
|
url: '/access/roles/Administrator',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
success: function(response, options) {
|
success: function(response, options) {
|
||||||
var data = [], key;
|
let data = Object.keys(response.result.data).map(key => [key, key]);
|
||||||
for (key in response.result.data) {
|
|
||||||
data.push([key, key]);
|
|
||||||
}
|
|
||||||
|
|
||||||
me.store.setData(data);
|
me.store.setData(data);
|
||||||
|
|
||||||
@ -26,10 +22,7 @@ Ext.define('PVE.form.PrivilegesSelector', {
|
|||||||
direction: 'ASC',
|
direction: 'ASC',
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
failure: (response, opts) => Ext.Msg.alert(gettext('Error'), response.htmlStatus),
|
||||||
failure: function(response, opts) {
|
|
||||||
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user