From: Matthias Heiserer <m.heiserer@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/2] prune-simulator: allow setting a date on which prune happens
Date: Wed, 14 Sep 2022 12:50:38 +0200 [thread overview]
Message-ID: <20220914105039.186907-1-m.heiserer@proxmox.com> (raw)
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.
Signed-off-by: Matthias Heiserer <m.heiserer@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));
+
let [hourSpec, minuteSpec] = params['schedule-time'].split(':');
if (!hourSpec || !minuteSpec) {
@@ -661,48 +663,70 @@ Ext.onReady(function() {
{ xtype: "panel", width: 1, border: 1 },
{
xtype: 'form',
- layout: 'anchor',
- flex: 1,
+ layout: 'hbox',
+ flex: 1.2,
border: false,
title: 'Simulated Backup Schedule',
defaults: {
- labelWidth: 120,
+ defaults: {
+ labelWidth: 120,
+ },
},
bodyPadding: 10,
items: [
{
- xtype: 'prunesimulatorDayOfWeekSelector',
- name: 'schedule-weekdays',
- fieldLabel: 'Day of week',
- value: ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'],
- allowBlank: false,
- multiSelect: true,
- padding: '0 0 0 10',
+ xtype: 'container',
+ layout: 'anchor',
+ items: [
+ {
+ xtype: 'prunesimulatorDayOfWeekSelector',
+ name: 'schedule-weekdays',
+ fieldLabel: 'Day of week',
+ value: ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'],
+ allowBlank: false,
+ multiSelect: true,
+ padding: '0 0 0 10',
+ },
+ {
+ xtype: 'prunesimulatorCalendarEvent',
+ name: 'schedule-time',
+ allowBlank: false,
+ value: '0/6:00',
+ fieldLabel: 'Backup schedule',
+ padding: '0 0 0 10',
+ },
+ {
+ xtype: 'numberfield',
+ name: 'numberOfWeeks',
+ allowBlank: false,
+ fieldLabel: 'Number of weeks',
+ minValue: 1,
+ value: 15,
+ maxValue: 260, // five years
+ padding: '0 0 0 10',
+ },
+ {
+ xtype: 'button',
+ name: 'schedule-button',
+ text: 'Update Schedule',
+ formBind: true,
+ handler: 'reloadFull',
+ },
+ ],
},
{
- xtype: 'prunesimulatorCalendarEvent',
- name: 'schedule-time',
- allowBlank: false,
- value: '0/6:00',
- fieldLabel: 'Backup schedule',
- padding: '0 0 0 10',
- },
- {
- xtype: 'numberfield',
- name: 'numberOfWeeks',
- allowBlank: false,
- fieldLabel: 'Number of weeks',
- minValue: 1,
- value: 15,
- maxValue: 260, // five years
- padding: '0 0 0 10',
- },
- {
- xtype: 'button',
- name: 'schedule-button',
- text: 'Update Schedule',
- formBind: true,
- handler: 'reloadFull',
+ xtype: 'container',
+ layout: 'anchor',
+ items: [
+ {
+ xtype: 'datefield',
+ name: 'currentDate',
+ fieldLabel: 'Today',
+ allowBlank: false,
+ padding: '0 0 0 10',
+ value: new Date(),
+ },
+ ],
},
],
},
@@ -734,7 +758,7 @@ Ext.onReady(function() {
xtype: 'prunesimulatorPruneList',
store: me.pruneStore,
reference: 'pruneList',
- flex: 1,
+ flex: 1.2,
},
],
},
--
2.30.2
next reply other threads:[~2022-09-14 10:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-14 10:50 Matthias Heiserer [this message]
2022-09-14 10:50 ` [pbs-devel] [PATCH proxmox-backup 2/2] prune-simulator: allow setting a time " Matthias Heiserer
2022-09-16 10:08 ` Fiona Ebner
2022-09-19 10:24 ` Matthias Heiserer
2022-09-16 10:08 ` [pbs-devel] [PATCH proxmox-backup 1/2] prune-simulator: allow setting a date " Fiona Ebner
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=20220914105039.186907-1-m.heiserer@proxmox.com \
--to=m.heiserer@proxmox.com \
--cc=pbs-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