[pve-devel] [PATCH v2 manager] show connection failure during login

Oguz Bektas o.bektas at proxmox.com
Wed Jul 24 17:46:20 CEST 2019


in case pvedaemon is not running or we somehow else get a 595 response (connection
failure), we want to tell this to the user, since "Login failed" doesn't
help.

handle all connection failures, leave the rest the same.
we could go into more detail (CONNECT_FAILURE, CLIENT_INVALID,
LOAD_FAILURE and SERVER_INVALID), but i didn't see any reason to make
all these distinctions now.

Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
v1->v2:
* implement thomas' suggestion of using variable for text

 www/manager6/window/LoginWindow.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/www/manager6/window/LoginWindow.js b/www/manager6/window/LoginWindow.js
index 0f7ae345..0e742c74 100644
--- a/www/manager6/window/LoginWindow.js
+++ b/www/manager6/window/LoginWindow.js
@@ -63,9 +63,13 @@ Ext.define('PVE.window.LoginWindow', {
 		uf.focus(true, true);
 	    };
 
-	    Ext.MessageBox.alert(gettext('Error'),
-				 gettext("Login failed. Please try again"),
-				 handler);
+	    let emsg = gettext("Login failed. Please try again");
+
+	    if (resp.failureType === "connect") {
+		emsg = gettext("Connection failure");
+	    }
+
+	    Ext.MessageBox.alert(gettext('Error'), emsg, handler);
 	},
 	success: function(data) {
 	    var me = this;
-- 
2.20.1




More information about the pve-devel mailing list