From 40ff84b138bb7127ecc05a2f587cca4e7a917810 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Mon, 30 Aug 2021 10:30:09 +0200 Subject: [PATCH] ui: fix order of prune keep reasons two things wrong with the old code: * the sort function wants -1, 0 and 1 as a return value for ab respectively, not a bool (which a < b returns) * we have to sort the newest backups first, since the first reason is 'keep-last'. until now, we sorted the oldest backup first, resulting in the older backups getting the 'keep-last' reason reported by a user in the forum: https://forum.proxmox.com/threads/prune-ui-and-prune-schedule-simulator-dont-match.94944/ Signed-off-by: Dominik Csapak --- www/datastore/Prune.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/datastore/Prune.js b/www/datastore/Prune.js index 3e74269f..42ea21bf 100644 --- a/www/datastore/Prune.js +++ b/www/datastore/Prune.js @@ -86,7 +86,7 @@ Ext.define('PBS.Datastore.PruneInputPanel', { let counter = {}; backups.sort(function(a, b) { - return a["backup-time"] < b["backup-time"]; + return b["backup-time"] - a["backup-time"]; }); let ruleIndex = -1;