ui: dashboard/TaskSummary: fade icons if count is zero

so that users can see the relevant counts faster

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-07-09 16:11:51 +02:00 committed by Thomas Lamprecht
parent 106603c58f
commit be30e7d269
1 changed files with 18 additions and 3 deletions

View File

@ -9,12 +9,27 @@ Ext.define('PBS.TaskSummary', {
render_count: function(value, md, record, rowindex, colindex) { render_count: function(value, md, record, rowindex, colindex) {
let cls = 'question'; let cls = 'question';
let color = 'faded';
switch (colindex) { switch (colindex) {
case 1: cls = "times-circle critical"; break; case 1:
case 2: cls = "exclamation-circle warning"; break; cls = "times-circle";
case 3: cls = "check-circle good"; break; color = "critical";
break;
case 2:
cls = "exclamation-circle";
color = "warning";
break;
case 3:
cls = "check-circle";
color = "good";
break;
default: break; default: break;
} }
if (value < 1) {
color = "faded";
}
cls += " " + color;
return `<i class="fa fa-${cls}"></i> ${value}`; return `<i class="fa fa-${cls}"></i> ${value}`;
}, },
}, },