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 3/6] ui: prune edit: prepare for being re-used for backup jobs
Date: Mon,  6 Sep 2021 13:32:28 +0200	[thread overview]
Message-ID: <20210906113231.61790-4-f.ebner@proxmox.com> (raw)
In-Reply-To: <20210906113231.61790-1-f.ebner@proxmox.com>

1. Rename the isPBS variable to match the actual purpose. When editing
a backup job, the hint should not be shown, even if the storage is
PBS.

2. Allow specifying the text used for the fallback hint. For backup
jobs, the first fallback is the storage configuration, so the text
needs to be different there.

3. Make using keep-all=1 by default upon creation optional. For backup
jobs, the default should be "use fallback", i.e. no settings.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 www/manager6/panel/EditPruneInputPanel.js | 10 ++++++----
 www/manager6/storage/Base.js              |  4 +++-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/www/manager6/panel/EditPruneInputPanel.js b/www/manager6/panel/EditPruneInputPanel.js
index d58db208..547daecc 100644
--- a/www/manager6/panel/EditPruneInputPanel.js
+++ b/www/manager6/panel/EditPruneInputPanel.js
@@ -13,7 +13,7 @@ Ext.define('PVE.panel.EditPruneInputPanel', {
 	if (this.needMask) { // isMasked() may not yet be true if not rendered once
 	    return {};
 	} else if (this.isCreate && !this.rendered) {
-	    return { 'prune-backups': 'keep-all=1' };
+	    return this.keepAllDefaultForCreate ? { 'prune-backups': 'keep-all=1' } : {};
 	}
 	delete formValues.delete;
 	let retention = PVE.Parser.printPropertyString(formValues);
@@ -52,10 +52,10 @@ Ext.define('PVE.panel.EditPruneInputPanel', {
 		panel.mask(
 		    gettext('Backup content type not available for this storage.'),
 		);
-	    } else if (panel.isCreate) {
+	    } else if (panel.isCreate && panel.keepAllDefaultForCreate) {
 		panel.down('proxmoxcheckbox[name=keep-all]').setValue(true);
 	    }
-	    panel.down('component[name=pbs-hint]').setHidden(!panel.isPBS);
+	    panel.down('component[name=pbs-hint]').setHidden(!panel.showPBSHint);
 
 	    panel.query('pmxPruneKeepField').forEach(field => {
 		field.on('change', panel.updateComponents, panel);
@@ -83,7 +83,9 @@ Ext.define('PVE.panel.EditPruneInputPanel', {
 	    name: 'no-keeps-hint',
 	    hidden: true,
 	    padding: '5 1',
-	    html: gettext('Without any keep option, the node\'s vzdump.conf or `keep-all` is used as fallback for backup jobs'),
+	    cbind: {
+		html: '{fallbackHintHtml}',
+	    },
 	},
 	{
 	    xtype: 'component',
diff --git a/www/manager6/storage/Base.js b/www/manager6/storage/Base.js
index 862c981b..ffafc87e 100644
--- a/www/manager6/storage/Base.js
+++ b/www/manager6/storage/Base.js
@@ -100,7 +100,9 @@ Ext.define('PVE.storage.BaseEdit', {
 			xtype: 'pveEditPruneInputPanel',
 			title: gettext('Backup Retention'),
 			isCreate: me.isCreate,
-			isPBS: me.ipanel.isPBS,
+			keepAllDefaultForCreate: true,
+			showPBSHint: me.ipanel.isPBS,
+			fallbackHintHtml: gettext('Without any keep option, the node\'s vzdump.conf or `keep-all` is used as fallback for backup jobs'),
 		    },
 		],
 	    },
-- 
2.30.2





  parent reply	other threads:[~2021-09-06 11:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06 11:32 [pve-devel] [PATCH-SERIES manager] ui: some backup job improvements Fabian Ebner
2021-09-06 11:32 ` [pve-devel] [PATCH manager 1/6] ui: cluster backup: fix running backup with prune settings Fabian Ebner
2021-09-08 10:59   ` [pve-devel] applied: " Thomas Lamprecht
2021-09-06 11:32 ` [pve-devel] [PATCH manager 2/6] ui: factor out input panel for editing " Fabian Ebner
2021-09-08 11:01   ` [pve-devel] applied: " Thomas Lamprecht
2021-09-06 11:32 ` Fabian Ebner [this message]
2021-09-08 11:01   ` [pve-devel] applied: [PATCH manager 3/6] ui: prune edit: prepare for being re-used for backup jobs Thomas Lamprecht
2021-09-06 11:32 ` [pve-devel] [PATCH manager 4/6] fix #1803: ui: cluster backup: handle job-specific retention options Fabian Ebner
2021-09-08 11:01   ` [pve-devel] applied: " Thomas Lamprecht
2021-09-06 11:32 ` [pve-devel] [PATCH manager 5/6] ui: backup job detail: also show retention settings Fabian Ebner
2021-09-08 11:04   ` Thomas Lamprecht
2021-09-08 14:15   ` [pve-devel] applied: " Thomas Lamprecht
2021-09-06 11:32 ` [pve-devel] [PATCH manager 6/6] ui: cluster backup: use cluster-wide storage selector Fabian Ebner
2021-09-08 11:06   ` Thomas Lamprecht
2021-09-09  6:56     ` Fabian 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=20210906113231.61790-4-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