[pbs-devel] [PATCH proxmox-backup v2 2/2] web: disallow datastore in root, add reuse-datastore flag
Gabriel Goller
g.goller at proxmox.com
Wed Jun 12 15:22:57 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 b6115460..2565688e 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