web: disallow datastore in root, add reuse-datastore flag

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@proxmox.com>
This commit is contained in:
Gabriel Goller 2024-08-29 14:58:44 +02:00 committed by Thomas Lamprecht
parent 6e101ff757
commit f2ea424cc1

View File

@ -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;