Skip to content

Commit

Permalink
Nice error message widget items without limits
Browse files Browse the repository at this point in the history
  • Loading branch information
jmthomas committed Dec 19, 2024
1 parent 620b543 commit 27a72df
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -779,4 +779,8 @@ export default {
.v-textarea :deep(textarea) {
padding: 5px;
}
.v-textarea .v-field__input {
-webkit-mask-image: unset;
mask-image: unset;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ export default {
},
methods: {
modifyLimits(limitsSettings) {
if (!limitsSettings) {
return
}
// By default the red bars take 10% of the display
this.redLow = 10
this.redHigh = 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,17 @@ export default {
computed: {
limitsRange() {
let values = this.limitsSettings[this.selectedLimitsSet]
// Format like the DetailsDialog formatLimit function
if (values.length === 4) {
return `RL/${values[0]} YL/${values[1]} YH/${values[2]} RH/${values[3]}`
if (values) {
// Format like the DetailsDialog formatLimit function
if (values.length === 4) {
return `RL/${values[0]} YL/${values[1]} YH/${values[2]} RH/${values[3]}`
} else {
return `RL/${values[0]} YL/${values[1]} YH/${values[2]} RH/${values[3]} GL/${values[4]} GH/${values[5]}`
}
} else {
return `RL/${values[0]} YL/${values[1]} YH/${values[2]} RH/${values[3]} GL/${values[4]} GH/${values[5]}`
throw new Error(
`Item ${this.parameters.slice(0, 3).join(' ')} has no limits settings`,
)
}
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,25 @@ export default {
let limits = this.modifyLimits(
this.limitsSettings[this.selectedLimitsSet],
)
this.calcLimits(limits)
return {
'--height': this.height + 'px',
'--width': this.width + 'px',
'--container-width': this.width - 5 + 'px',
'--position': this.calcPosition(value, limits) + '%',
'--redlow-height': this.redLow + '%',
'--redhigh-height': this.redHigh + '%',
'--yellowlow-height': this.yellowLow + '%',
'--yellowhigh-height': this.yellowHigh + '%',
'--greenlow-height': this.greenLow + '%',
'--greenhigh-height': this.greenHigh + '%',
'--blue-height': this.blue + '%',
if (limits) {
this.calcLimits(limits)
return {
'--height': this.height + 'px',
'--width': this.width + 'px',
'--container-width': this.width - 5 + 'px',
'--position': this.calcPosition(value, limits) + '%',
'--redlow-height': this.redLow + '%',
'--redhigh-height': this.redHigh + '%',
'--yellowlow-height': this.yellowLow + '%',
'--yellowhigh-height': this.yellowHigh + '%',
'--greenlow-height': this.greenLow + '%',
'--greenhigh-height': this.greenHigh + '%',
'--blue-height': this.blue + '%',
}
} else {
throw new Error(
`Item ${this.parameters.slice(0, 3).join(' ')} has no limits settings`,
)
}
},
},
Expand Down

0 comments on commit 27a72df

Please sign in to comment.