[pve-devel] [PATCH v2 manager 5/7] ui: cluster task log: handle warnings like the node task log does

Fabian Ebner f.ebner at proxmox.com
Fri Apr 9 10:44:34 CEST 2021


Copied the relevant code from widget-toolkit.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

Dependency bump for widget-toolkit is needed.

Changes from v1:
    * use new helper

 www/manager6/dc/Tasks.js | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/www/manager6/dc/Tasks.js b/www/manager6/dc/Tasks.js
index c5075dc3..2ecd61ee 100644
--- a/www/manager6/dc/Tasks.js
+++ b/www/manager6/dc/Tasks.js
@@ -61,9 +61,15 @@ Ext.define('PVE.dc.Tasks', {
 		getRowClass: function(record, index) {
 		    var status = record.get('status');
 
-		    if (status && status != 'OK') {
-			return "proxmox-invalid-row";
+		    if (status) {
+			let parsed = Proxmox.Utils.parse_task_status(status);
+			if (parsed === 'error') {
+			    return "proxmox-invalid-row";
+			} else if (parsed === 'warning') {
+			    return "proxmox-warning-row";
+			}
 		    }
+		    return '';
 		},
 	    },
 	    sortableColumns: false,
@@ -122,11 +128,8 @@ Ext.define('PVE.dc.Tasks', {
 			    }
 			    return "";
 			}
-			if (value == 'OK') {
-			    return 'OK';
-			}
-			// metaData.attr = 'style="color:red;"';
-			return Proxmox.Utils.errorText + ': ' + value;
+
+			return Proxmox.Utils.format_task_status(value);
 		    },
 		},
 	    ],
-- 
2.20.1






More information about the pve-devel mailing list