Signed-off-by: Markus Frank <m.fr...@proxmox.com> --- www/manager6/Makefile | 1 + www/manager6/form/DirMapSelector.js | 63 +++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 www/manager6/form/DirMapSelector.js
diff --git a/www/manager6/Makefile b/www/manager6/Makefile index 57c4d377..fabbdd24 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -35,6 +35,7 @@ JSSRC= \ form/ContentTypeSelector.js \ form/ControllerSelector.js \ form/DayOfWeekSelector.js \ + form/DirMapSelector.js \ form/DiskFormatSelector.js \ form/DiskStorageSelector.js \ form/FileSelector.js \ diff --git a/www/manager6/form/DirMapSelector.js b/www/manager6/form/DirMapSelector.js new file mode 100644 index 00000000..473a2ffe --- /dev/null +++ b/www/manager6/form/DirMapSelector.js @@ -0,0 +1,63 @@ +Ext.define('PVE.form.DirMapSelector', { + extend: 'Proxmox.form.ComboGrid', + alias: 'widget.pveDirMapSelector', + + store: { + fields: ['name', 'path'], + filterOnLoad: true, + sorters: [ + { + property: 'id', + direction: 'ASC', + }, + ], + }, + + allowBlank: false, + autoSelect: false, + displayField: 'id', + valueField: 'id', + + listConfig: { + columns: [ + { + header: gettext('Directory ID'), + dataIndex: 'id', + flex: 1, + }, + { + header: gettext('Comment'), + dataIndex: 'description', + flex: 1, + }, + ], + }, + + setNodename: function(nodename) { + var me = this; + + if (!nodename || me.nodename === nodename) { + return; + } + + me.nodename = nodename; + + me.store.setProxy({ + type: 'proxmox', + url: `/api2/json/cluster/mapping/dir?check-node=${nodename}`, + }); + + me.store.load(); + }, + + initComponent: function() { + var me = this; + + var nodename = me.nodename; + me.nodename = undefined; + + me.callParent(); + + me.setNodename(nodename); + }, +}); -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel