public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager v2] api/ui: include the node ha status in resources call and show as icon
@ 2024-11-13 11:32 Dominik Csapak
  2024-11-13 14:36 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2024-11-13 11:32 UTC (permalink / raw)
  To: pve-devel

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 blue wrench, as wrenches are associated with 'maintenance',
and because the state is different than 'online' and 'offline', but
don't make it yellow since it's not really a 'failure' state.

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>
---
changes from v1:
* make the wrench blue; and make it a little bigger so it's easier to see

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

diff --git a/PVE/API2/Cluster.pm b/PVE/API2/Cluster.pm
index c2a7a946..a0e5c11b 100644
--- a/PVE/API2/Cluster.pm
+++ b/PVE/API2/Cluster.pm
@@ -516,6 +516,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..975291f6 100644
--- a/www/css/ext6-pve.css
+++ b/www/css/ext6-pve.css
@@ -206,6 +206,16 @@
     font-size: 0.75em;
 }
 
+/* blue wrench */
+.x-tree-icon-custom.ha-maintenance:after,
+.x-grid-icon-custom.ha-maintenance:after {
+    content: "\f0ad";
+    color: #3892d4;
+    /* make it a little bigger since the icon is very small */
+    font-size: 14px;
+}
+
+
 /* yellow ! triangle */
 .x-tree-icon-custom.pending:after,
 .x-grid-icon-custom.pending:after,
-- 
2.39.5



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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH manager v2] api/ui: include the node ha status in resources call and show as icon
  2024-11-13 11:32 [pve-devel] [PATCH manager v2] api/ui: include the node ha status in resources call and show as icon Dominik Csapak
@ 2024-11-13 14:36 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2024-11-13 14:36 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominik Csapak

Am 13.11.24 um 12:32 schrieb Dominik Csapak:
> 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 blue wrench, as wrenches are associated with 'maintenance',
> and because the state is different than 'online' and 'offline', but
> don't make it yellow since it's not really a 'failure' state.
> 
> 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>
> ---
> changes from v1:
> * make the wrench blue; and make it a little bigger so it's easier to see
> 
>  PVE/API2/Cluster.pm  |  3 +++
>  www/css/ext6-pve.css | 10 ++++++++++
>  2 files changed, 13 insertions(+)
> 
>

applied, thanks!

Might be nice to also show the state as a tooltip, to allow users to
better correlate why this icon is shown.


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-13 14:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-13 11:32 [pve-devel] [PATCH manager v2] api/ui: include the node ha status in resources call and show as icon Dominik Csapak
2024-11-13 14:36 ` [pve-devel] applied: " Thomas Lamprecht

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