@@ -16,6 +16,7 @@ angular.module('serverMonitor', [
16
16
. service ( 'ServerMonitor' ,
17
17
function ( $modal , $rootScope , ChartModel , growl , locale , UserService ) {
18
18
var modalInstance = null ;
19
+ var reset = false ;
19
20
20
21
/**
21
22
* Listen for the online/offline broadcasts and display a modal
@@ -24,7 +25,15 @@ angular.module('serverMonitor', [
24
25
this . monitor = function ( ) {
25
26
$rootScope . $on ( "habminOnline" , function ( event , status ) {
26
27
if ( status == false ) {
27
- if ( modalInstance == null ) {
28
+ if ( modalInstance == null && reset == false ) {
29
+ reset = true ;
30
+ var scope = $rootScope . $new ( ) ;
31
+
32
+ scope . cancel = function ( ) {
33
+ modalInstance . dismiss ( "cancel" ) ;
34
+ modalInstance = null ;
35
+ } ;
36
+
28
37
modalInstance = $modal . open ( {
29
38
backdrop : 'static' ,
30
39
keyboard : true ,
@@ -34,14 +43,21 @@ angular.module('serverMonitor', [
34
43
'<span class="fa fa-exclamation-triangle text-danger"></span>' +
35
44
' ' +
36
45
'<span i18n="habmin.StatusOffline"></span>' +
37
- '</h3></div>' ,
38
- windowClass : UserService . getTheme ( )
46
+ '</h3></div>' +
47
+ '<div class="modal-footer">' +
48
+ '<button class="btn btn-xs btn-warning" type="button" ng-click="cancel()" i18n="common.close"></button>' +
49
+ '</div>' ,
50
+ windowClass : UserService . getTheme ( ) ,
51
+ scope : scope
39
52
} ) ;
40
53
}
41
54
}
42
- else if ( modalInstance != null ) {
43
- modalInstance . close ( ) ;
44
- modalInstance = null ;
55
+ else {
56
+ reset = false ;
57
+ if ( modalInstance != null ) {
58
+ modalInstance . close ( ) ;
59
+ modalInstance = null ;
60
+ }
45
61
}
46
62
} ) ;
47
63
} ;
0 commit comments