public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup v2 1/1] ui: mask unmounted datastores in datastore overview
@ 2024-11-28 11:00 Stefan Hanreich
  2024-11-28 11:05 ` Shannon Sterz
  2024-11-28 11:07 ` [pbs-devel] applied: " Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Hanreich @ 2024-11-28 11:00 UTC (permalink / raw)
  To: pbs-devel

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>
---
Changes from v1 to v2:
* unmask element if state changes

 www/datastore/DataStoreListSummary.js | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/www/datastore/DataStoreListSummary.js b/www/datastore/DataStoreListSummary.js
index f7ea83e7..f61e88ec 100644
--- a/www/datastore/DataStoreListSummary.js
+++ b/www/datastore/DataStoreListSummary.js
@@ -35,6 +35,15 @@ 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;
+	} else if (me.isMasked()) {
+	    me.unmask();
+	}
+
 	if (statusData.error !== undefined) {
 	    Proxmox.Utils.API2Request({
 		url: `/config/datastore/${statusData.store}`,
-- 
2.39.5


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pbs-devel] [PATCH proxmox-backup v2 1/1] ui: mask unmounted datastores in datastore overview
  2024-11-28 11:00 [pbs-devel] [PATCH proxmox-backup v2 1/1] ui: mask unmounted datastores in datastore overview Stefan Hanreich
@ 2024-11-28 11:05 ` Shannon Sterz
  2024-11-28 11:07 ` [pbs-devel] applied: " Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Shannon Sterz @ 2024-11-28 11:05 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion

On Thu Nov 28, 2024 at 12:00 PM 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>
> ---
> Changes from v1 to v2:
> * unmask element if state changes
>
>  www/datastore/DataStoreListSummary.js | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/www/datastore/DataStoreListSummary.js b/www/datastore/DataStoreListSummary.js
> index f7ea83e7..f61e88ec 100644
> --- a/www/datastore/DataStoreListSummary.js
> +++ b/www/datastore/DataStoreListSummary.js
> @@ -35,6 +35,15 @@ 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;
> +	} else if (me.isMasked()) {
> +	    me.unmask();
> +	}
> +
>  	if (statusData.error !== undefined) {
>  	    Proxmox.Utils.API2Request({
>  		url: `/config/datastore/${statusData.store}`,

this now masks and properly unmasks the datastore, sorry i didn't notice
that before. tested it again, no more errors in the console too, so:

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


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pbs-devel] applied: [PATCH proxmox-backup v2 1/1] ui: mask unmounted datastores in datastore overview
  2024-11-28 11:00 [pbs-devel] [PATCH proxmox-backup v2 1/1] ui: mask unmounted datastores in datastore overview Stefan Hanreich
  2024-11-28 11:05 ` Shannon Sterz
@ 2024-11-28 11:07 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2024-11-28 11:07 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Stefan Hanreich

Am 28.11.24 um 12:00 schrieb Stefan Hanreich:
> 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>
> ---
> Changes from v1 to v2:
> * unmask element if state changes
> 
>  www/datastore/DataStoreListSummary.js | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
>

applied, with Shannon's T-b, thanks!


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-11-28 11:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-28 11:00 [pbs-devel] [PATCH proxmox-backup v2 1/1] ui: mask unmounted datastores in datastore overview Stefan Hanreich
2024-11-28 11:05 ` Shannon Sterz
2024-11-28 11:07 ` [pbs-devel] applied: " Thomas Lamprecht

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