public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH widget-toolkit 1/2] Utils: add get_health_icon from PVE
@ 2021-07-02 10:48 Dominik Csapak
  2021-07-02 10:48 ` [pve-devel] [PATCH widget-toolkit 2/2] node/APTRepositories: rework top status and error grid Dominik Csapak
  2021-07-02 13:43 ` [pve-devel] applied: [PATCH widget-toolkit 1/2] Utils: add get_health_icon from PVE Thomas Lamprecht
  0 siblings, 2 replies; 4+ messages in thread
From: Dominik Csapak @ 2021-07-02 10:48 UTC (permalink / raw)
  To: pve-devel

we'll need it here too

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/Utils.js | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/src/Utils.js b/src/Utils.js
index bc602de..866cd83 100644
--- a/src/Utils.js
+++ b/src/Utils.js
@@ -1106,6 +1106,42 @@ utilities: {
 	container.updateLayout();
 	container.updateLayout();
     },
+
+    get_health_icon: function(state, circle) {
+	if (circle === undefined) {
+	    circle = false;
+	}
+
+	if (state === undefined) {
+	    state = 'uknown';
+	}
+
+	var icon = 'faded fa-question';
+	switch (state) {
+	    case 'good':
+		icon = 'good fa-check';
+		break;
+	    case 'upgrade':
+		icon = 'warning fa-upload';
+		break;
+	    case 'old':
+		icon = 'warning fa-refresh';
+		break;
+	    case 'warning':
+		icon = 'warning fa-exclamation';
+		break;
+	    case 'critical':
+		icon = 'critical fa-times';
+		break;
+	    default: break;
+	}
+
+	if (circle) {
+	    icon += '-circle';
+	}
+
+	return icon;
+    },
 },
 
     singleton: true,
-- 
2.30.2





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

end of thread, other threads:[~2021-07-02 13:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02 10:48 [pve-devel] [PATCH widget-toolkit 1/2] Utils: add get_health_icon from PVE Dominik Csapak
2021-07-02 10:48 ` [pve-devel] [PATCH widget-toolkit 2/2] node/APTRepositories: rework top status and error grid Dominik Csapak
2021-07-02 13:43   ` [pve-devel] applied: " Thomas Lamprecht
2021-07-02 13:43 ` [pve-devel] applied: [PATCH widget-toolkit 1/2] Utils: add get_health_icon from PVE 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