From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path:
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits))
(No client certificate requested)
by lists.proxmox.com (Postfix) with ESMTPS id E4ADAAF47
for ; Fri, 8 Sep 2023 15:19:29 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
by firstgate.proxmox.com (Proxmox) with ESMTP id C0CE7126FD
for ; Fri, 8 Sep 2023 15:18:59 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
[94.136.29.106])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits))
(No client certificate requested)
by firstgate.proxmox.com (Proxmox) with ESMTPS
for ; Fri, 8 Sep 2023 15:18:58 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
by proxmox-new.maurer-it.com (Proxmox) with ESMTP id E57934327C
for ; Fri, 8 Sep 2023 15:18:57 +0200 (CEST)
From: Philipp Hufnagl
To: pve-devel@lists.proxmox.com
Date: Fri, 8 Sep 2023 15:18:41 +0200
Message-Id: <20230908131841.991706-1-p.hufnagl@proxmox.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results: 0
AWL -0.003 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] ui: improve user experience for
vm/container transfer between pools
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Fri, 08 Sep 2023 13:19:29 -0000
After the implementation of fix #474, it has been suggested that
instead of requiring the user to click a checkbox allowing migration,
it should be allowed automatically and and a warning should be displayed
Further it has been discussed to rename the feature from "transfer" to
"migrate". However and API change would break already implemented usage
and so it has been decided to call it (for now) transfer everywhere to
Signed-off-by: Philipp Hufnagl
---
www/manager6/grid/PoolMembers.js | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/www/manager6/grid/PoolMembers.js b/www/manager6/grid/PoolMembers.js
index 224daca3..fe0de181 100644
--- a/www/manager6/grid/PoolMembers.js
+++ b/www/manager6/grid/PoolMembers.js
@@ -4,6 +4,10 @@ Ext.define('PVE.pool.AddVM', {
height: 420,
isAdd: true,
isCreate: true,
+ extraRequestParams: {
+ transfer: 1,
+ },
+
initComponent: function() {
var me = this;
@@ -35,6 +39,13 @@ Ext.define('PVE.pool.AddVM', {
],
});
+ let transferWarning = Ext.create('Ext.form.field.Display', {
+ userCls: 'pmx-hint',
+ value: gettext('Virtual guests are removed from current pools'),
+ hidden: true,
+ });
+
+
var vmGrid = Ext.create('widget.grid', {
store: vmStore,
border: true,
@@ -46,9 +57,15 @@ Ext.define('PVE.pool.AddVM', {
listeners: {
selectionchange: function(model, selected, opts) {
var selectedVms = [];
+ var isTransfer = false;
selected.forEach(function(vm) {
selectedVms.push(vm.data.vmid);
+ if (vm.data.pool?.length) {
+ isTransfer = true;
+ }
});
+ this.transfer.setValue(isTransfer);
+ transferWarning.setHidden(!isTransfer);
vmsField.setValue(selectedVms);
},
},
@@ -90,15 +107,10 @@ 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, transfer],
+ items: [vmsField, vmGrid, transferWarning, this.transfer],
});
me.callParent();
--
2.39.2