@@ -18,20 +18,20 @@ function multipleInstancesModel(data) {
18
18
}
19
19
self . removeInstance = function ( ) {
20
20
self . instances . remove ( this ) ;
21
- $ . ajax ( {
22
- url : "/switch-backend" ,
23
- type : "DELETE" ,
24
- data : ko . toJSON ( self . instances ) ,
25
- contentType : 'application/json; charset=utf-8' ,
26
- cache : false ,
27
- error : function ( XMLHttpRequest , textStatus , errorThrown ) {
28
- $ . jGrowl ( XMLHttpRequest . responseText , { sticky : false , theme : 'Error' } ) ;
29
- } ,
30
- success : function ( responseData , textStatus ) {
31
- $ . jGrowl ( "Backend instance was deleted" , { sticky : false , theme : 'Notify' } ) ;
32
- $ ( "#mainFrame" ) . load ( "switch-backend.html" ) ;
33
- }
34
- } ) ;
21
+ $ . ajax ( {
22
+ url : "/switch-backend" ,
23
+ type : "DELETE" ,
24
+ data : ko . toJSON ( self . instances ) ,
25
+ contentType : 'application/json; charset=utf-8' ,
26
+ cache : false ,
27
+ error : function ( XMLHttpRequest , textStatus , errorThrown ) {
28
+ $ . jGrowl ( XMLHttpRequest . responseText , { sticky : false , theme : 'Error' } ) ;
29
+ } ,
30
+ success : function ( responseData , textStatus ) {
31
+ $ . jGrowl ( "Backend instance was deleted" , { sticky : false , theme : 'Notify' } ) ;
32
+ $ ( "#mainFrame" ) . load ( "switch-backend.html" ) ;
33
+ }
34
+ } ) ;
35
35
}
36
36
self . submit = function ( instances ) {
37
37
var count = 0 ;
@@ -59,22 +59,21 @@ function multipleInstancesModel(data) {
59
59
} ) ;
60
60
} else {
61
61
$ . jGrowl ( "Please choose one backend instance" , { sticky : false , theme : 'Error' } ) ;
62
- }
62
+ }
63
63
}
64
64
}
65
- $ . ajax ( {
66
- url : "/get-instances" ,
67
- type : "GET" ,
68
- contentType : 'application/json; charset=utf-8' ,
69
- cache : false ,
70
- error : function ( XMLHttpRequest , textStatus , errorThrown ) {
71
- $ . jGrowl ( XMLHttpRequest . responseText , { sticky : false , theme : 'Error' } ) ;
72
- } ,
73
- success : function ( responseData , textStatus ) {
74
- var observableObject = $ ( "#instancesModel" ) [ 0 ] ;
75
- ko . cleanNode ( observableObject ) ;
76
- ko . applyBindings ( new multipleInstancesModel ( responseData ) , observableObject ) ;
77
-
78
- }
79
- } )
65
+ $ . ajax ( {
66
+ url : "/get-instances" ,
67
+ type : "GET" ,
68
+ contentType : 'application/json; charset=utf-8' ,
69
+ cache : false ,
70
+ error : function ( XMLHttpRequest , textStatus , errorThrown ) {
71
+ $ . jGrowl ( XMLHttpRequest . responseText , { sticky : false , theme : 'Error' } ) ;
72
+ } ,
73
+ success : function ( responseData , textStatus ) {
74
+ var observableObject = $ ( "#instancesModel" ) [ 0 ] ;
75
+ ko . cleanNode ( observableObject ) ;
76
+ ko . applyBindings ( new multipleInstancesModel ( responseData ) , observableObject ) ;
77
+ }
78
+ } )
80
79
} ) ;
0 commit comments