[pve-devel] [PATCH manager] ui: hide bulk migrate options on standalone nodes

Thomas Lamprecht t.lamprecht at proxmox.com
Sun Nov 12 18:12:11 CET 2023


Am 10/11/2023 um 11:05 schrieb Dominik Csapak:
> since there is nowhere to migrate to and we hide the regular migrate
> buttons/options too.
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  www/manager6/node/CmdMenu.js | 5 +++++
>  www/manager6/node/Config.js  | 2 ++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/www/manager6/node/CmdMenu.js b/www/manager6/node/CmdMenu.js
> index dc56ef08..f5f9fae3 100644
> --- a/www/manager6/node/CmdMenu.js
> +++ b/www/manager6/node/CmdMenu.js
> @@ -139,5 +139,10 @@ Ext.define('PVE.node.CmdMenu', {
>  	if (me.pveSelNode.data.running) {
>  	    me.getComponent('wakeonlan').setDisabled(true);
>  	}
> +
> +	let standalone = PVE.data.ResourceStore.getNodes().length < 2;

We have that quite a few times already, sometimes also the negation,
i.e., length > 1.

let's move this into a helper, while I do not like it existence PVE.Utils
could be OK for here (I mean, what isn't a util...) but maybe you got a
better idea.





More information about the pve-devel mailing list