@@ -10,25 +10,23 @@ jQuery(function () {
10
10
var pluginName = RDPLUGIN [ 'exec-mode-ui' ] ;
11
11
var pluginBase = rundeckPage . pluginBaseUrl ( pluginName ) ;
12
12
13
- console . log ( pagePath )
14
-
15
- if ( pagePath == 'menu/projectHome' ) {
13
+ if ( pagePath === 'menu/projectHome' ) {
16
14
var project = rundeckPage . project ( ) ;
17
15
var status = getProjectStatus ( project )
18
16
var messages = [ ]
19
17
20
- if ( status . execution . active ) {
18
+ if ( status && status . execution && status . execution . active ) {
21
19
messages . push ( status . execution . msg )
22
20
}
23
21
24
- if ( status . schedule . active ) {
22
+ if ( status && status . schedule && status . schedule . active ) {
25
23
messages . push ( status . schedule . msg )
26
24
27
25
}
28
26
appendListMessage ( messages )
29
27
}
30
28
31
- if ( pagePath == 'framework/editProject' ) {
29
+ if ( pagePath === 'framework/editProject' ) {
32
30
33
31
jQuery ( ".projectConfigurableTitle" ) . css ( 'font-weight' , 'bold' ) ;
34
32
jQuery ( ".projectConfigurableTitle" ) . after ( "<br>" ) ;
@@ -39,11 +37,11 @@ jQuery(function () {
39
37
var status = getProjectStatus ( project )
40
38
var messages = [ ]
41
39
42
- if ( status . execution . active ) {
40
+ if ( status && status . execution && status . execution . active ) {
43
41
messages . push ( status . execution . msg )
44
42
}
45
43
46
- if ( status . schedule . active ) {
44
+ if ( status && status . schedule && status . schedule . active ) {
47
45
messages . push ( status . schedule . msg )
48
46
49
47
}
@@ -200,14 +198,14 @@ jQuery(function () {
200
198
var action = null
201
199
202
200
if ( type == "execution" ) {
203
- if ( status . execution . active == true ) {
201
+ if ( status && status . execution && status . execution . active == true ) {
204
202
msg = status . execution . msg
205
203
action = status . execution . action
206
204
}
207
205
}
208
206
209
207
if ( type == "schedule" ) {
210
- if ( status . schedule . active == true ) {
208
+ if ( status && status . schedule && status . schedule . active == true ) {
211
209
msg = status . schedule . msg
212
210
action = status . schedule . action
213
211
}
0 commit comments