[pbs-devel] [PATCH proxmox-backup 1/2] prune-simulator: allow setting a date on which prune happens

Fiona Ebner f.ebner at proxmox.com
Fri Sep 16 12:08:23 CEST 2022


Nit: maybe use "allow setting a custom date" for the commit title. It
affects the simulated schedule too, not just pruning.

Am 14.09.22 um 12:50 schrieb Matthias Heiserer:
> With this applied, the prune simulator will be more flexible, which might clear
> up questions such as these:
> https://forum.proxmox.com/threads/pbs-prune-simulator-monthly-backups.115081
> 
> In order to have the configuration window not take up too much space,
> I added another column and moved the border slightly to the left, so the options
> part looks off-centered.
> 

For me, the right side of the time fields is cut off for both new
options (both in Firefox and Chromium).

> Signed-off-by: Matthias Heiserer <m.heiserer at proxmox.com>
> ---
>  .../prune-simulator/prune-simulator_source.js | 92 ++++++++++++-------
>  1 file changed, 58 insertions(+), 34 deletions(-)
> 
> diff --git a/docs/prune-simulator/prune-simulator_source.js b/docs/prune-simulator/prune-simulator_source.js
> index 84d3461c..137cf1b3 100644
> --- a/docs/prune-simulator/prune-simulator_source.js
> +++ b/docs/prune-simulator/prune-simulator_source.js
> @@ -330,6 +330,8 @@ Ext.onReady(function() {
>  
>  		let params = view.getValues();
>  
> +		NOW.setTime(Date.parse(params.currentDate));

NOW is currently declared as const and I guess it works, because it's a
Date object, but I'd rather just drop the variable and add a viewModel
entry instead. That also avoids a (I guess irrelevant in practice) race
between the "new Date()" calls for the two new timefields.

If it makes things easier, feel free to combine the patches into one.





More information about the pbs-devel mailing list