[pbs-devel] [PATCH widget-toolkit 1/6] tasks: add warningsText

Fabian Ebner f.ebner at proxmox.com
Fri Mar 12 13:53:24 CET 2021


to avoid having capitalized 'WARNINGS' (especially since 'Error' is not) and
support different languages.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 src/Utils.js      | 1 +
 src/node/Tasks.js | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/Utils.js b/src/Utils.js
index af5f1db..229e6f5 100644
--- a/src/Utils.js
+++ b/src/Utils.js
@@ -48,6 +48,7 @@ utilities: {
     noneText: gettext('none'),
     NoneText: gettext('None'),
     errorText: gettext('Error'),
+    warningsText: gettext('Warnings'),
     unknownText: gettext('Unknown'),
     defaultText: gettext('Default'),
     daysText: gettext('days'),
diff --git a/src/node/Tasks.js b/src/node/Tasks.js
index 1f01b07..b01f65e 100644
--- a/src/node/Tasks.js
+++ b/src/node/Tasks.js
@@ -202,8 +202,9 @@ Ext.define('Proxmox.node.Tasks', {
 			switch (parsed) {
 			    case 'unknown': return Proxmox.Utils.unknownText;
 			    case 'error': return Proxmox.Utils.errorText + ': ' + value;
+			    case 'warning': return Proxmox.Utils.warningsText +
+				value.replace('WARNINGS', '');
 			    case 'ok': // fall-through
-			    case 'warning': // fall-through
 			    default: return value;
 			}
 		    },
-- 
2.20.1






More information about the pbs-devel mailing list