all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Matthias Heiserer <m.heiserer@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: Re: [pbs-devel] [PATCH proxmox-backup v3 3/3] gui: change reporting of the estimated_time_full to "Full" if no space
Date: Thu, 28 Jul 2022 15:28:48 +0200	[thread overview]
Message-ID: <6ab3601a-17b8-e502-fefa-0e0f110a46ad@proxmox.com> (raw)
In-Reply-To: <20220726134441.403635-3-d.tschlatscher@proxmox.com>

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 <d.tschlatscher@proxmox.com>
> ---
> 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')],
>   	},
>   	{





      reply	other threads:[~2022-07-28 13:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 13:44 [pbs-devel] [PATCH proxmox-backup v3 1/3] fix #4077: Estimated Full metric on ext4 file systems Daniel Tschlatscher
2022-07-26 13:44 ` [pbs-devel] [PATCH proxmox-backup v3 2/3] expose the unpriviliged total in the api and use it in the GUI Daniel Tschlatscher
2022-07-28 13:28   ` Matthias Heiserer
2022-07-26 13:44 ` [pbs-devel] [PATCH proxmox-backup v3 3/3] gui: change reporting of the estimated_time_full to "Full" if no space Daniel Tschlatscher
2022-07-28 13:28   ` Matthias Heiserer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ab3601a-17b8-e502-fefa-0e0f110a46ad@proxmox.com \
    --to=m.heiserer@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal