[pve-devel] [PATCH manager 1/3] gui: enable sorting of datacenter task log

Dominik Csapak d.csapak at proxmox.com
Fri Oct 5 10:19:21 CEST 2018


and not finished tasks after all others when sorting by endtime

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/dc/Tasks.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/www/manager6/dc/Tasks.js b/www/manager6/dc/Tasks.js
index e4d11d0d..b33ecbe3 100644
--- a/www/manager6/dc/Tasks.js
+++ b/www/manager6/dc/Tasks.js
@@ -65,7 +65,6 @@ Ext.define('PVE.dc.Tasks', {
 		    }
 		}
 	    },
-	    sortableColumns: false,
 	    columns: [
 		{ 
 		    header: gettext("Start Time"), 
@@ -79,6 +78,12 @@ Ext.define('PVE.dc.Tasks', {
 		    header: gettext("End Time"), 
 		    dataIndex: 'endtime',
 		    width: 150,
+		    sorter: {
+			sorterFn: function(a, b) {
+			    var running = !!a.data.pid - !!b.data.pid;
+			    return running || (a.data.endtime - b.data.endtime);
+			}
+		    },
 		    renderer: function(value, metaData, record) {
 			if (record.data.pid) {
 			    if (record.data.type == "vncproxy" || 
-- 
2.11.0





More information about the pve-devel mailing list