[pbs-devel] [PATCH proxmox-backup 21/26] ui: disable maintenance update while removable datastore is unplugged

Hannes Laimer h.laimer at proxmox.com
Tue Jul 5 15:08:29 CEST 2022


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

diff --git a/www/window/MaintenanceOptions.js b/www/window/MaintenanceOptions.js
index 8907d75d..2d83fbf8 100644
--- a/www/window/MaintenanceOptions.js
+++ b/www/window/MaintenanceOptions.js
@@ -52,6 +52,7 @@ Ext.define('PBS.window.MaintenanceOptions', {
 	items: [
 	    {
 		xtype: 'pbsMaintenanceType',
+		id: 'type-field',
 		name: 'maintenance-type',
 		fieldLabel: gettext('Maintenance Type'),
 		listeners: {
@@ -85,10 +86,15 @@ Ext.define('PBS.window.MaintenanceOptions', {
 		'maintenance-msg': maintenance.message ?? '',
 	    };
 	}
+	const unplugged = options['maintenance-type'] === 'unplugged';
+	const defaultType = options['maintenance-type'] === '__default__';
+	if (unplugged) {
+	    options['maintenance-type'] = '';
+	}
 
 	me.callParent([options]);
 
-	Ext.ComponentManager.get('message-field')
-	    .setDisabled(options['maintenance-type'] === '__default__');
+	Ext.ComponentManager.get('type-field').setDisabled(unplugged);
+	Ext.ComponentManager.get('message-field').setDisabled(unplugged || defaultType);
     },
 });
-- 
2.30.2






More information about the pbs-devel mailing list