pve-manager/www/manager6/dc/DirMapView.js
Markus Frank 3ac01b4ede ui: add resource mapping view for directories
To save vertical space in the Resource Mappings tab, there is a
temporary Directory Mappings tab until we find content fitting the
general 'resource mapping' panel and can put all types as submenu items.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
Link: https://lore.proxmox.com/20250407134950.265270-9-m.frank@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-08 00:46:40 +02:00

39 lines
852 B
JavaScript

Ext.define('pve-resource-dir-tree', {
extend: 'Ext.data.Model',
idProperty: 'internalId',
fields: ['type', 'text', 'path', 'id', 'description', 'digest'],
});
Ext.define('PVE.dc.DirMapView', {
extend: 'PVE.tree.ResourceMapTree',
alias: 'widget.pveDcDirMapView',
editWindowClass: 'PVE.window.DirMapEditWindow',
baseUrl: '/cluster/mapping/dir',
mapIconCls: 'fa fa-folder',
entryIdProperty: 'path',
store: {
sorters: 'text',
model: 'pve-resource-dir-tree',
data: {},
},
columns: [
{
xtype: 'treecolumn',
text: gettext('ID/Node'),
dataIndex: 'text',
width: 200,
},
{
header: gettext('Comment'),
dataIndex: 'description',
renderer: function(value, _meta, record) {
return Ext.String.htmlEncode(value ?? record.data.comment);
},
flex: 1,
},
],
});