From: Fabian Ebner <f.ebner@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-gui 2/2] dashboard: hide cluster resources if it's a single node
Date: Tue, 13 Jul 2021 14:26:10 +0200 [thread overview]
Message-ID: <20210713122610.72675-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20210713122610.72675-1-f.ebner@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
Not sure about initially hiding or not. To avoid the component jumping
in (if initially hidden and it is a cluster) or out (if initially
visible and it is not a cluster), we'd need to wait for the cluster
status to load before rendering...
js/Dashboard.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/js/Dashboard.js b/js/Dashboard.js
index 79817b3..8f08f8c 100644
--- a/js/Dashboard.js
+++ b/js/Dashboard.js
@@ -142,6 +142,9 @@ Ext.define('PMG.Dashboard', {
me.lookup('nodeInfo').setSubscriptionStatus(subStatus);
+ // the node info already displays this information in case there is no cluster
+ me.lookup('clusterResources').setHidden(records.length === 1);
+
cpu = cpu/count;
mem = mem/count;
hd = hd/count;
@@ -412,6 +415,8 @@ Ext.define('PMG.Dashboard', {
height: 250,
iconCls: 'fa fa-tasks',
title: gettext('Cluster Resources (average)'),
+ reference: 'clusterResources',
+ hidden: true,
bodyPadding: '0 20 0 20',
layout: {
type: 'hbox',
--
2.30.2
prev parent reply other threads:[~2021-07-13 12:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-13 12:26 [pmg-devel] [PATCH pmg-gui 1/2] dashboard: add node info panel Fabian Ebner
2021-07-13 12:26 ` Fabian Ebner [this message]
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=20210713122610.72675-2-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pmg-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