[pbs-devel] [PATCH proxmox-backup v2 8/9] ui: syncjob: improve task text rendering
Dominik Csapak
d.csapak at proxmox.com
Tue Aug 11 11:57:23 CEST 2020
to also have the correct icons for warnings and unknown tasks
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
changes from v1:
* do not drop the 'error text' but extend it for other states
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..418318bd 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 `<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 = Promxox.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) {
--
2.20.1
More information about the pbs-devel
mailing list