[pbs-devel] [PATCH proxmox-backup v15 20/26] ui: render 'unmount' maintenance mode correctly

Hannes Laimer h.laimer at proxmox.com
Mon Nov 25 17:22:07 CET 2024


Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
 www/Utils.js                     | 4 +++-
 www/window/MaintenanceOptions.js | 9 +++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/www/Utils.js b/www/Utils.js
index 7756e9b5d..6bae9b709 100644
--- a/www/Utils.js
+++ b/www/Utils.js
@@ -775,7 +775,7 @@ Ext.define('PBS.Utils', {
 	let extra = '';
 
 	if (activeTasks !== undefined) {
-	    const conflictingTasks = activeTasks.write + (type === 'offline' ? activeTasks.read : 0);
+	    const conflictingTasks = activeTasks.write + (type === 'offline' || type === 'unmount' ? activeTasks.read : 0);
 
 	    if (conflictingTasks > 0) {
 		extra += '| <i class="fa fa-spinner fa-pulse fa-fw"></i> ';
@@ -795,6 +795,8 @@ Ext.define('PBS.Utils', {
 		break;
 	    case 'offline': modeText = gettext("Offline");
 		break;
+	    case 'unmount': modeText = gettext("Unmounting");
+		break;
 	}
 	return `${modeText} ${extra}`;
     },
diff --git a/www/window/MaintenanceOptions.js b/www/window/MaintenanceOptions.js
index 7e3b42516..896d6a58e 100644
--- a/www/window/MaintenanceOptions.js
+++ b/www/window/MaintenanceOptions.js
@@ -86,6 +86,15 @@ Ext.define('PBS.window.MaintenanceOptions', {
 	    };
 	}
 
+        let unmounting = options['maintenance-type'] === 'unmount';
+        let defaultType = options['maintenance-type'] === '__default__';
+        if (unmounting) {
+            options['maintenance-type'] = '';
+        }
+
 	me.callParent([options]);
+
+        me.lookupReference('type-field').setDisabled(unmounting);
+        me.lookupReference('message-field').setDisabled(unmounting || defaultType);
     },
 });
-- 
2.39.5





More information about the pbs-devel mailing list