]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/Utils.js
refactor health icons
[pve-manager.git] / www / manager6 / Utils.js
index c824b97745d3b540e04ef5bc739a543cb47fa783..f86eea81f0dd69d2680e4c19678e8a9e7562eaaf 100644 (file)
@@ -69,6 +69,36 @@ Ext.define('PVE.Utils', { utilities: {
        solaris: 'Solaris Kernel'
     },
 
+    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 'warning':
+               icon = 'warning fa-exclamation';
+               break;
+           case 'critical':
+               icon = 'critical fa-times';
+               break;
+           default: break;
+       }
+
+       if (circle) {
+           icon += '-circle';
+       }
+
+       return icon;
+    },
+
     render_kvm_ostype: function (value) {
        if (!value) {
            return gettext('Other OS types');