all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 3/3] ui: improve comment behaviour for datastore Summary
Date: Fri, 13 Nov 2020 15:02:36 +0100	[thread overview]
Message-ID: <20201113140236.31570-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20201113140236.31570-1-d.csapak@proxmox.com>

when we could not load the config (e.g. missing permissions)
show the comment from the global datastore-list

also show a messagebox for a load error instead of setting
the text of the comment box

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/datastore/Notes.js   | 2 +-
 www/datastore/Summary.js | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/www/datastore/Notes.js b/www/datastore/Notes.js
index 21462805..2928b7ec 100644
--- a/www/datastore/Notes.js
+++ b/www/datastore/Notes.js
@@ -56,7 +56,7 @@ Ext.define('PBS.DataStoreNotes', {
 	    url: me.url,
 	    waitMsgTarget: me,
 	    failure: function(response, opts) {
-		me.update(gettext('Error') + " " + response.htmlStatus);
+		Ext.Msg.alert(gettext('Error'), response.htmlStatus);
 		me.setCollapsed(false);
 	    },
 	    success: function(response, opts) {
diff --git a/www/datastore/Summary.js b/www/datastore/Summary.js
index 41fd7c85..c263846a 100644
--- a/www/datastore/Summary.js
+++ b/www/datastore/Summary.js
@@ -264,6 +264,13 @@ Ext.define('PBS.DataStoreSummary', {
 		me.down('pbsDataStoreInfo').setTitle(`${me.datastore} (${path})`);
 		me.down('pbsDataStoreNotes').setNotes(response.result.data.comment);
 	    },
+	    failure: function(response) {
+		// fallback if e.g. we have no permissions to the config
+		let rec = Ext.getStore('pbs-datastore-list').findRecord('store', me.datastore);
+		if (rec) {
+		    me.down('pbsDataStoreNotes').setNotes(rec.data.comment || "");
+		}
+	    },
 	});
 
 	me.query('proxmoxRRDChart').forEach((chart) => {
-- 
2.20.1





  parent reply	other threads:[~2020-11-13 14:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13 14:02 [pbs-devel] [PATCH proxmox-backup 1/3] ui: DataStoreList: remove datastores also from hash Dominik Csapak
2020-11-13 14:02 ` [pbs-devel] [PATCH proxmox-backup 2/3] ui: DataStoreList: show message when there are no datastores Dominik Csapak
2020-11-13 14:02 ` Dominik Csapak [this message]
2020-11-16 16:00 ` [pbs-devel] applied-series: [PATCH proxmox-backup 1/3] ui: DataStoreList: remove datastores also from hash Thomas Lamprecht

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=20201113140236.31570-3-d.csapak@proxmox.com \
    --to=d.csapak@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