From 4210c985b7ffebadc5d716791525bc99638bf7b3 Mon Sep 17 00:00:00 2001 From: Lissy93 Date: Sat, 2 Jul 2022 22:28:09 +0100 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=8E=A8=20Adds=20section-specific=20cl?= =?UTF-8?q?ass=20names=20(#769)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/LinkItems/Collapsable.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/LinkItems/Collapsable.vue b/src/components/LinkItems/Collapsable.vue index 75f4bc37..874a9345 100644 --- a/src/components/LinkItems/Collapsable.vue +++ b/src/components/LinkItems/Collapsable.vue @@ -2,7 +2,7 @@
@@ -74,6 +74,10 @@ export default { const { rows, cols, checkSpanNum } = this; return `${checkSpanNum(cols, 'col')} ${checkSpanNum(rows, 'row')}`; }, + sectionClassName() { + if (!this.title) return 'unnamed-section'; + return `section_${this.title.replaceAll(' ', '-').toLowerCase()}`; + }, /* Used to fetch initial collapse state, and set new collapse state on change */ isExpanded: { get() { From eff49995b9e29464b7e09aacaafdffd0de666ce5 Mon Sep 17 00:00:00 2001 From: Lissy93 Date: Sat, 2 Jul 2022 22:28:39 +0100 Subject: [PATCH 2/4] =?UTF-8?q?=E2=9C=A8=20Adds=20option=20for=20widget=20?= =?UTF-8?q?labels=20(#769)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/LinkItems/ItemIcon.vue | 2 +- src/components/Widgets/WidgetBase.vue | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/LinkItems/ItemIcon.vue b/src/components/LinkItems/ItemIcon.vue index 97c231cf..7345d8a0 100644 --- a/src/components/LinkItems/ItemIcon.vue +++ b/src/components/LinkItems/ItemIcon.vue @@ -123,7 +123,7 @@ export default { if (emojiLookup[emojiCode]) { return emojiLookup[emojiCode]; } else { - this.imageNotFound(`No emoji found with name '${emojiCode}'`); + // this.imageNotFound(`No emoji found with name '${emojiCode}'`); return null; } }, diff --git a/src/components/Widgets/WidgetBase.vue b/src/components/Widgets/WidgetBase.vue index bb052bff..552f13ff 100644 --- a/src/components/Widgets/WidgetBase.vue +++ b/src/components/Widgets/WidgetBase.vue @@ -18,6 +18,8 @@

{{ errorMsg }}

+ +
{{ widgetOptions.label }}
Date: Sat, 2 Jul 2022 22:29:06 +0100 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=93=9D=20Adds=20docs=20for=20widget?= =?UTF-8?q?=20labels=20(#769)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/widgets.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/widgets.md b/docs/widgets.md index 11557f77..8c55dca5 100644 --- a/docs/widgets.md +++ b/docs/widgets.md @@ -80,6 +80,7 @@ Dashy has support for displaying dynamic content in the form of widgets. There a - [Continuous Updates](#continuous-updates) - [Proxying Requests](#proxying-requests) - [Setting Timeout](#setting-timeout) + - [Adding Labels](#adding-labels) - [Ignoring Errors](#ignoring-errors) - [Custom CSS Styling](#widget-styling) - [Customizing Charts](#customizing-charts) @@ -2265,6 +2266,32 @@ For example: --- +### Adding Labels + +If you have multiple widgets of the same type in a single section, it may not be clear what each one is. To overcome this, you can add a custom label to any given widget, using the `label` property. + +For example: + +```yaml +- name: CPU Usage + icon: fas fa-tachometer + widgets: + - type: gl-current-cpu + label: Meida Server + options: + hostname: http://media-server.lan:61208 + - type: gl-current-cpu + label: Firewall + options: + hostname: http://firewall.lan:61208 + - type: gl-current-cpu + label: File Sync Server + options: + hostname: http://file-sync.lan:61208 +``` + +--- + ### 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. From 43239586a64a63919d645f5b22b55897d06f29f1 Mon Sep 17 00:00:00 2001 From: Lissy93 Date: Sat, 2 Jul 2022 22:36:02 +0100 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=93=9D=20Adds=20widget.label=20to=20c?= =?UTF-8?q?onfiguring=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/configuring.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/configuring.md b/docs/configuring.md index 18941b46..95c885b4 100644 --- a/docs/configuring.md +++ b/docs/configuring.md @@ -253,6 +253,8 @@ For more info, see the **[Authentication Docs](/docs/authentication.md)** **`updateInterval`** | `number` | _Optional_ | You can keep a widget constantly updated by specifying an update interval, in seconds. See [Continuous Updates Docs](/docs/widgets.md#continuous-updates) for more info **`useProxy`** | `boolean` | _Optional_ | Some widgets make API requests to services that are not CORS-enabled. For these instances, you will need to route requests through a proxy, Dashy has a built in CORS-proxy, which you can use by setting this option to `true`. Defaults to `false`. See the [Proxying Requests Docs](/docs/widgets.md#proxying-requests) for more info **`timeout`** | `number` | _Optional_ | Request timeout in milliseconds, defaults to ½ a second (`500`) +**`ignoreErrors`** | `boolean` | _Optional_ | Prevent an error message being displayed, if a network request or something else fails. Useful for false-positives +**`label`** | `string` | _Optional_ | Add custom label to a given widget. Useful for identification, if there are multiple of the same type of widget in a single section **[⬆️ Back to Top](#configuring)**