mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-10 15:24:51 +02:00
🥅 Adds an option to surpress widget errors
This commit is contained in:
parent
9faab35a57
commit
2ef5b66e9e
@ -74,6 +74,7 @@ Dashy has support for displaying dynamic content in the form of widgets. There a
|
|||||||
- [Continuous Updates](#continuous-updates)
|
- [Continuous Updates](#continuous-updates)
|
||||||
- [Proxying Requests](#proxying-requests)
|
- [Proxying Requests](#proxying-requests)
|
||||||
- [Setting Timeout](#setting-timeout)
|
- [Setting Timeout](#setting-timeout)
|
||||||
|
- [Ignoring Errors](#ignoring-errors)
|
||||||
- [Custom CSS Styling](#widget-styling)
|
- [Custom CSS Styling](#widget-styling)
|
||||||
- [Customizing Charts](#customizing-charts)
|
- [Customizing Charts](#customizing-charts)
|
||||||
- [Language Translations](#language-translations)
|
- [Language Translations](#language-translations)
|
||||||
@ -2040,6 +2041,21 @@ For example:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### Ignoring Errors
|
||||||
|
|
||||||
|
When there's an error fetching or displaying a widgets data, then it will be highlighted in yellow, and a message displayed on the UI.
|
||||||
|
|
||||||
|
In some instances, this is a false positive, and the widget is actually functioning correctly. If this is the case, you can disable the UI error message of a given widget by setting: `ignoreErrors: true`
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- type: gl-disk-io
|
||||||
|
ignoreErrors: true
|
||||||
|
options:
|
||||||
|
hostname: https://glances.dns-device.local
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### Widget Styling
|
### Widget Styling
|
||||||
|
|
||||||
Like elsewhere in Dashy, all colours can be easily modified with CSS variables.
|
Like elsewhere in Dashy, all colours can be easily modified with CSS variables.
|
||||||
|
@ -541,11 +541,12 @@ export default {
|
|||||||
widgetOptions() {
|
widgetOptions() {
|
||||||
const options = this.widget.options || {};
|
const options = this.widget.options || {};
|
||||||
const timeout = this.widget.timeout || null;
|
const timeout = this.widget.timeout || null;
|
||||||
|
const ignoreErrors = this.widget.ignoreErrors || false;
|
||||||
const useProxy = this.appConfig.widgetsAlwaysUseProxy || !!this.widget.useProxy;
|
const useProxy = this.appConfig.widgetsAlwaysUseProxy || !!this.widget.useProxy;
|
||||||
const updateInterval = this.widget.updateInterval !== undefined
|
const updateInterval = this.widget.updateInterval !== undefined
|
||||||
? this.widget.updateInterval : null;
|
? this.widget.updateInterval : null;
|
||||||
return {
|
return {
|
||||||
timeout, useProxy, updateInterval, ...options,
|
timeout, ignoreErrors, useProxy, updateInterval, ...options,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
/* A unique string to reference the widget by */
|
/* A unique string to reference the widget by */
|
||||||
|
@ -74,7 +74,9 @@ const WidgetMixin = {
|
|||||||
/* Called when an error occurs. Logs to handler, and passes to parent component */
|
/* Called when an error occurs. Logs to handler, and passes to parent component */
|
||||||
error(msg, stackTrace) {
|
error(msg, stackTrace) {
|
||||||
ErrorHandler(msg, stackTrace);
|
ErrorHandler(msg, stackTrace);
|
||||||
this.$emit('error', msg);
|
if (!this.options.ignoreErrors) {
|
||||||
|
this.$emit('error', msg);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/* When a data request update starts, show loader */
|
/* When a data request update starts, show loader */
|
||||||
startLoading() {
|
startLoading() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user