all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com, Aaron Lauterer <a.lauterer@proxmox.com>
Subject: Re: [pve-devel] [PATCH v6 manager 3/5] ui: lxc/qemu: add disk reassign and action submenu
Date: Thu, 7 Apr 2022 14:23:38 +0200	[thread overview]
Message-ID: <ac19c81a-1d27-d85e-28d6-1ec4e537bebf@proxmox.com> (raw)
In-Reply-To: <20220405123016.2911726-4-a.lauterer@proxmox.com>

Am 05.04.22 um 14:30 schrieb Aaron Lauterer:
> @@ -264,6 +303,7 @@ Ext.define('PVE.lxc.RessourceView', {
>  
>  	    var pending = rec.data.delete || me.hasPendingChanges(key);
>  	    var isDisk = rowdef.tdCls === 'pve-itype-icon-storage';

Pre-existing: this is very brittle and actually broke with commit
fa7980c2bd59612c5cdaa6c4e586b86d30b614c0
I sent a fix, and since there is another small issue and another nit,
see below, you probably want to wait for that and rebase on top for v7.

> +	    let isRootFS = rec.data.key === 'rootfs';
>  	    var isUnusedDisk = key.match(/^unused\d+/);
>  	    var isUsedDisk = isDisk && !isUnusedDisk;
>  

(...)

> diff --git a/www/manager6/qemu/HDReassign.js b/www/manager6/qemu/HDReassign.js
> new file mode 100644
> index 00000000..b6c67964
> --- /dev/null
> +++ b/www/manager6/qemu/HDReassign.js
> @@ -0,0 +1,272 @@
> +Ext.define('PVE.window.HDReassign', {
> +    extend: 'Proxmox.window.Edit',
> +    mixins: ['Proxmox.Mixin.CBind'],
> +
> +    resizable: false,
> +    modal: true,
> +    width: 350,
> +    border: false,
> +    layout: 'fit',
> +    showReset: false,
> +    showProgress: true,
> +    method: 'POST',
> +
> +    viewModel: {
> +	data: {
> +	    mpType: '',
> +	},
> +	formulas: {
> +	    mpMaxCount: get => get('mpType') === 'mp'
> +		? PVE.Utils.mp_counts.mps - 1

Should be .mp.
Or better, the whole expression could now be (untested)
    PVE.Utils.mp_counts[get('mpType')] - 1

> +		: PVE.Utils.mp_counts.unused - 1,
> +	},
> +    },
> +

(...)

> @@ -572,9 +609,15 @@ Ext.define('PVE.qemu.HardwareView', {
>  	    edit_btn.setDisabled(
>  	        deleted || !row.editor || isCloudInit || (isCDRom && !cdromCap) || (isDisk && !diskCap));
>  
> -	    resize_btn.setDisabled(pending || !isUsedDisk || !diskCap);
> -
> -	    move_btn.setDisabled(pending || !(isUsedDisk || isEfi || tpmMoveable) || !diskCap);
> +	    diskaction_btn.setDisabled(
> +		pending ||
> +		!diskCap ||
> +		isCloudInit ||
> +		!(isDisk || isEfi || tpmMoveable),
> +	    );
> +	    move_menuitem.setDisabled(isUnusedDisk);
> +	    reassign_menuitem.setDisabled(pending || (isEfi || tpmMoveable));
> +	    resize_menuitem.setDisabled(pending || !isUsedDisk);

Nit: pending can be dropped from the two expressions for the menu items,
because the whole menu is already disabled if pending is true.

>  
>  	    revert_btn.setDisabled(!pending);
>  	};




  reply	other threads:[~2022-04-07 12:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-05 12:30 [pve-devel] [PATCH v6 manager 0/5] ui: lxc/qemu: disk/volume action simplify menu items Aaron Lauterer
2022-04-05 12:30 ` [pve-devel] [PATCH v6 manager 1/5] ui: utils: refactor mps to mp Aaron Lauterer
2022-04-05 12:30 ` [pve-devel] [PATCH v6 manager 2/5] ui: utils: add nextFreeMP Aaron Lauterer
2022-04-07 12:30   ` Fabian Ebner
2022-04-05 12:30 ` [pve-devel] [PATCH v6 manager 3/5] ui: lxc/qemu: add disk reassign and action submenu Aaron Lauterer
2022-04-07 12:23   ` Fabian Ebner [this message]
2022-04-05 12:30 ` [pve-devel] [PATCH v6 manager 4/5] ui: BusTypeSelector: change noVirtIO to withVirtIO Aaron Lauterer
2022-04-05 12:30 ` [pve-devel] [PATCH v6 manager 5/5] ui: hdmove: modernize/refactor Aaron Lauterer
2022-04-07 12:28 ` [pve-devel] [PATCH v6 manager 0/5] ui: lxc/qemu: disk/volume action simplify menu items Fabian Ebner
2022-04-11 10:06 ` [pve-devel] applied-series: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac19c81a-1d27-d85e-28d6-1ec4e537bebf@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=a.lauterer@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal