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 4/6] fix #1803: ui: cluster backup: handle job-specific retention options
Date: Mon,  6 Sep 2021 13:32:29 +0200	[thread overview]
Message-ID: <20210906113231.61790-5-f.ebner@proxmox.com> (raw)
In-Reply-To: <20210906113231.61790-1-f.ebner@proxmox.com>

This was already possible via API (or manually editing vzdump.cron)
for a long time, but the settings were not visible in the UI at all.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 www/manager6/dc/Backup.js | 46 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)

diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
index 1b7b1aa1..ff52e382 100644
--- a/www/manager6/dc/Backup.js
+++ b/www/manager6/dc/Backup.js
@@ -346,7 +346,39 @@ Ext.define('PVE.dc.BackupEdit', {
 	    subject: gettext("Backup Job"),
 	    url: url,
 	    method: method,
-	    items: [ipanel, vmgrid],
+	    bodyPadding: 0,
+	    items: [
+		{
+		    xtype: 'tabpanel',
+		    region: 'center',
+		    layout: 'fit',
+		    bodyPadding: 10,
+		    items: [
+			{
+			    xtype: 'container',
+			    title: gettext('General'),
+			    region: 'center',
+			    layout: {
+				type: 'vbox',
+				align: 'stretch',
+			    },
+			    items: [
+				ipanel,
+				vmgrid,
+			    ],
+			},
+			{
+			    xtype: 'pveEditPruneInputPanel',
+			    title: gettext('Retention'),
+			    isCreate: me.isCreate,
+			    keepAllDefaultForCreate: false,
+			    showPBSHint: false,
+			    fallbackHintHtml: gettext('Without any keep option, the storage\'s configuration or node\'s vzdump.conf is used as fallback'),
+			},
+		    ],
+		},
+	    ],
+
 	});
 
 	me.callParent();
@@ -375,6 +407,18 @@ Ext.define('PVE.dc.BackupEdit', {
 			data.selMode = 'include';
 		    }
 
+		    if (data['prune-backups']) {
+			Object.assign(data, data['prune-backups']);
+			delete data['prune-backups'];
+		    } else if (data.maxfiles !== undefined) {
+			if (data.maxfiles > 0) {
+			    data['keep-last'] = data.maxfiles;
+			} else {
+			    data['keep-all'] = 1;
+			}
+			delete data.maxfiles;
+		    }
+
 		    me.setValues(data);
 		},
 	    });
-- 
2.30.2





  parent reply	other threads:[~2021-09-06 11:33 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 ` [pve-devel] [PATCH manager 3/6] ui: prune edit: prepare for being re-used for backup jobs 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 4/6] fix #1803: ui: cluster backup: handle job-specific retention options 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-5-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