From c91602316bde171ee09921d32d58ce58c77b7515 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 13 Aug 2020 10:29:20 +0200 Subject: [PATCH] ui: syncjob: improve task text rendering to also have the correct icons for warnings and unknown tasks the text is here "ERROR: ..." now, so leave the 'Error' out Signed-off-by: Dominik Csapak --- www/config/SyncView.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/www/config/SyncView.js b/www/config/SyncView.js index 634977c4..94e40d03 100644 --- a/www/config/SyncView.js +++ b/www/config/SyncView.js @@ -107,11 +107,27 @@ Ext.define('PBS.config.SyncJobView', { return ''; } - if (value === 'OK') { - return ` ${gettext("OK")}`; + let parsed = Proxmox.Utils.parse_task_status(value); + let text = value; + let icon = ''; + switch (parsed) { + case 'unknown': + icon = 'question faded'; + text = Proxmox.Utils.unknownText; + break; + case 'error': + icon = 'times critical'; + text = Proxmox.Utils.errorText + ': ' + value; + break; + case 'warning': + icon = 'exclamation warning'; + break; + case 'ok': + icon = 'check good'; + text = gettext("OK"); } - return ` ${gettext("Error")}:${value}`; + return ` ${text}`; }, render_next_run: function(value, metadat, record) {