add pmxRoleSelector
copied+refactored from pve-manager for use with other projects also show privs now in the combobox Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
50e8bf4419
commit
9a3c1cb408
1
Makefile
1
Makefile
@ -30,6 +30,7 @@ JSSRC= \
|
||||
form/BondModeSelector.js \
|
||||
form/NetworkSelector.js \
|
||||
form/RealmComboBox.js \
|
||||
form/RoleSelector.js \
|
||||
button/Button.js \
|
||||
button/HelpButton.js \
|
||||
grid/ObjectGrid.js \
|
||||
|
41
form/RoleSelector.js
Normal file
41
form/RoleSelector.js
Normal file
@ -0,0 +1,41 @@
|
||||
Ext.define('pmx-roles', {
|
||||
extend: 'Ext.data.Model',
|
||||
fields: ['roleid', 'privs'],
|
||||
proxy: {
|
||||
type: 'proxmox',
|
||||
url: "/api2/json/access/roles",
|
||||
},
|
||||
idProperty: 'roleid',
|
||||
});
|
||||
|
||||
Ext.define('Proxmox.form.RoleSelector', {
|
||||
extend: 'Proxmox.form.ComboGrid',
|
||||
alias: 'widget.pmxRoleSelector',
|
||||
|
||||
allowBlank: false,
|
||||
autoSelect: false,
|
||||
valueField: 'roleid',
|
||||
displayField: 'roleid',
|
||||
|
||||
listConfig: {
|
||||
columns: [
|
||||
{
|
||||
header: gettext('Role'),
|
||||
sortable: true,
|
||||
dataIndex: 'roleid',
|
||||
flex: 1,
|
||||
},
|
||||
{
|
||||
header: gettext('Privileges'),
|
||||
dataIndex: 'privs',
|
||||
flex: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
store: {
|
||||
autoLoad: true,
|
||||
model: 'pmx-roles',
|
||||
sorters: 'roleid',
|
||||
},
|
||||
});
|
Loading…
Reference in New Issue
Block a user