[pbs-devel] [PATCH proxmox-backup 16/26] ui: add "no removable device present" mask to summary

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


Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
 www/css/ext6-pbs.css     | 12 ++++++++++++
 www/datastore/Summary.js | 15 +++++++++++----
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/www/css/ext6-pbs.css b/www/css/ext6-pbs.css
index 3c8bed55..045a7376 100644
--- a/www/css/ext6-pbs.css
+++ b/www/css/ext6-pbs.css
@@ -269,6 +269,18 @@ span.snapshot-comment-column {
     content: "\f0ad";
 }
 
+.pbs-removable-device-mask div.x-mask-msg-text {
+    background: None;
+    padding: 12px 0 0;
+}
+
+.pbs-removable-device-mask:before {
+    font-size: 3em;
+    display: flex;
+    justify-content: center;
+    content: "\f0a0";
+}
+
 /* the small icons TODO move to proxmox-widget-toolkit */
 .pmx-tree-icon-custom:after {
     position: relative;
diff --git a/www/datastore/Summary.js b/www/datastore/Summary.js
index 6e73e9ad..7a77b35c 100644
--- a/www/datastore/Summary.js
+++ b/www/datastore/Summary.js
@@ -50,10 +50,17 @@ Ext.define('PBS.DataStoreInfo', {
 			const config = response.result.data;
 			if (config['maintenance-mode']) {
 			    const maintenance = PBS.Utils.parsePropertyString(config['maintenance-mode'], 'type');
-			    me.view.el.mask(
-			        `${gettext('Datastore is in maintenance mode')}${maintenance.message ? ': ' + maintenance.message : ''}`,
-			        'fa pbs-maintenance-mask',
-			    );
+			    if (maintenance.type === 'unplugged' && config.removable) {
+				me.view.el.mask(
+				    `${maintenance.message ?? 'No removable device assiciated with the datastore is present'}`,
+				    'fa pbs-removable-device-mask',
+				);
+			    } else {
+				me.view.el.mask(
+				    `${gettext('Datastore is in maintenance mode')}${maintenance.message ? ': ' + maintenance.message : ''}`,
+				    'fa pbs-maintenance-mask',
+				);
+			    }
 			} else {
 			    me.view.el.mask(gettext('Datastore is not available'));
 			}
-- 
2.30.2






More information about the pbs-devel mailing list