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

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Oct 5 11:54:31 CEST 2018


On 10/5/18 10:19 AM, Dominik Csapak wrote:
> 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" || 
> 

The description column sorting does not really work.

Also, a running task does not moves when sorting by status, i.e.,
it stays in the mid of "OK" task for example. I'd expected that it
is in it's own "group".




More information about the pve-devel mailing list