[pbs-devel] [PATCH proxmox-backup 1/2] ui: datastore add: validate if path is absolute

Dominik Csapak d.csapak at proxmox.com
Fri Apr 26 08:27:30 CEST 2024


the backend checks this too, but by then we closed the window already
and the user has to start adding again.

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/window/DataStoreEdit.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/www/window/DataStoreEdit.js b/www/window/DataStoreEdit.js
index b61154606..4d4c528f3 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: v => v.startsWith('/') ? true : gettext('Path must be absolute.'),
 		    },
 		],
 		column2: [
-- 
2.39.2





More information about the pbs-devel mailing list