[pve-devel] [RFC manager 5/5] ui: silence auth failures during cluster join

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Mar 27 15:45:31 CEST 2018


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 www/manager6/Workspace.js      |  2 +-
 www/manager6/dc/ClusterEdit.js | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/www/manager6/Workspace.js b/www/manager6/Workspace.js
index c7b88761..f75356c5 100644
--- a/www/manager6/Workspace.js
+++ b/www/manager6/Workspace.js
@@ -60,7 +60,7 @@ Ext.define('PVE.Workspace', {
 
 	// fixme: what about other errors
 	Ext.Ajax.on('requestexception', function(conn, response, options) {
-	    if (response.status == 401) { // auth failure
+	    if (response.status == 401 && !PVE.Utils.silenceAuthFailures) { // auth failure
 		me.showLogin();
 	    }
 	});
diff --git a/www/manager6/dc/ClusterEdit.js b/www/manager6/dc/ClusterEdit.js
index 25ca6607..81e6532d 100644
--- a/www/manager6/dc/ClusterEdit.js
+++ b/www/manager6/dc/ClusterEdit.js
@@ -138,6 +138,11 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
     controller: {
 	xclass: 'Ext.app.ViewController',
 	control: {
+	    '#': {
+		close: function() {
+		    delete PVE.Utils.silenceAuthFailures;
+		}
+	    },
 	    'proxmoxcheckbox[name=assistedInput]': {
 		change: 'onInputTypeChange'
 	    },
@@ -195,7 +200,14 @@ Ext.define('PVE.ClusterJoinNodeWindow', {
 	}
     },
 
+    submit: function() {
+	// joining may produce temporarily auth failures, ignore as long the task runs
+	PVE.Utils.silenceAuthFailures = true;
+	this.callParent();
+    },
+
     taskDone: function(success) {
+	delete PVE.Utils.silenceAuthFailures;
 	if (success) {
 	    var txt = gettext('Cluster join task finished, node certificate may have changed, reload GUI!');
 	    // ensure user cannot do harm
-- 
2.14.2





More information about the pve-devel mailing list