]> git.proxmox.com Git - proxmox-backup.git/commitdiff
ui: syncjob: improve task text rendering
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 13 Aug 2020 08:29:20 +0000 (10:29 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 13 Aug 2020 09:51:35 +0000 (11:51 +0200)
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 <d.csapak@proxmox.com>
www/config/SyncView.js

index 634977c4a6a8a1f83302bcd7a708b74e2177ed90..94e40d0373cc53ce708985d9a5351efe1ed292fc 100644 (file)
@@ -107,11 +107,27 @@ Ext.define('PBS.config.SyncJobView', {
                return '';
            }
 
-           if (value === 'OK') {
-               return `<i class="fa fa-check good"></i> ${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 `<i class="fa fa-times critical"></i> ${gettext("Error")}:${value}`;
+           return `<i class="fa fa-${icon}"></i> ${text}`;
        },
 
        render_next_run: function(value, metadat, record) {