[Kimchi-devel] [PATCH] Fix displaying numerous error msgs when host is shut down

Daniel Henrique Barboza dhbarboza82 at gmail.com
Mon Jul 13 19:29:19 UTC 2015


Reviewed-by: Daniel Barboza <dhbarboza82 at gmail.com>

ps: I'll remove the extra blank line when pushing it

On 07/13/2015 04:18 PM, Socorro Stoppler wrote:
> From: Socorro Stoppler <socorrob at us.ibm.com>
>
> Fix displaying numerous error msgs when host is shut down
>
> Signed-off-by: Socorro Stoppler <socorrob at us.ibm.com>
> ---
>   ui/js/src/kimchi.main.js | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/kimchi.main.js
> index 0d4ad43..763834a 100644
> --- a/ui/js/src/kimchi.main.js
> +++ b/ui/js/src/kimchi.main.js
> @@ -300,6 +300,7 @@ kimchi.main = function() {
>       };
>   
>       var initUI = function() {
> +        var errorMsg = "";
>           $(document).bind('ajaxError', function(event, jqXHR, ajaxSettings, errorThrown) {
>               if (!ajaxSettings['kimchi']) {
>                   return;
> @@ -314,8 +315,9 @@ kimchi.main = function() {
>                   document.location.href= isSessionTimeout ? 'login.html?error=sessionTimeout' : 'login.html';
>                   return;
>               }
> -            else if((jqXHR['status'] == 0) && ("error"==jqXHR.statusText) && !kimchi.isLoggingOut) {
> -                kimchi.message.error(i18n['KCHAPI6007E'].replace("%1", jqXHR.state()));
> +            else if((jqXHR['status'] == 0) && ("error"==jqXHR.statusText) && !kimchi.isLoggingOut && errorMsg == "") {
> +               errorMsg = i18n['KCHAPI6007E'].replace("%1", jqXHR.state());
> +               kimchi.message.error(errorMsg);
>               }
>               if(ajaxSettings['originalError']) {
>                   ajaxSettings['originalError'](jqXHR, jqXHR.statusText, errorThrown);
> @@ -325,6 +327,7 @@ kimchi.main = function() {
>           kimchi.user.showUser(true);
>           initListeners();
>           updatePage();
> +
>       };
>   
>       // Load i18n translation strings first and then render the page.




More information about the Kimchi-devel mailing list