public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Shannon Sterz" <s.sterz@proxmox.com>
To: "Proxmox Backup Server development discussion"
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup 1/1] ui: mask unmounted datastores in datastore overview
Date: Thu, 28 Nov 2024 11:48:41 +0100	[thread overview]
Message-ID: <D5XR47RJM8ZL.3SE0C5M81AO7S@proxmox.com> (raw)
In-Reply-To: <20241128104032.66011-1-s.hanreich@proxmox.com>

On Thu Nov 28, 2024 at 11:40 AM CET, Stefan Hanreich wrote:
> Currently, showing the Datastore summary page leads to errors since
> the status returned by the API does not contain any fields that are
> checked by the component rendering the datastore summary. We solve
> this by checking if the datastore is currently mounted first and mask
> the element if it is currently unmounted.
>
> Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
> ---
>  www/datastore/DataStoreListSummary.js | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/www/datastore/DataStoreListSummary.js b/www/datastore/DataStoreListSummary.js
> index f7ea83e7..b43f1ab2 100644
> --- a/www/datastore/DataStoreListSummary.js
> +++ b/www/datastore/DataStoreListSummary.js
> @@ -35,6 +35,13 @@ Ext.define('PBS.datastore.DataStoreListSummary', {
>  	let me = this;
>  	let vm = me.getViewModel();
>
> +	if (statusData['mount-status'] === 'notmounted') {
> +	    let maskMessage = gettext('Datastore is not mounted');
> +	    let maskIcon = 'fa pbs-unplugged-mask';
> +	    me.mask(maskMessage, maskIcon);
> +	    return;
> +	}
> +
>  	if (statusData.error !== undefined) {
>  	    Proxmox.Utils.API2Request({
>  		url: `/config/datastore/${statusData.store}`,

tested this and seems to works as intended (no more error in the
console, datastore is properly masked), so consider this:

Tested-by: Shannon Sterz <s.sterz@proxmox.com>

code also looks fine to me


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


  reply	other threads:[~2024-11-28 10:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-28 10:40 Stefan Hanreich
2024-11-28 10:48 ` Shannon Sterz [this message]
2024-11-28 10:50 ` Stefan Hanreich

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=D5XR47RJM8ZL.3SE0C5M81AO7S@proxmox.com \
    --to=s.sterz@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal