@@ -19,35 +19,43 @@ jQuery(document).ready(function () {
19
19
var frontendServiceUrl = $ ( '#frontendServiceUrl' ) . text ( ) ;
20
20
var frontendServiceBackEndPath = "/backend" ;
21
21
22
+ var routes = { } ;
23
+ routes [ "subscriptions" ] = function ( ) {
24
+ updateBackEndInstanceList ( ) ;
25
+ $ ( ".app-header" ) . removeClass ( "header-bar-hidden" ) ;
26
+ $ ( ".main" ) . load ( "subscriptionpage.html" ) ;
27
+ } ;
28
+ routes [ "test-rules" ] = function ( ) {
29
+ updateBackEndInstanceList ( ) ;
30
+ $ ( ".app-header" ) . removeClass ( "header-bar-hidden" ) ;
31
+ $ ( ".main" ) . load ( "testRules.html" ) ;
32
+ } ;
33
+ routes [ "ei-info" ] = function ( ) {
34
+ updateBackEndInstanceList ( ) ;
35
+ $ ( ".app-header" ) . removeClass ( "header-bar-hidden" ) ;
36
+ $ ( ".main" ) . load ( "eiInfo.html" ) ;
37
+ } ;
38
+ routes [ "switch-backend" ] = function ( ) {
39
+ $ ( ".app-header" ) . addClass ( "header-bar-hidden" ) ;
40
+ $ ( ".main" ) . load ( "switch-backend.html" ) ;
41
+ } ;
42
+ routes [ "add-backend" ] = function ( ) {
43
+ $ ( ".app-header" ) . addClass ( "header-bar-hidden" ) ;
44
+ $ ( ".main" ) . load ( "add-instances.html" ) ;
45
+ } ;
46
+ routes [ "login" ] = function ( ) {
47
+ updateBackEndInstanceList ( ) ;
48
+ $ ( ".app-header" ) . removeClass ( "header-bar-hidden" ) ;
49
+ $ ( ".main" ) . load ( "login.html" ) ;
50
+ } ;
51
+
22
52
router . on ( {
23
- 'subscriptions' : function ( ) {
24
- updateBackEndInstanceList ( ) ;
25
- $ ( ".app-header" ) . removeClass ( "header-bar-hidden" ) ;
26
- $ ( ".main" ) . load ( "subscriptionpage.html" ) ;
27
- } ,
28
- 'test-rules' : function ( ) {
29
- updateBackEndInstanceList ( ) ;
30
- $ ( ".app-header" ) . removeClass ( "header-bar-hidden" ) ;
31
- $ ( ".main" ) . load ( "testRules.html" ) ;
32
- } ,
33
- 'ei-info' : function ( ) {
34
- updateBackEndInstanceList ( ) ;
35
- $ ( ".app-header" ) . removeClass ( "header-bar-hidden" ) ;
36
- $ ( ".main" ) . load ( "eiInfo.html" ) ;
37
- } ,
38
- 'switch-backend' : function ( ) {
39
- $ ( ".app-header" ) . addClass ( "header-bar-hidden" ) ;
40
- $ ( ".main" ) . load ( "switch-backend.html" ) ;
41
- } ,
42
- 'add-backend' : function ( ) {
43
- $ ( ".app-header" ) . addClass ( "header-bar-hidden" ) ;
44
- $ ( ".main" ) . load ( "add-instances.html" ) ;
45
- } ,
46
- 'login' : function ( ) {
47
- updateBackEndInstanceList ( ) ;
48
- $ ( ".app-header" ) . removeClass ( "header-bar-hidden" ) ;
49
- $ ( ".main" ) . load ( "login.html" ) ;
50
- } ,
53
+ 'subscriptions' : routes [ "subscriptions" ] ,
54
+ 'test-rules' : routes [ "test-rules" ] ,
55
+ 'ei-info' : routes [ "ei-info" ] ,
56
+ 'switch-backend' : routes [ "switch-backend" ] ,
57
+ 'add-backend' : routes [ "add-backend" ] ,
58
+ 'login' : routes [ "login" ] ,
51
59
'*' : function ( ) {
52
60
router . navigate ( 'subscriptions' ) ;
53
61
}
@@ -150,8 +158,8 @@ jQuery(document).ready(function () {
150
158
window . logMessages ( XMLHttpRequest . responseText ) ;
151
159
} ,
152
160
success : function ( responseData , XMLHttpRequest , textStatus ) {
153
- console . log ( "Response from IE front end back end: " + responseData . message ) ;
154
- location . reload ( ) ;
161
+ const currentUrl = router . _lastRouteResolved . url ;
162
+ routes [ currentUrl ] ( ) ;
155
163
}
156
164
} ) ;
157
165
} else {
0 commit comments