[pbs-devel] [PATCH proxmox-backup v3 2/2] web: disallow datastore in root, add reuse-datastore flag
Gabriel Goller
g.goller at proxmox.com
Thu Jul 18 14:29:49 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 | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/www/window/DataStoreEdit.js b/www/window/DataStoreEdit.js
index b61154606284..2565688e26ce 100644
--- a/www/window/DataStoreEdit.js
+++ b/www/window/DataStoreEdit.js
@@ -61,6 +61,17 @@ Ext.define('PBS.DataStoreEdit', {
allowBlank: false,
fieldLabel: gettext('Backing Path'),
emptyText: gettext('An absolute path'),
+ validator: function(val) {
+ if (val.trim() === '/') {
+ return false;
+ }
+ return true;
+ },
+ },
+ {
+ xtype: 'checkbox',
+ name: 'reuse-datastore',
+ fieldLabel: gettext('Reuse existing datastore'),
},
],
column2: [
--
2.43.0
More information about the pbs-devel
mailing list