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 E7A75706D5 for ; Fri, 3 Jun 2022 13:22:57 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DFF626CBC for ; Fri, 3 Jun 2022 13:22:57 +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)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id A411E6CA9 for ; Fri, 3 Jun 2022 13:22:56 +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 77C3943128 for ; Fri, 3 Jun 2022 13:22:56 +0200 (CEST) From: Daniel Tschlatscher To: pbs-devel@lists.proxmox.com Date: Fri, 3 Jun 2022 13:21:20 +0200 Message-Id: <20220603112120.429696-3-d.tschlatscher@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220603112120.429696-1-d.tschlatscher@proxmox.com> References: <20220603112120.429696-1-d.tschlatscher@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.129 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% 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 v2 3/3] gui: change reporting of the estimated_time_full to "Full" if no space 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, 03 Jun 2022 11:22:58 -0000 is left in the datastore. Before, the GUI would report "Never" for the estimated time full, because the value provided in the backend was in the past. To get around this, the GUI now report "Full" if the value for available reaches 0. Signed-off-by: Daniel Tschlatscher --- www/dashboard/DataStoreStatistics.js | 8 +++++++- www/datastore/DataStoreListSummary.js | 5 ++++- www/datastore/Summary.js | 6 +++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/www/dashboard/DataStoreStatistics.js b/www/dashboard/DataStoreStatistics.js index 8dbd1caf..daac461d 100644 --- a/www/dashboard/DataStoreStatistics.js +++ b/www/dashboard/DataStoreStatistics.js @@ -118,7 +118,13 @@ Ext.define('PBS.DatastoreStatistics', { text: gettext('Estimated Full'), dataIndex: 'estimated-full-date', sortable: true, - renderer: PBS.Utils.render_estimate, + renderer: (value, metaData, record, rowIndex, colIndex, store) => { + if (record.get("avail") === 0) { + return gettext("Full"); + } + + return PBS.Utils.render_estimate(value); + }, flex: 1, minWidth: 130, maxWidth: 200, diff --git a/www/datastore/DataStoreListSummary.js b/www/datastore/DataStoreListSummary.js index 3714528e..60ad0461 100644 --- a/www/datastore/DataStoreListSummary.js +++ b/www/datastore/DataStoreListSummary.js @@ -61,7 +61,10 @@ Ext.define('PBS.datastore.DataStoreListSummary', { let usagePanel = me.lookup('usage'); usagePanel.updateValue(usage, usagetext); - let estimate = PBS.Utils.render_estimate(statusData['estimated-full-date']); + let estimate = statusData.avail > 0 + ? PBS.Utils.render_estimate(statusData['estimated-full-date']) + : gettext("Full"); + vm.set('full', estimate); vm.set('deduplication', PBS.Utils.calculate_dedup_factor(statusData['gc-status']).toFixed(2)); vm.set('stillbad', statusData['gc-status']['still-bad']); diff --git a/www/datastore/Summary.js b/www/datastore/Summary.js index 94be9559..4025949c 100644 --- a/www/datastore/Summary.js +++ b/www/datastore/Summary.js @@ -2,7 +2,7 @@ Ext.define('pve-rrd-datastore', { extend: 'Ext.data.Model', fields: [ 'used', - 'total', + 'unpriv_total', 'read_ios', 'read_bytes', 'write_ios', @@ -66,7 +66,7 @@ Ext.define('PBS.DataStoreInfo', { let vm = me.getViewModel(); let counts = store.getById('counts').data.value; - let total = store.getById('total').data.value; + let total = store.getById('unpriv-total').data.value; let used = store.getById('used').data.value; let usage = Proxmox.Utils.render_size_usage(used, total, true); @@ -236,7 +236,7 @@ Ext.define('PBS.DataStoreSummary', { { xtype: 'proxmoxRRDChart', title: gettext('Storage usage (bytes)'), - fields: ['total', 'used'], + fields: ['unpriv_total', 'used'], fieldTitles: [gettext('Total'), gettext('Storage usage')], }, { -- 2.30.2