pve-manager/www/manager6/form/RoleSelector.js
Thomas Lamprecht 6529dbca44 use RestProxy from widget toolkit
Split PVE specific models, which where not moved to the general
widget toolkit, in a separate folder: data/models/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
2018-01-25 13:36:38 +01:00

51 lines
834 B
JavaScript

Ext.define('PVE.form.RoleSelector', {
extend: 'Proxmox.form.ComboGrid',
alias: ['widget.pveRoleSelector'],
allowBlank: false,
autoSelect: false,
valueField: 'roleid',
displayField: 'roleid',
initComponent: function() {
var me = this;
var store = new Ext.data.Store({
model: 'pve-roles',
sorters: [{
property: 'roleid'
}]
});
Ext.apply(me, {
store: store,
listConfig: {
columns: [
{
header: gettext('Role'),
sortable: true,
dataIndex: 'roleid',
flex: 1
}
]
}
});
me.callParent();
store.load();
}
}, function() {
Ext.define('pve-roles', {
extend: 'Ext.data.Model',
fields: [ 'roleid', 'privs' ],
proxy: {
type: 'proxmox',
url: "/api2/json/access/roles"
},
idProperty: 'roleid'
});
});