From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit 1/2] Utils: add get_health_icon from PVE
Date: Fri, 2 Jul 2021 12:48:58 +0200 [thread overview]
Message-ID: <20210702104859.3515832-1-d.csapak@proxmox.com> (raw)
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
next reply other threads:[~2021-07-02 10:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-02 10:48 Dominik Csapak [this message]
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
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=20210702104859.3515832-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