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 E0D8488B81 for ; Thu, 28 Jul 2022 15:29:20 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D7A584359 for ; Thu, 28 Jul 2022 15:28:50 +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 for ; Thu, 28 Jul 2022 15:28:50 +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 D29FF427CA for ; Thu, 28 Jul 2022 15:28:49 +0200 (CEST) Message-ID: <6ab3601a-17b8-e502-fefa-0e0f110a46ad@proxmox.com> Date: Thu, 28 Jul 2022 15:28:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US To: pbs-devel@lists.proxmox.com References: <20220726134441.403635-1-d.tschlatscher@proxmox.com> <20220726134441.403635-3-d.tschlatscher@proxmox.com> From: Matthias Heiserer In-Reply-To: <20220726134441.403635-3-d.tschlatscher@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.172 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 NICE_REPLY_A -0.001 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pbs-devel] [PATCH proxmox-backup v3 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: Thu, 28 Jul 2022 13:29:20 -0000 On 26.07.2022 15:44, Daniel Tschlatscher wrote: > 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 > --- > Changes from v2: > * Rebased this patch for the current master > > 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); > + }, Here... > 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"); > + ... and here, you do the same. I would move the check if the datastore is full into render_estimate and pass it value and available. > 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')], > }, > {