public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Dominic Jäger" <d.jaeger@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] storage: base edit: Don't send delete during creation
Date: Tue, 24 Nov 2020 13:15:58 +0100	[thread overview]
Message-ID: <20201124121558.49566-1-d.jaeger@proxmox.com> (raw)

... as this is now allowed by the API (createSchema() in PVE::SectionConfig).
It is only allowed by the update API call (updateSchema()).

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
---

 www/manager6/storage/Base.js | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/www/manager6/storage/Base.js b/www/manager6/storage/Base.js
index 79b4a618..21ab3a41 100644
--- a/www/manager6/storage/Base.js
+++ b/www/manager6/storage/Base.js
@@ -67,17 +67,22 @@ Ext.define('PVE.panel.StoragePruneInputPanel', {
 	let retention = PVE.Parser.printPropertyString(formValues)
 	// always delete old 'maxfiles', we map it to keep-last on edit win load
 	if (retention === '') {
-	    return {
-		delete: [
-		    'prune-backups',
-		    'maxfiles',
-		],
-	    };
+	    if (this.isCreate) {
+		return {};
+	    } else {
+		return {
+		    delete: [
+			'prune-backups',
+			'maxfiles',
+		    ],
+		};
+	    }
 	}
-	return {
-	    'prune-backups': retention,
-	    delete: 'maxfiles',
+	let options = { 'prune-backups': retention };
+	if (!this.isCreate) {
+	    options.delete = 'maxfiles';
 	}
+	return options;
     },
 
     listeners: {
-- 
2.20.1




             reply	other threads:[~2020-11-24 12:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24 12:15 Dominic Jäger [this message]
2020-11-24 12:39 ` [pve-devel] applied: " Thomas Lamprecht

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=20201124121558.49566-1-d.jaeger@proxmox.com \
    --to=d.jaeger@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