From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <pve-devel-bounces@lists.proxmox.com> Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id BCDC31FF173 for <inbox@lore.proxmox.com>; Mon, 10 Feb 2025 16:39:19 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5130111CA9; Mon, 10 Feb 2025 16:38:32 +0100 (CET) From: Filip Schauer <f.schauer@proxmox.com> To: pve-devel@lists.proxmox.com Date: Mon, 10 Feb 2025 16:37:30 +0100 Message-Id: <20250210153734.103381-8-f.schauer@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250210153734.103381-1-f.schauer@proxmox.com> References: <20250210153734.103381-1-f.schauer@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.021 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH manager v3 07/11] ui: split resource mapping types into tabbed views X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/> List-Post: <mailto:pve-devel@lists.proxmox.com> List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help> List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe> Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com> Reorganize resource mapping types into separate views accessible via tabs. Signed-off-by: Filip Schauer <f.schauer@proxmox.com> --- www/manager6/Makefile | 13 ++--- www/manager6/dc/Config.js | 51 +++---------------- .../{window => resource-map}/HWRNGMapEdit.js | 2 +- .../{dc => resource-map}/HWRNGMapView.js | 4 +- .../{window => resource-map}/PCIMapEdit.js | 2 +- .../{dc => resource-map}/PCIMapView.js | 4 +- www/manager6/resource-map/ResourceMapView.js | 23 +++++++++ .../{window => resource-map}/USBMapEdit.js | 2 +- .../{dc => resource-map}/USBMapView.js | 4 +- 9 files changed, 45 insertions(+), 60 deletions(-) rename www/manager6/{window => resource-map}/HWRNGMapEdit.js (98%) rename www/manager6/{dc => resource-map}/HWRNGMapView.js (93%) rename www/manager6/{window => resource-map}/PCIMapEdit.js (99%) rename www/manager6/{dc => resource-map}/PCIMapView.js (96%) create mode 100644 www/manager6/resource-map/ResourceMapView.js rename www/manager6/{window => resource-map}/USBMapEdit.js (99%) rename www/manager6/{dc => resource-map}/USBMapView.js (95%) diff --git a/www/manager6/Makefile b/www/manager6/Makefile index d148a1c9..e13899b5 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -137,9 +137,6 @@ JSSRC= \ window/GuestDiskReassign.js \ window/GuestStop.js \ window/TreeSettingsEdit.js \ - window/PCIMapEdit.js \ - window/USBMapEdit.js \ - window/HWRNGMapEdit.js \ window/GuestImport.js \ ha/Fencing.js \ ha/GroupEdit.js \ @@ -188,9 +185,6 @@ JSSRC= \ dc/UserTagAccessEdit.js \ dc/RegisteredTagsEdit.js \ dc/RealmSyncJob.js \ - dc/PCIMapView.js \ - dc/USBMapView.js \ - dc/HWRNGMapView.js \ lxc/CmdMenu.js \ lxc/Config.js \ lxc/CreateWizard.js \ @@ -271,6 +265,13 @@ JSSRC= \ qemu/Smbios1Edit.js \ qemu/SystemEdit.js \ qemu/USBEdit.js \ + resource-map/PCIMapEdit.js \ + resource-map/USBMapEdit.js \ + resource-map/HWRNGMapEdit.js \ + resource-map/PCIMapView.js \ + resource-map/ResourceMapView.js \ + resource-map/USBMapView.js \ + resource-map/HWRNGMapView.js \ sdn/Browser.js \ sdn/ControllerView.js \ sdn/Status.js \ diff --git a/www/manager6/dc/Config.js b/www/manager6/dc/Config.js index 3650f290..1dc82dee 100644 --- a/www/manager6/dc/Config.js +++ b/www/manager6/dc/Config.js @@ -297,51 +297,12 @@ Ext.define('PVE.dc.Config', { if (caps.mapping['Mapping.Audit'] || caps.mapping['Mapping.Use'] || caps.mapping['Mapping.Modify']) { - me.items.push( - { - xtype: 'container', - onlineHelp: 'resource_mapping', - title: gettext('Resource Mappings'), - itemId: 'resources', - iconCls: 'fa fa-folder-o', - layout: { - type: 'vbox', - align: 'stretch', - multi: true, - }, - scrollable: true, - defaults: { - border: false, - }, - items: [ - { - xtype: 'pveDcPCIMapView', - title: gettext('PCI Devices'), - flex: 1, - }, - { - xtype: 'splitter', - collapsible: false, - performCollapse: false, - }, - { - xtype: 'pveDcUSBMapView', - title: gettext('USB Devices'), - flex: 1, - }, - { - xtype: 'splitter', - collapsible: false, - performCollapse: false, - }, - { - xtype: 'pveDcHWRNGMapView', - title: gettext('Hardware RNG Devices'), - flex: 1, - }, - ], - }, - ); + me.items.push({ + xtype: 'pveResourceMapView', + title: gettext('Resource Mappings'), + itemId: 'resources', + iconCls: 'fa fa-folder-o', + }); } if (caps.mapping['Mapping.Audit'] || diff --git a/www/manager6/window/HWRNGMapEdit.js b/www/manager6/resource-map/HWRNGMapEdit.js similarity index 98% rename from www/manager6/window/HWRNGMapEdit.js rename to www/manager6/resource-map/HWRNGMapEdit.js index aef4e2af..a6ba0641 100644 --- a/www/manager6/window/HWRNGMapEdit.js +++ b/www/manager6/resource-map/HWRNGMapEdit.js @@ -1,4 +1,4 @@ -Ext.define('PVE.window.HWRNGMapEditWindow', { +Ext.define('PVE.resource-map.HWRNGMapEditWindow', { extend: 'Proxmox.window.Edit', mixins: ['Proxmox.Mixin.CBind'], diff --git a/www/manager6/dc/HWRNGMapView.js b/www/manager6/resource-map/HWRNGMapView.js similarity index 93% rename from www/manager6/dc/HWRNGMapView.js rename to www/manager6/resource-map/HWRNGMapView.js index 27c0d2fc..dbd96ea8 100644 --- a/www/manager6/dc/HWRNGMapView.js +++ b/www/manager6/resource-map/HWRNGMapView.js @@ -4,11 +4,11 @@ Ext.define('pve-resource-hwrng-tree', { fields: ['type', 'text', 'path', 'description', 'digest'], }); -Ext.define('PVE.dc.HWRNGMapView', { +Ext.define('PVE.resource-map.HWRNGMapView', { extend: 'PVE.tree.ResourceMapTree', alias: 'widget.pveDcHWRNGMapView', - editWindowClass: 'PVE.window.HWRNGMapEditWindow', + editWindowClass: 'PVE.resource-map.HWRNGMapEditWindow', baseUrl: '/cluster/mapping/hwrng', mapIconCls: 'pve-itype-icon-die', getStatusCheckUrl: (node) => `/nodes/${node}/hardware/hwrng`, diff --git a/www/manager6/window/PCIMapEdit.js b/www/manager6/resource-map/PCIMapEdit.js similarity index 99% rename from www/manager6/window/PCIMapEdit.js rename to www/manager6/resource-map/PCIMapEdit.js index faf58255..8146ebbd 100644 --- a/www/manager6/window/PCIMapEdit.js +++ b/www/manager6/resource-map/PCIMapEdit.js @@ -1,4 +1,4 @@ -Ext.define('PVE.window.PCIMapEditWindow', { +Ext.define('PVE.resource-map.PCIMapEditWindow', { extend: 'Proxmox.window.Edit', mixins: ['Proxmox.Mixin.CBind'], diff --git a/www/manager6/dc/PCIMapView.js b/www/manager6/resource-map/PCIMapView.js similarity index 96% rename from www/manager6/dc/PCIMapView.js rename to www/manager6/resource-map/PCIMapView.js index 80fe3c0f..c5b11f96 100644 --- a/www/manager6/dc/PCIMapView.js +++ b/www/manager6/resource-map/PCIMapView.js @@ -4,11 +4,11 @@ Ext.define('pve-resource-pci-tree', { fields: ['type', 'text', 'path', 'id', 'subsystem-id', 'iommugroup', 'description', 'digest'], }); -Ext.define('PVE.dc.PCIMapView', { +Ext.define('PVE.resource-map.PCIMapView', { extend: 'PVE.tree.ResourceMapTree', alias: 'widget.pveDcPCIMapView', - editWindowClass: 'PVE.window.PCIMapEditWindow', + editWindowClass: 'PVE.resource-map.PCIMapEditWindow', baseUrl: '/cluster/mapping/pci', mapIconCls: 'pve-itype-icon-pci', getStatusCheckUrl: (node) => `/nodes/${node}/hardware/pci?pci-class-blacklist=`, diff --git a/www/manager6/resource-map/ResourceMapView.js b/www/manager6/resource-map/ResourceMapView.js new file mode 100644 index 00000000..dcf2cc2d --- /dev/null +++ b/www/manager6/resource-map/ResourceMapView.js @@ -0,0 +1,23 @@ +Ext.define('PVE.resource-map.ResourceMapView', { + extend: 'Ext.tab.Panel', + alias: 'widget.pveResourceMapView', + online_help: 'resource_mapping', + + items: [ + { + xtype: 'pveDcPCIMapView', + title: gettext('PCI Devices'), + itemId: 'pci-map', + }, + { + xtype: 'pveDcUSBMapView', + title: gettext('USB Devices'), + itemId: 'usb-map', + }, + { + xtype: 'pveDcHWRNGMapView', + title: gettext('Hardware RNG Devices'), + itemId: 'hwrng-map', + }, + ], +}); diff --git a/www/manager6/window/USBMapEdit.js b/www/manager6/resource-map/USBMapEdit.js similarity index 99% rename from www/manager6/window/USBMapEdit.js rename to www/manager6/resource-map/USBMapEdit.js index 69a40026..6af0ad07 100644 --- a/www/manager6/window/USBMapEdit.js +++ b/www/manager6/resource-map/USBMapEdit.js @@ -1,4 +1,4 @@ -Ext.define('PVE.window.USBMapEditWindow', { +Ext.define('PVE.resource-map.USBMapEditWindow', { extend: 'Proxmox.window.Edit', mixins: ['Proxmox.Mixin.CBind'], diff --git a/www/manager6/dc/USBMapView.js b/www/manager6/resource-map/USBMapView.js similarity index 95% rename from www/manager6/dc/USBMapView.js rename to www/manager6/resource-map/USBMapView.js index 96edc587..551f9472 100644 --- a/www/manager6/dc/USBMapView.js +++ b/www/manager6/resource-map/USBMapView.js @@ -4,11 +4,11 @@ Ext.define('pve-resource-usb-tree', { fields: ['type', 'text', 'path', 'id', 'description', 'digest'], }); -Ext.define('PVE.dc.USBMapView', { +Ext.define('PVE.resource-map.USBMapView', { extend: 'PVE.tree.ResourceMapTree', alias: 'widget.pveDcUSBMapView', - editWindowClass: 'PVE.window.USBMapEditWindow', + editWindowClass: 'PVE.resource-map.USBMapEditWindow', baseUrl: '/cluster/mapping/usb', mapIconCls: 'fa fa-usb', getStatusCheckUrl: (node) => `/nodes/${node}/hardware/usb`, -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel