[pbs-devel] [PATCH proxmox-backup v2 1/6] ui: add summary mask when in maintenance mode
Hannes Laimer
h.laimer at proxmox.com
Tue Apr 26 08:23:30 CEST 2022
Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
www/css/ext6-pbs.css | 12 ++++++++++++
www/datastore/Summary.js | 24 +++++++++++++++++++++++-
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/www/css/ext6-pbs.css b/www/css/ext6-pbs.css
index f283bf0b..9c782e93 100644
--- a/www/css/ext6-pbs.css
+++ b/www/css/ext6-pbs.css
@@ -257,6 +257,18 @@ span.snapshot-comment-column {
font-weight: 800;
}
+.pbs-maintenance-mask div.x-mask-msg-text {
+ background: None;
+ padding: 12px 0 0;
+}
+
+.pbs-maintenance-mask:before {
+ font-size: 3em;
+ display: flex;
+ justify-content: center;
+ content: "\f0ad";
+}
+
/*' PBS specific icons */
.pbs-icon-tape {
diff --git a/www/datastore/Summary.js b/www/datastore/Summary.js
index c3769257..d7b53a3a 100644
--- a/www/datastore/Summary.js
+++ b/www/datastore/Summary.js
@@ -42,8 +42,30 @@ Ext.define('PBS.DataStoreInfo', {
xclass: 'Ext.app.ViewController',
onLoad: function(store, data, success) {
- if (!success) return;
let me = this;
+ if (!success) {
+ Proxmox.Utils.API2Request({
+ url: `/config/datastore/${me.view.datastore}`,
+ success: function(response) {
+ const config = response.result.data;
+ if (config['maintenance-mode']) {
+ const [_type, msg] = config['maintenance-mode'].split(/,(.+)/);
+ const message = msg ? ': ' + msg.split("=")[1]
+ .replace(/^"(.*)"$/, '$1')
+ .replaceAll('\\"', '"') : '';
+ me.view.el.mask(
+ `${gettext('Datastore is in maintenance mode')}${message}`,
+ 'fa pbs-maintenance-mask',
+ );
+ } else {
+ me.view.el.mask(gettext('Datastore is not available'));
+ }
+ },
+ });
+ return;
+ }
+ me.view.el.unmask();
+
let vm = me.getViewModel();
let counts = store.getById('counts').data.value;
--
2.30.2
More information about the pbs-devel
mailing list