From: Dominik Csapak Date: Thu, 25 Jun 2020 11:59:30 +0000 (+0200) Subject: Utils: add render_zfs_health X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=f29e6a669e2f3956d76f46827509f6eba0a1e87f;p=proxmox-widget-toolkit.git Utils: add render_zfs_health from pve-manager Signed-off-by: Dominik Csapak --- diff --git a/src/Utils.js b/src/Utils.js index b5b1acb..d959dee 100644 --- a/src/Utils.js +++ b/src/Utils.js @@ -740,6 +740,31 @@ utilities: { return Ext.Date.format(servertime, 'Y-m-d H:i:s'); }, + render_zfs_health: function(value) { + if (typeof value === 'undefined') { + return ""; + } + var iconCls = 'question-circle'; + switch (value) { + case 'AVAIL': + case 'ONLINE': + iconCls = 'check-circle good'; + break; + case 'REMOVED': + case 'DEGRADED': + iconCls = 'exclamation-circle warning'; + break; + case 'UNAVAIL': + case 'FAULTED': + case 'OFFLINE': + iconCls = 'times-circle critical'; + break; + default: //unknown + } + + return ' ' + value; + }, + get_help_info: function(section) { let helpMap; if (typeof proxmoxOnlineHelpInfo !== 'undefined') {