[pve-devel] [PATCH manager v2 2/2] fix #4678: ui: don't sort storage backup content by vmid by default

Dominik Csapak d.csapak at proxmox.com
Tue Apr 25 09:21:28 CEST 2023


instead, add the vmid as extra column, so that the user can still sort
by vmid if they wish to

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
changes from v1:
* fallback to vmid 0 if there was none from the api, that way entries
  without a vmid will be sorted before the rest, otherwise they would
  not be sorted at all

 www/manager6/storage/BackupView.js | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/www/manager6/storage/BackupView.js b/www/manager6/storage/BackupView.js
index e0921f4f5..bdaf85c8d 100644
--- a/www/manager6/storage/BackupView.js
+++ b/www/manager6/storage/BackupView.js
@@ -222,14 +222,17 @@ Ext.define('PVE.storage.BackupView', {
 	    };
 	}
 
+	me.extraColumns.vmid = {
+	    header: gettext('VMID'),
+	    dataIndex: 'vmid',
+	    hidden: true,
+	    sorter: (a, b) => (a.data.vmid ?? 0) - (b.data.vmid ?? 0),
+	};
+
 	me.callParent();
 
 	me.store.getSorters().clear();
 	me.store.setSorters([
-	    {
-		property: 'vmid',
-		direction: 'ASC',
-	    },
 	    {
 		property: 'vdate',
 		direction: 'DESC',
-- 
2.30.2






More information about the pve-devel mailing list