* [pve-devel] [PATCH manager] ui: hide bulk migrate options on standalone nodes
@ 2023-11-10 10:05 Dominik Csapak
2023-11-12 17:12 ` Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2023-11-10 10:05 UTC (permalink / raw)
To: pve-devel
since there is nowhere to migrate to and we hide the regular migrate
buttons/options too.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
| 5 +++++
www/manager6/node/Config.js | 2 ++
2 files changed, 7 insertions(+)
--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;
+ if (standalone) {
+ me.getComponent('bulkmigrate').setVisible(false);
+ }
},
});
diff --git a/www/manager6/node/Config.js b/www/manager6/node/Config.js
index 6ed2172a..00a0e713 100644
--- a/www/manager6/node/Config.js
+++ b/www/manager6/node/Config.js
@@ -11,6 +11,7 @@ Ext.define('PVE.node.Config', {
if (!nodename) {
throw "no node name specified";
}
+ let standalone = PVE.data.ResourceStore.getNodes().length < 2;
var caps = Ext.state.Manager.get('GuiCap');
@@ -69,6 +70,7 @@ Ext.define('PVE.node.Config', {
text: gettext('Bulk Migrate'),
iconCls: 'fa fa-fw fa-send-o',
disabled: !caps.vms['VM.Migrate'],
+ hidden: standalone,
handler: function() {
Ext.create('PVE.window.BulkAction', {
autoShow: true,
--
2.30.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [pve-devel] [PATCH manager] ui: hide bulk migrate options on standalone nodes
2023-11-10 10:05 [pve-devel] [PATCH manager] ui: hide bulk migrate options on standalone nodes Dominik Csapak
@ 2023-11-12 17:12 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-11-12 17:12 UTC (permalink / raw)
To: Proxmox VE development discussion, Dominik Csapak
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@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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-12 17:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-10 10:05 [pve-devel] [PATCH manager] ui: hide bulk migrate options on standalone nodes Dominik Csapak
2023-11-12 17:12 ` Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox