c48957e11e
fix some small problems where jslint complains, introduced by commit: 675e71d37a07f522e065dbefb6a20dde3119fbc3 Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
38 lines
749 B
JavaScript
38 lines
749 B
JavaScript
Ext.define('PVE.form.PrivilegesSelector', {
|
|
extend: 'Proxmox.form.KVComboBox',
|
|
xtype: 'pvePrivilegesSelector',
|
|
|
|
multiSelect: true,
|
|
|
|
initComponent: function() {
|
|
var 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;
|
|
/*jslint forin: true */
|
|
for (key in response.result.data) {
|
|
data.push([key, key]);
|
|
}
|
|
/*jslint forin: false */
|
|
|
|
me.store.setData(data);
|
|
|
|
me.store.sort({
|
|
property: 'key',
|
|
direction: 'ASC'
|
|
});
|
|
},
|
|
|
|
failure: function (response, opts) {
|
|
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
|
|
}
|
|
});
|
|
}
|
|
});
|