[pve-devel] [PATCH manager] storage: base edit: Don't send delete during creation

Dominic Jäger d.jaeger at proxmox.com
Tue Nov 24 13:15:58 CET 2020


... 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 at 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





More information about the pve-devel mailing list