File tree 2 files changed +26
-15
lines changed
applications/rest-service/src/main
java/org/springframework/sbm 2 files changed +26
-15
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2021 - 2022 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
1
16
package org .springframework .sbm ;
2
17
3
18
import org .springframework .beans .factory .annotation .Autowired ;
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ class State {
7
7
8
8
isRunningARecipe ( ) {
9
9
return this . runningARecipe ;
10
- this . notifyListeners ( ) ;
11
10
}
12
11
13
12
startedRunningRecipe ( ) {
@@ -62,37 +61,34 @@ function runRecipe(element) {
62
61
*/
63
62
function applyRecipes ( btn ) {
64
63
65
- console . log ( "applying recipes: " + $ ( btn ) . attr ( 'recipe' ) ) ;
64
+ const recipeName = $ ( btn ) . attr ( 'recipe' ) ;
65
+
66
66
if ( state . isRunningARecipe ( ) ) {
67
67
return ;
68
68
}
69
69
70
- console . log ( this )
71
-
72
70
$ . ajax ( {
73
71
type : "POST" ,
74
72
url : "http://localhost:8080/spring-boot-upgrade" ,
75
- dataType : "json" ,
76
73
contentType : 'application/json' ,
77
74
data : JSON . stringify ( {
78
75
recipes : $ ( btn ) . attr ( 'recipe' )
79
76
} ) ,
80
77
beforeSend : function ( ) {
81
- console . log ( "before" )
82
78
state . startedRunningRecipe ( ) ;
83
79
} ,
84
- success : function ( ) {
85
- // remove this section from the report
86
- jQuery ( this ) . closest ( 'h3' ) . next ( ) . remove ( ) ;
87
-
88
- } ,
89
80
error : function ( ) {
90
81
// mark red flashlights / play alarm sound
91
82
}
92
- } ) . always ( function ( ) {
93
- console . log ( "finished recipes" )
94
- state . completedRunningRecipe ( ) ;
95
- } ) ;
83
+ } )
84
+ . done ( function ( ) {
85
+ $ ( `.run-a-recipe[recipe='${ recipeName } ']` )
86
+ . closest ( ".sect2" )
87
+ . remove ( ) ;
88
+ } )
89
+ . always ( function ( ) {
90
+ state . completedRunningRecipe ( ) ;
91
+ } ) ;
96
92
}
97
93
98
94
$ ( document ) . ajaxStart ( function ( ) {
You can’t perform that action at this time.
0 commit comments