public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [RFC PATCH manager] api/ui: include the node ha status in resources call and show as icon
Date: Fri, 31 May 2024 10:07:03 +0200	[thread overview]
Message-ID: <20240531080703.880174-1-d.csapak@proxmox.com> (raw)

we already have the information parsed, so it's cheap, and we already
have a mechanism in place that adds 'ha-<hastate>' as a css class, so
let's reuse that.

I chose a yellow wrench, as wrenches are associated with 'maintenance',
and because the state warrants more notice than 'online' but less than
'offline'.

Users mentioned in the forum that this would be nice:
https://forum.proxmox.com/threads/125768/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
not sure about the color, since the yellow has relatively low contrast
in the light mode (in dark mode it's fine). It's the same yellow as for
'io-errors' though.

 PVE/API2/Cluster.pm  | 3 +++
 www/css/ext6-pve.css | 8 ++++++++
 2 files changed, 11 insertions(+)

diff --git a/PVE/API2/Cluster.pm b/PVE/API2/Cluster.pm
index 04387ab4..4fc838be 100644
--- a/PVE/API2/Cluster.pm
+++ b/PVE/API2/Cluster.pm
@@ -463,6 +463,9 @@ __PACKAGE__->register_method({
 		if (defined(my $mode = $info->{'cgroup-mode'})) {
 		    $entry->{'cgroup-mode'} = int($mode);
 		}
+		if (defined(my $status = $hastatus->{node_status}->{$node})) {
+		    $entry->{'hastate'} = $status;
+		}
 
 		push @$res, $entry;
 	    }
diff --git a/www/css/ext6-pve.css b/www/css/ext6-pve.css
index b5a3683a..83580afb 100644
--- a/www/css/ext6-pve.css
+++ b/www/css/ext6-pve.css
@@ -206,6 +206,14 @@
     font-size: 0.75em;
 }
 
+/* yellow wrench */
+.x-tree-icon-custom.ha-maintenance:after,
+.x-grid-icon-custom.ha-maintenance:after {
+    content: "\f0ad";
+    color: #FFCC00;
+}
+
+
 /* yellow ! triangle */
 .x-tree-icon-custom.pending:after,
 .x-grid-icon-custom.pending:after,
-- 
2.39.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


             reply	other threads:[~2024-05-31  8:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31  8:07 Dominik Csapak [this message]
2024-05-31 10:07 ` Dominik Csapak

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=20240531080703.880174-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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal