diff --git a/src/app/home/serverMonitor.js b/src/app/home/serverMonitor.js index 813a1151..014946d1 100644 --- a/src/app/home/serverMonitor.js +++ b/src/app/home/serverMonitor.js @@ -16,6 +16,7 @@ angular.module('serverMonitor', [ .service('ServerMonitor', function ($modal, $rootScope, ChartModel, growl, locale, UserService) { var modalInstance = null; + var reset = false; /** * Listen for the online/offline broadcasts and display a modal @@ -24,7 +25,15 @@ angular.module('serverMonitor', [ this.monitor = function () { $rootScope.$on("habminOnline", function (event, status) { if (status == false) { - if (modalInstance == null) { + if (modalInstance == null && reset == false) { + reset = true; + var scope = $rootScope.$new(); + + scope.cancel = function () { + modalInstance.dismiss("cancel"); + modalInstance = null; + }; + modalInstance = $modal.open({ backdrop: 'static', keyboard: true, @@ -34,14 +43,21 @@ angular.module('serverMonitor', [ '' + ' ' + '' + - '', - windowClass: UserService.getTheme() + '' + + '
', + windowClass: UserService.getTheme(), + scope: scope }); } } - else if (modalInstance != null) { - modalInstance.close(); - modalInstance = null; + else { + reset = false; + if (modalInstance != null) { + modalInstance.close(); + modalInstance = null; + } } }); };