[pve-devel] [PATCH manager v2 2/2] fix #474: backend allow transfer from container/vms

Philipp Hufnagl p.hufnagl at proxmox.com
Wed Aug 9 16:36:33 CEST 2023


When a member of 2 pools wants to transfer a
 vm/container to an other pool they can not do that. The vm/container would
 have first to be removed form the current pool resulting in a loss of
 privileges of the pool member for this vm/contianer. This feature introduces
 a way to transfer a vm between pools, guarded by a checkbox from accidental
 transfers

 This is the patch for the frontend changes

Signed-off-by: Philipp Hufnagl <p.hufnagl at proxmox.com>
---
 www/manager6/grid/PoolMembers.js | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/www/manager6/grid/PoolMembers.js b/www/manager6/grid/PoolMembers.js
index 6acb622d..224daca3 100644
--- a/www/manager6/grid/PoolMembers.js
+++ b/www/manager6/grid/PoolMembers.js
@@ -1,7 +1,7 @@
 Ext.define('PVE.pool.AddVM', {
     extend: 'Proxmox.window.Edit',
     width: 600,
-    height: 400,
+    height: 420,
     isAdd: true,
     isCreate: true,
     initComponent: function() {
@@ -30,7 +30,7 @@ Ext.define('PVE.pool.AddVM', {
 	    ],
 	    filters: [
 		function(item) {
-		    return (item.data.type === 'lxc' || item.data.type === 'qemu') && item.data.pool === '';
+		    return (item.data.type === 'lxc' || item.data.type === 'qemu') &&item.data.pool !== me.pool;
 		},
 	    ],
 	});
@@ -63,6 +63,10 @@ Ext.define('PVE.pool.AddVM', {
 		    header: gettext('Node'),
 		    dataIndex: 'node',
 		},
+		{
+		    header: gettext('Pool'),
+		    dataIndex: 'pool',
+		},
 		{
 		    header: gettext('Status'),
 		    dataIndex: 'uptime',
@@ -85,9 +89,16 @@ Ext.define('PVE.pool.AddVM', {
 		},
 	    ],
 	});
+
+	let transfer = Ext.create('Ext.form.field.Checkbox', {
+	    name: 'transfer',
+	    boxLabel: gettext('Allow Transfer'),
+	    inputValue: 1,
+	    value: 0,
+	});
 	Ext.apply(me, {
 	    subject: gettext('Virtual Machine'),
-	    items: [vmsField, vmGrid],
+	    items: [vmsField, vmGrid, transfer],
 	});
 
 	me.callParent();
-- 
2.39.2






More information about the pve-devel mailing list