public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 1/2] backup views: sort backups by vmid, then descending by date
Date: Tue,  7 Dec 2021 14:08:43 +0100	[thread overview]
Message-ID: <20211207130844.96239-1-f.ebner@proxmox.com> (raw)

to have the most recent ones first, while keeping backups from the
same guest together.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 www/manager6/grid/BackupView.js    | 14 ++++++++++----
 www/manager6/storage/BackupView.js | 12 ++++++++++++
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/www/manager6/grid/BackupView.js b/www/manager6/grid/BackupView.js
index ffa7d251..7f7e1b62 100644
--- a/www/manager6/grid/BackupView.js
+++ b/www/manager6/grid/BackupView.js
@@ -54,10 +54,16 @@ Ext.define('PVE.grid.BackupView', {
 
 	me.store = Ext.create('Ext.data.Store', {
 	    model: 'pve-storage-content',
-	    sorters: {
-		property: 'volid',
-		order: 'DESC',
-	    },
+	    sorters: [
+		{
+		    property: 'vmid',
+		    direction: 'ASC',
+		},
+		{
+		    property: 'vdate',
+		    direction: 'DESC',
+		},
+	    ],
 	    filters: [
 	        vmtypeFilter,
 		searchFilter,
diff --git a/www/manager6/storage/BackupView.js b/www/manager6/storage/BackupView.js
index dca140fe..2328c0fc 100644
--- a/www/manager6/storage/BackupView.js
+++ b/www/manager6/storage/BackupView.js
@@ -207,5 +207,17 @@ Ext.define('PVE.storage.BackupView', {
 	}
 
 	me.callParent();
+
+	me.store.getSorters().clear();
+	me.store.setSorters([
+	    {
+		property: 'vmid',
+		direction: 'ASC',
+	    },
+	    {
+		property: 'vdate',
+		direction: 'DESC',
+	    },
+	]);
     },
 });
-- 
2.30.2





             reply	other threads:[~2021-12-07 13:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-07 13:08 Fabian Ebner [this message]
2021-12-07 13:08 ` [pve-devel] [PATCH manager 2/2] sorters: use correct property 'direction' and keep default 'ASC' Fabian Ebner
2021-12-16  9:14   ` [pve-devel] applied: " Dominik Csapak
2021-12-15 15:03 ` [pve-devel] applied: [PATCH manager 1/2] backup views: sort backups by vmid, then descending by date 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=20211207130844.96239-1-f.ebner@proxmox.com \
    --to=f.ebner@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal