122
122
</v-tooltip >
123
123
</v-system-bar >
124
124
<v-expand-transition v-if =" !editDialog" >
125
- <div class =" pa-1" ref =" screen" v-show =" expand" >
125
+ <div
126
+ class =" pa-1"
127
+ style =" position : relative "
128
+ ref =" screen"
129
+ v-show =" expand"
130
+ >
131
+ <v-overlay
132
+ style =" pointer-events : none "
133
+ :value =" errors.length !== 0"
134
+ opacity =" 0.8"
135
+ absolute
136
+ />
126
137
<vertical-widget
127
138
:key =" screenKey"
128
139
:widgets =" layoutStack[0].widgets"
151
162
<span > Screen: {{ target }} {{ screen }} Errors </span >
152
163
<v-spacer />
153
164
</v-system-bar >
154
- <v-card class =" pa-3" >
155
- <v-row class =" my-3" >
156
- <v-textarea readonly rows =" 13" :value =" error" />
157
- </v-row >
158
- <v-row >
159
- <v-btn block @click =" clearErrors" > Clear </v-btn >
160
- </v-row >
165
+ <v-card >
166
+ <v-textarea class =" errors" readonly rows =" 13" :value =" error" />
161
167
</v-card >
162
168
</v-dialog >
163
169
</div >
@@ -263,6 +269,7 @@ export default {
263
269
editDialog: false ,
264
270
expand: true ,
265
271
configParser: null ,
272
+ configError: false ,
266
273
currentLayout: null ,
267
274
layoutStack: [],
268
275
namedWidgets: {},
@@ -341,10 +348,11 @@ export default {
341
348
} else {
342
349
this .errors .push ({
343
350
type: ' error' ,
344
- message: ` ${ err} ` ,
351
+ message: err,
345
352
time: new Date ().getTime (),
346
353
})
347
354
}
355
+ this .configError = true
348
356
return false
349
357
},
350
358
created () {
@@ -380,6 +388,7 @@ export default {
380
388
},
381
389
clearErrors : function () {
382
390
this .errors = []
391
+ this .configError = false
383
392
},
384
393
updateRefreshInterval : function () {
385
394
let refreshInterval = this .pollingPeriod * 1000
@@ -392,7 +401,7 @@ export default {
392
401
},
393
402
parseDefinition : function () {
394
403
// Each time we start over and parse the screen definition
395
- this .errors = []
404
+ this .clearErrors ()
396
405
this .namedWidgets = {}
397
406
this .layoutStack = []
398
407
this .dynamicWidgets = []
@@ -470,6 +479,7 @@ export default {
470
479
lineNumber: lines .join (' ,' ),
471
480
time: new Date ().getTime (),
472
481
})
482
+ this .configError = true
473
483
// Create a simple VerticalWidget to replace the bad widget so
474
484
// the layout stack can successfully unwind
475
485
this .layoutStack [0 ] = {
@@ -725,18 +735,31 @@ export default {
725
735
})
726
736
},
727
737
update : function () {
728
- if (this .screenItems .length !== 0 && this .errors . length === 0 ) {
738
+ if (this .screenItems .length !== 0 && this .configError === false ) {
729
739
this .api
730
740
.get_tlm_values (this .screenItems , this .staleTime )
731
741
.then ((data ) => {
742
+ this .clearErrors ()
732
743
this .updateValues (data)
733
744
})
734
745
.catch ((error ) => {
735
- this .errors .push ({
736
- type: ' usage' ,
737
- message: error .message ,
738
- time: new Date ().getTime (),
739
- })
746
+ let message = JSON .stringify (error, null , 2 )
747
+ // Anything other than 'no response received' which means the API server is down
748
+ // is an error the user needs to fix so don't request values until they do
749
+ if (! message .includes (' no response received' )) {
750
+ this .configError = true
751
+ }
752
+ if (
753
+ ! this .errors .find ((existing ) => {
754
+ existing .message === message
755
+ })
756
+ ) {
757
+ this .errors .push ({
758
+ type: ' error' ,
759
+ message: message,
760
+ time: new Date ().getTime (),
761
+ })
762
+ }
740
763
})
741
764
}
742
765
},
@@ -760,6 +783,10 @@ export default {
760
783
</script >
761
784
762
785
<style scoped>
786
+ .errors {
787
+ padding-top : 0px ;
788
+ margin-top : 0px ;
789
+ }
763
790
.v-card {
764
791
background-color : var (--v-tertiary-darken2 );
765
792
}
0 commit comments