From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 1635992C32 for ; Wed, 14 Sep 2022 12:56:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 141CE2B1C9 for ; Wed, 14 Sep 2022 12:56:19 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Wed, 14 Sep 2022 12:56:18 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 04B5A44114 for ; Wed, 14 Sep 2022 12:50:53 +0200 (CEST) From: Matthias Heiserer To: pbs-devel@lists.proxmox.com Date: Wed, 14 Sep 2022 12:50:39 +0200 Message-Id: <20220914105039.186907-2-m.heiserer@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220914105039.186907-1-m.heiserer@proxmox.com> References: <20220914105039.186907-1-m.heiserer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.165 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pbs-devel] [PATCH proxmox-backup 2/2] prune-simulator: allow setting a time on which prune happens X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2022 10:56:19 -0000 In addition to the previous patch, this allows setting the time (hours/minutes) on which the pruning is simulated. Signed-off-by: Matthias Heiserer --- .../prune-simulator/prune-simulator_source.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/prune-simulator/prune-simulator_source.js b/docs/prune-simulator/prune-simulator_source.js index 137cf1b3..6ddbec0a 100644 --- a/docs/prune-simulator/prune-simulator_source.js +++ b/docs/prune-simulator/prune-simulator_source.js @@ -330,7 +330,10 @@ Ext.onReady(function() { let params = view.getValues(); + const time = view.lookup("currentTime").getValue(); NOW.setTime(Date.parse(params.currentDate)); + NOW.setHours(time.getHours()); + NOW.setMinutes(time.getMinutes()); let [hourSpec, minuteSpec] = params['schedule-time'].split(':'); @@ -458,9 +461,10 @@ Ext.onReady(function() { let weekday = parseInt(Ext.Date.format(daysDate, 'w'), 10); if (weekdayFlags[weekday]) { timesOnSingleDay.forEach(function(time) { - backups.push({ - backuptime: Ext.Date.subtract(new Date(time), Ext.Date.DAY, i), - }); + const backuptime = Ext.Date.subtract(new Date(time), Ext.Date.DAY, i); + if (backuptime < NOW) { + backups.push({ backuptime: backuptime }); + } }); } } @@ -726,6 +730,15 @@ Ext.onReady(function() { padding: '0 0 0 10', value: new Date(), }, + { + xtype: 'timefield', + name: 'currentTime', + reference: 'currentTime', + fieldLabel: 'Time of prune', + allowBlank: false, + padding: '0 0 0 10', + value: new Date(), + }, ], }, ], -- 2.30.2