fix #1499 Implement a combobox for Permissions paths
Signed-off-by: René Jochum <r.jochum@proxmox.com>
This commit is contained in:
parent
7e3fe38af3
commit
cd84df4c6e
@ -14,6 +14,7 @@ JSSRC= \
|
||||
lxc/CmdMenu.js \
|
||||
node/CmdMenu.js \
|
||||
VNCConsole.js \
|
||||
data/PermPathStore.js \
|
||||
data/ResourceStore.js \
|
||||
data/model/Realm.js \
|
||||
data/model/RRDModels.js \
|
||||
@ -59,6 +60,7 @@ JSSRC= \
|
||||
form/USBSelector.js \
|
||||
form/CalendarEvent.js \
|
||||
form/CephPoolSelector.js \
|
||||
form/PermPathSelector.js \
|
||||
dc/Tasks.js \
|
||||
dc/Log.js \
|
||||
panel/StatusPanel.js \
|
||||
|
54
www/manager6/data/PermPathStore.js
Normal file
54
www/manager6/data/PermPathStore.js
Normal file
@ -0,0 +1,54 @@
|
||||
Ext.define('PVE.data.PermPathStore', {
|
||||
extend: 'Ext.data.Store',
|
||||
alias: 'store.pvePermPath',
|
||||
fields: [ 'value' ],
|
||||
autoLoad: false,
|
||||
data: [
|
||||
{'value': '/access'},
|
||||
{'value': '/nodes'},
|
||||
{'value': '/pool'},
|
||||
{'value': '/storage'},
|
||||
{'value': '/vms'}
|
||||
],
|
||||
|
||||
constructor: function(config) {
|
||||
var me = this;
|
||||
|
||||
config = config || {};
|
||||
|
||||
me.callParent([config]);
|
||||
|
||||
me.suspendEvents();
|
||||
PVE.data.ResourceStore.each(function(record) {
|
||||
switch (record.get('type')) {
|
||||
case 'node':
|
||||
me.add({value: '/nodes/' + record.get('text')});
|
||||
break;
|
||||
|
||||
case 'qemu':
|
||||
me.add({value: '/vms/' + record.get('vmid')});
|
||||
break;
|
||||
|
||||
case 'lxc':
|
||||
me.add({value: '/vms/' + record.get('vmid')});
|
||||
break;
|
||||
|
||||
case 'storage':
|
||||
me.add({value: '/storage/' + record.get('storage')});
|
||||
break;
|
||||
case 'pool':
|
||||
me.add({value: '/pool/' + record.get('pool')});
|
||||
break;
|
||||
}
|
||||
});
|
||||
me.resumeEvents();
|
||||
|
||||
me.fireEvent('refresh', me);
|
||||
me.fireEvent('datachanged', me);
|
||||
|
||||
me.sort({
|
||||
property: 'value',
|
||||
direction: 'ASC'
|
||||
});
|
||||
}
|
||||
});
|
@ -12,7 +12,7 @@ Ext.define('PVE.dc.ACLAdd', {
|
||||
|
||||
var items = [
|
||||
{
|
||||
xtype: me.path ? 'hiddenfield' : 'textfield',
|
||||
xtype: me.path ? 'hiddenfield' : 'pvePermPathSelector',
|
||||
name: 'path',
|
||||
value: me.path,
|
||||
allowBlank: false,
|
||||
|
12
www/manager6/form/PermPathSelector.js
Normal file
12
www/manager6/form/PermPathSelector.js
Normal file
@ -0,0 +1,12 @@
|
||||
Ext.define('PVE.form.PermPathSelector', {
|
||||
extend: 'Ext.form.field.ComboBox',
|
||||
xtype: 'pvePermPathSelector',
|
||||
|
||||
valueField: 'value',
|
||||
displayField: 'value',
|
||||
typeAhead: true,
|
||||
queryMode: 'local',
|
||||
store: {
|
||||
type: 'pvePermPath'
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user