73
73
<v-tooltip
74
74
:top =" scrollY <= 20"
75
75
:bottom =" scrollY > 20"
76
- :disabled =" condition.status"
76
+ :disabled =" condition.status === 'True' "
77
77
>
78
78
<template v-slot :activator =" { on , attrs } " >
79
79
<v-chip
89
89
v-bind =" attrs"
90
90
v-on =" on"
91
91
>
92
- <!-- :color="($vuetify.theme.dark) ? getType(condition) : 'white'"
93
- :text-color="($vuetify.theme.dark) ? 'black' : getType(condition)" -->
94
92
<StatusIcon
95
- :type =" ( condition.status) ? 'success' : condition.severity. toLowerCase()"
93
+ :type =" condition.status === 'True' ? 'success' : ( condition.Status === 'Unknown' ? 'unknown' : (condition. severity ? condition.severity. toLowerCase() : 'unknown' ) )"
96
94
:spinnerWidth =" 2"
97
95
left
98
96
>
97
+ <!-- TODO: verify that StatusIcon works when passing in undefined as type, i.e. if condition.severity is undefined -->
99
98
</StatusIcon >
100
99
{{ condition.type }}
101
100
</v-chip >
102
101
</template >
103
- <span >{{ condition.severity }}: {{ condition.reason }}</span >
102
+ <span v-if =" condition.severity && condition.reason" >{{ condition.severity }}: {{ condition.reason }}</span >
103
+ <span v-else-if =" condition.severity" >{{ condition.severity }}</span >
104
+ <span v-else-if =" condition.reason" >{{ condition.reason }}</span >
105
+ <span v-else >Unknown</span >
104
106
</v-tooltip >
105
107
</div >
106
108
</div >
@@ -201,11 +203,9 @@ export default {
201
203
},
202
204
methods: {
203
205
getType (condition ) {
204
- return condition .status
205
- ? " success"
206
- : condition .isError
207
- ? " error"
208
- : " warning" ;
206
+ if (condition .status === " True" ) return " success" ;
207
+ else if (condition .isError || ! condition .severity || condition .status === " Unknown" ) return " error" ; // if severity is undefined, we assume it's an error
208
+ else return " warning" ;
209
209
},
210
210
onScroll (e ) {
211
211
this .scrollY = window .scrollY ;
@@ -230,7 +230,7 @@ export default {
230
230
conditions .forEach ((e , i ) => {
231
231
this .conditions .push ({
232
232
type: e .type ,
233
- status: e .status === " True " ,
233
+ status: e .status ,
234
234
isError: e .severity === " Error" ,
235
235
severity: e .severity ,
236
236
reason: e .reason ,
@@ -258,6 +258,7 @@ export default {
258
258
watch: {
259
259
jsonItems: {
260
260
handler (val , old ) {
261
+ console .log (" Val is" , val);
261
262
this .setConditions (val? .status ? .conditions );
262
263
},
263
264
},
0 commit comments