all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager v2 2/2] fix #4678: ui: don't sort storage backup content by vmid by default
Date: Tue, 25 Apr 2023 09:21:28 +0200	[thread overview]
Message-ID: <20230425072128.566363-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20230425072128.566363-1-d.csapak@proxmox.com>

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@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





  reply	other threads:[~2023-04-25  7:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25  7:21 [pve-devel] [PATCH manager v2 1/2] ui: storage: backup: refactor extraColumns assignment Dominik Csapak
2023-04-25  7:21 ` Dominik Csapak [this message]
2023-06-06 17:23 ` [pve-devel] applied-series: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230425072128.566363-2-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal