[pbs-devel] [PATCH proxmox-backup v5 2/2] web: disallow datastore in root, add reuse-datastore flag

Gabriel Goller g.goller at proxmox.com
Thu Aug 29 12:45:11 CEST 2024


Disallows creating a datastore in root on the frontend side, by
filtering the '/' path. Add reuse-flag to permit us to open existing
datastores.

Signed-off-by: Gabriel Goller <g.goller at proxmox.com>
---
 www/window/DataStoreEdit.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/www/window/DataStoreEdit.js b/www/window/DataStoreEdit.js
index b61154606284..b8e866df22df 100644
--- a/www/window/DataStoreEdit.js
+++ b/www/window/DataStoreEdit.js
@@ -61,6 +61,7 @@ Ext.define('PBS.DataStoreEdit', {
 			allowBlank: false,
 			fieldLabel: gettext('Backing Path'),
 			emptyText: gettext('An absolute path'),
+			validator: val => val?.trim() !== '/',
 		    },
 		],
 		column2: [
@@ -93,6 +94,13 @@ Ext.define('PBS.DataStoreEdit', {
 			fieldLabel: gettext('Comment'),
 		    },
 		],
+		advancedColumn1: [
+		    {
+			xtype: 'checkbox',
+			name: 'reuse-datastore',
+			fieldLabel: gettext('Reuse existing datastore'),
+		    },
+		],
 
 		onGetValues: function(values) {
 		    let me = this;
-- 
2.39.2





More information about the pbs-devel mailing list