From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] ui: hide bulk migrate options on standalone nodes
Date: Fri, 10 Nov 2023 11:05:53 +0100 [thread overview]
Message-ID: <20231110100553.2426835-1-d.csapak@proxmox.com> (raw)
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
next reply other threads:[~2023-11-10 10:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-10 10:05 Dominik Csapak [this message]
2023-11-12 17:12 ` 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=20231110100553.2426835-1-d.csapak@proxmox.com \
--to=d.csapak@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox