UIGauge: Add error message when things go pear shaped

We really need to fix the width of these panels though, the width (and 
hence height) is all wrong
This commit is contained in:
Starbeamrainbowlabs 2022-04-03 02:53:41 +01:00
parent 1d537e9334
commit 97cb8b4432
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -1,6 +1,7 @@
"use strict";
import Emel from 'emel';
import forkawesome_emel from './forkawesome_emel.mjs';
import ApexCharts from 'apexcharts';
import AbstractUIItem from './AbstractUIItem.mjs';
@ -98,6 +99,9 @@ class UIGauge extends AbstractUIItem {
break;
default:
console.warn(`Warning: Unknown UIGauge content type '${typeof this.def.content}' for def with name '${this.def.name}'.`);
this.el.querySelector(".container-gauge").replaceChildren(
this.emel(`div[class="message-error"]>${forkawesome_emel("exclamation-circle")}+{Oops! An error occurred while rendering this chart. Check the developer tools for more information.}`)
)
return false;
}