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

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Jul 24 17:29:36 CEST 2019


On 7/24/19 4:53 PM, Oguz Bektas wrote:
> in case pvedaemon is not running or we somehow get a 595 response (connection

s/somehow/somehow else/

> 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>
> ---
> 
> thanks dietmar for noticing and dominik for helping me debug :)
> 
>  www/manager6/window/LoginWindow.js | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/www/manager6/window/LoginWindow.js b/www/manager6/window/LoginWindow.js
> index 0f7ae345..7f509bb4 100644
> --- a/www/manager6/window/LoginWindow.js
> +++ b/www/manager6/window/LoginWindow.js
> @@ -63,9 +63,15 @@ Ext.define('PVE.window.LoginWindow', {
>  		uf.focus(true, true);
>  	    };
>  
> +	    if (resp.failureType === "connect") {
> +		Ext.MessageBox.alert(gettext('Error'),
> +				     gettext('Connection failure.'),
> +				     handler);
> +	    } else {
>  	    Ext.MessageBox.alert(gettext('Error'),

this code in the new else branch needs to be shifted by one indentation
level now?

Or maybe do a:

let emesg = gettext("Login failed. Please try again");

if (resp.failureType === "connect") {
    emesg = gettext('Connection failure.')
}

Ext.MessageBox.alert(gettext('Error'), emsg, handler);

?

>  				 gettext("Login failed. Please try again"),
>  				 handler);
> +	    }
>  	},
>  	success: function(data) {
>  	    var me = this;
> 





More information about the pve-devel mailing list