Utils: add render_zfs_health

from pve-manager

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-06-25 13:59:30 +02:00 committed by Thomas Lamprecht
parent 2c3e308ceb
commit f29e6a669e

View File

@ -740,6 +740,31 @@ utilities: {
return Ext.Date.format(servertime, 'Y-m-d H:i:s'); 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 '<i class="fa fa-' + iconCls + '"></i> ' + value;
},
get_help_info: function(section) { get_help_info: function(section) {
let helpMap; let helpMap;
if (typeof proxmoxOnlineHelpInfo !== 'undefined') { if (typeof proxmoxOnlineHelpInfo !== 'undefined') {