mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-15 13:36:37 +00:00

Signed-off-by: Markus Frank <m.frank@proxmox.com> Reviewed-by: Laurențiu Leahu-Vlăducu <l.leahu-vladucu@proxmox.com Reviewed-by: Daniel Kral <d.kral@proxmox.com> Tested-by: Laurențiu Leahu-Vlăducu <l.leahu-vladucu@proxmox.com> Tested-by: Daniel Kral <d.kral@proxmox.com> Tested-by: Lukas Wagner <l.wagner@proxmox.com> Link: https://lore.proxmox.com/20250407134950.265270-10-m.frank@proxmox.com Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
64 lines
1010 B
JavaScript
64 lines
1010 B
JavaScript
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);
|
|
},
|
|
});
|