[pve-devel] [PATCH manager] Clear sensitive content when logging out closes: #1060

Dominik Csapak d.csapak at proxmox.com
Thu Aug 18 09:16:45 CEST 2016


Comment inline

On 08/17/2016 02:49 PM, Emmanuel Kasper wrote:
> The current position inside the Workspace is saved via the StateProvider
> separately thus this clearing operation do not lose the previous selection.
>
> This patch also fixes another bug:
>
> when logging out while the Syslog tab of the Node panel was displayed,
> you had to login twice due a to a race condition in the store
> load of the Syslog panel. ( The login call could complete successfully
> before a backgroup store load, causing the faild store load call
> to redisplay a login window)
> ---
>  www/manager6/Workspace.js | 21 +++++++++++++--------
>  1 file changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/www/manager6/Workspace.js b/www/manager6/Workspace.js
> index 61d345f..eea6ce4 100644
> --- a/www/manager6/Workspace.js
> +++ b/www/manager6/Workspace.js
> @@ -208,13 +208,10 @@ Ext.define('PVE.StdWorkspace', {
>  		task.delay(10);
>  	    }
>  	}
> -	// else {
> -	    // TODO: display something useful
> -
> -	    // Note:: error mask has wrong zindex, so we do not
> -	    // use that - see bug 114
> -	    // PVE.Utils.setErrorMask(cont, 'nothing selected');
> -	//}
> +	else {
> +	    // helper for cleaning the content when logging out
> +	    cont.removeAll();
> +	}
>      },
>
>      selectById: function(nodeid) {
> @@ -419,9 +416,17 @@ Ext.define('PVE.StdWorkspace', {
>  			    handler: function() {
>  				PVE.data.ResourceStore.stopUpdate();

i would like to not only stop the store, but also
remove all values from it, because otherwise if you play around with
the javascript console, you still can get the data out of the store
(like which vm exists, which nodes, etc.)

>  				me.showLogin();
> -				me.setContent();
> +				me.setContent(null);
>  				var rt = me.down('pveResourceTree');
>  				rt.clearTree();
> +
> +				// empty the stores of the StatusPanel child items
> +				var statusPanels = Ext.ComponentQuery.query('pveStatusPanel grid');
> +				Ext.Array.forEach(statusPanels, function(comp) {
> +				    if (comp.getStore()) {
> +					comp.getStore().loadData([], false);
> +				    }
> +				});
>  			    }
>  			}
>  		    ]
>

Rest looks good and works like intended




More information about the pve-devel mailing list