From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id BFD4370480 for ; Fri, 6 May 2022 11:59:09 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B7477B702 for ; Fri, 6 May 2022 11:59:09 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 3B4E8B6F9 for ; Fri, 6 May 2022 11:59:09 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 13934430C2 for ; Fri, 6 May 2022 11:59:09 +0200 (CEST) From: Hannes Laimer To: pbs-devel@lists.proxmox.com Date: Fri, 6 May 2022 09:58:58 +0000 Message-Id: <20220506095858.2775-1-h.laimer@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -1.551 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% ENA_SUBJ_ODD_CASE 3.2 Subject has odd case KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pbs-devel] [PATCH proxmox-backup] ui: add maintenance mask to DataStoreListSummary X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2022 09:59:09 -0000 Signed-off-by: Hannes Laimer --- www/datastore/DataStoreListSummary.js | 33 ++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/www/datastore/DataStoreListSummary.js b/www/datastore/DataStoreListSummary.js index eb9e04e1..b135326c 100644 --- a/www/datastore/DataStoreListSummary.js +++ b/www/datastore/DataStoreListSummary.js @@ -22,6 +22,7 @@ Ext.define('PBS.datastore.DataStoreListSummary', { stillbad: 0, deduplication: 1.0, error: "", + maintenance: '', }, }, setTasks: function(taskdata, since) { @@ -34,10 +35,21 @@ Ext.define('PBS.datastore.DataStoreListSummary', { let vm = me.getViewModel(); if (statusData.error !== undefined) { + Proxmox.Utils.API2Request({ + url: `/config/datastore/${statusData.store}`, + success: (response) => { + const config = response.result.data; + if (config['maintenance-mode']) { + const [_type, msg] = PBS.Utils.parseMaintenanceMode(config['maintenance-mode']); + vm.set('maintenance', `${gettext('Datastore is in maintenance mode')}${msg ? ': ' + msg : ''}`); + } + }, + }); vm.set('error', statusData.error); return; } else { vm.set('error', ""); + vm.set('maintenance', ''); } let usage = statusData.used/statusData.total; @@ -104,12 +116,31 @@ Ext.define('PBS.datastore.DataStoreListSummary', { '', ], bind: { - visible: '{error}', + visible: '{error && !maintenance}', data: { text: '{error}', }, }, }, + { + xtype: 'box', + reference: 'errorBox', + hidden: true, + tpl: [ + '
', + `

${gettext("Maintenance mode")}

`, + '', + '

', + '{text}', + '
', + ], + bind: { + visible: '{maintenance}', + data: { + text: '{maintenance}', + }, + }, + }, { xtype: 'proxmoxGauge', warningThreshold: 0.8, -- 2.30.2