22 <v-card
33 v-if =" all_required_params_are_available"
44 elevation =" 2"
5+ :class =" { 'disabled-failsafe': is_disabled }"
56 class =" mb-4 mt-4 pa-4 d-flex flex-row flex-grow-0 justify-left failsafe-card"
67 >
78 <div class =" ma-4" >
2425 {{ param.replacementTitle ?? param.name }}
2526 </v-col >
2627 <v-col :key =" `${param.name}-editor`" cols =" 5" class =" pt-1 pb-1" >
27- <inline-parameter-editor :key =" failsafeDefinition.name" :auto-set =" true" :param =" params[param.name]" />
28+ <inline-parameter-editor
29+ :key =" failsafeDefinition.name"
30+ :auto-set =" true"
31+ :disabled =" is_disabled && param.name !== actionParamName"
32+ :param =" params[param.name]"
33+ />
2834 </v-col >
2935 </v-row >
3036 </div >
@@ -74,6 +80,16 @@ export default Vue.extend({
7480 available_params(): ParamDefinitions [] {
7581 return this .failsafeDefinition .params .filter ((param ) => param .name in this .params )
7682 },
83+ is_disabled(): boolean {
84+ const controlParam = this .findControlParam ()
85+ if (! controlParam || ! (controlParam .name in this .params )) {
86+ return false
87+ }
88+ return this .params [controlParam .name ].value === 0
89+ },
90+ actionParamName(): string | undefined {
91+ return this .findControlParam ()?.name
92+ },
7793 },
7894 mounted() {
7995 this .loadImage ()
@@ -84,6 +100,18 @@ export default Vue.extend({
84100 this .image = response .data
85101 })
86102 },
103+ findControlParam(): ParamDefinitions | undefined {
104+ const enableParam = this .failsafeDefinition .params .find (
105+ (p ) => p .replacementTitle === ' Enable' || p .name .includes (' _ENABLE' ),
106+ )
107+ if (enableParam ) {
108+ return enableParam
109+ }
110+
111+ return this .failsafeDefinition .params .find (
112+ (p ) => p .replacementTitle === ' Action' ,
113+ )
114+ },
87115 },
88116
89117})
@@ -106,4 +134,35 @@ i.svg-icon svg {
106134 text-align : end ;
107135 margin : auto ;
108136}
137+
138+ .disabled-failsafe {
139+ border : 1px solid var (--v-warning-base ) !important ;
140+ position : relative ;
141+ }
142+
143+ .disabled-failsafe :hover {
144+ border-color : var (--v-warning-lighten1 ) !important ;
145+ box-shadow : 0 2px 8px rgba (224 , 166 , 0 , 0.2 );
146+ }
147+
148+ .disabled-failsafe ::after {
149+ content : ' DISABLED' ;
150+ position : absolute ;
151+ top : 8px ;
152+ right : 8px ;
153+ background-color : var (--v-warning-base );
154+ color : white ;
155+ padding : 3px 6px ;
156+ border-radius : 3px ;
157+ font-size : 9px ;
158+ font-weight : 600 ;
159+ letter-spacing : 0.5px ;
160+ z-index : 2 ;
161+ pointer-events : none ;
162+ }
163+
164+ .disabled-failsafe .svg-icon {
165+ opacity : 0.7 ;
166+ filter : grayscale (30% );
167+ }
109168 </style >
0 commit comments