]> git.proxmox.com Git - proxmox-widget-toolkit.git/blobdiff - src/Utils.js
css: add centered-flex-column class
[proxmox-widget-toolkit.git] / src / Utils.js
index b617c4bb31d4b7e6350ba57210561b3f20facf17..d033fc54c0d6038852f3c640b05f40e56bc53c3f 100644 (file)
@@ -1140,6 +1140,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,