* [pve-devel] [PATCH manager v2] ui: improve user experience for vm/container transfer between pools
@ 2023-09-08 11:56 Philipp Hufnagl
2023-09-08 13:00 ` Philipp Hufnagl
0 siblings, 1 reply; 2+ messages in thread
From: Philipp Hufnagl @ 2023-09-08 11:56 UTC (permalink / raw)
To: pve-devel
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 <p.hufnagl@proxmox.com>
modified: www/manager6/grid/PoolMembers.js
---
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..607042e8 100644
--- a/www/manager6/grid/PoolMembers.js
+++ b/www/manager6/grid/PoolMembers.js
@@ -4,7 +4,11 @@ Ext.define('PVE.pool.AddVM', {
height: 420,
isAdd: true,
isCreate: true,
+ extraRequestParams: {
+ transfer: 1,
+ }
initComponent: function() {
+
var me = this;
if (!me.pool) {
@@ -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;
+ }
});
+ 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, transfer],
});
me.callParent();
--
2.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [pve-devel] [PATCH manager v2] ui: improve user experience for vm/container transfer between pools
2023-09-08 11:56 [pve-devel] [PATCH manager v2] ui: improve user experience for vm/container transfer between pools Philipp Hufnagl
@ 2023-09-08 13:00 ` Philipp Hufnagl
0 siblings, 0 replies; 2+ messages in thread
From: Philipp Hufnagl @ 2023-09-08 13:00 UTC (permalink / raw)
To: pve-devel
Please dont merge. It appers i made an error at testing
On 9/8/23 13:56, Philipp Hufnagl wrote:
> 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 <p.hufnagl@proxmox.com>
>
> modified: www/manager6/grid/PoolMembers.js
> ---
> 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..607042e8 100644
> --- a/www/manager6/grid/PoolMembers.js
> +++ b/www/manager6/grid/PoolMembers.js
> @@ -4,7 +4,11 @@ Ext.define('PVE.pool.AddVM', {
> height: 420,
> isAdd: true,
> isCreate: true,
> + extraRequestParams: {
> + transfer: 1,
> + }
> initComponent: function() {
> +
> var me = this;
>
> if (!me.pool) {
> @@ -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;
> + }
> });
> + 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, transfer],
> });
>
> me.callParent();
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-08 13:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-08 11:56 [pve-devel] [PATCH manager v2] ui: improve user experience for vm/container transfer between pools Philipp Hufnagl
2023-09-08 13:00 ` Philipp Hufnagl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox