[pbs-devel] [PATCH proxmox-backup v8 14/23] ui: add removable datastore creation support

Hannes Laimer h.laimer at proxmox.com
Fri Apr 19 17:55:57 CEST 2024


Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
 www/window/DataStoreEdit.js | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/www/window/DataStoreEdit.js b/www/window/DataStoreEdit.js
index aecf6b8d..a69e15c8 100644
--- a/www/window/DataStoreEdit.js
+++ b/www/window/DataStoreEdit.js
@@ -59,6 +59,20 @@ Ext.define('PBS.DataStoreEdit', {
 			fieldLabel: gettext('Backing Path'),
 			emptyText: gettext('An absolute path'),
 		    },
+		    {
+			xtype: 'pmxDisplayEditField',
+			fieldLabel: gettext('Device'),
+			name: 'backing-device',
+			disabled: true,
+			cbind: {
+			    editable: '{isCreate}',
+			},
+			editConfig: {
+			    xtype: 'pbsPartitionSelector',
+			    allowBlank: true,
+			},
+			emptyText: gettext('Device path'),
+		    },
 		],
 		column2: [
 		    {
@@ -84,6 +98,23 @@ Ext.define('PBS.DataStoreEdit', {
 		    },
 		],
 		columnB: [
+		    {
+			xtype: 'checkbox',
+			boxLabel: gettext('Removable datastore'),
+			submitValue: false,
+			listeners: {
+			    change: function(checkbox, isRemovable) {
+				let inputPanel = checkbox.up('inputpanel');
+				let uuidField = inputPanel.down('pbsPartitionSelector[name=backing-device]');
+				let uuidEditField = inputPanel.down('[name=backing-device]');
+
+				uuidField.allowBlank = !isRemovable;
+				uuidEditField.setDisabled(!isRemovable);
+				uuidField.setDisabled(!isRemovable);
+				uuidField.setValue('');
+			    },
+			},
+		    },
 		    {
 			xtype: 'textfield',
 			name: 'comment',
-- 
2.39.2





More information about the pbs-devel mailing list