From dfea4e317c72fde8c1978f6552326b2d177666fb Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 19 Jan 2022 11:43:04 +0000 Subject: [PATCH] :zap: Refactors all Glances widgets to inherit from parent mixin --- docs/widgets.md | 4 ++- src/components/Widgets/GlAlerts.vue | 12 ++----- src/components/Widgets/GlCpuCores.vue | 12 ++----- src/components/Widgets/GlCpuGauge.vue | 12 ++----- src/components/Widgets/GlCpuHistory.vue | 12 ++----- src/components/Widgets/GlDiskIo.vue | 12 ++----- src/components/Widgets/GlDiskSpace.vue | 9 ++--- src/components/Widgets/GlLoadHistory.vue | 12 ++----- src/components/Widgets/GlMemGauge.vue | 12 ++----- src/components/Widgets/GlMemHistory.vue | 13 ++----- .../Widgets/GlNetworkInterfaces.vue | 12 ++----- src/components/Widgets/GlNetworkTraffic.vue | 12 ++----- src/components/Widgets/GlSystemLoad.vue | 12 ++----- src/mixins/GlancesMixin.js | 36 +++++++++++++++++++ 14 files changed, 75 insertions(+), 107 deletions(-) create mode 100644 src/mixins/GlancesMixin.js diff --git a/docs/widgets.md b/docs/widgets.md index eb2f4364..0e74552a 100644 --- a/docs/widgets.md +++ b/docs/widgets.md @@ -1187,11 +1187,13 @@ All Glance's based widgets require a `hostname` **Field** | **Type** | **Required** | **Description** --- | --- | --- | --- **`hostname`** | `string` | Required | The URL to your Glances instance (without a trailing slash) +**`username`** | `string` | _Optional_ | If you have setup basic auth on Glances, specify username here (defaults to `glances`) +**`password`** | `string` | _Optional_ | If you have setup basic auth on Glances, specify password here. **Note**: since this password is in plaintext, it is important not to reuse it anywhere else ##### Info - **CORS**: 🟢 Enabled -- **Auth**: 🟢 Not Required +- **Auth**: 🟠 Optional - **Price**: 🟢 Free - **Host**: Self-Hosted (see [GitHub - Nicolargo/Glances](https://github.com/nicolargo/glances)) - **Privacy**: ⚫ No Policy Available diff --git a/src/components/Widgets/GlAlerts.vue b/src/components/Widgets/GlAlerts.vue index 358814ed..ab16b14a 100644 --- a/src/components/Widgets/GlAlerts.vue +++ b/src/components/Widgets/GlAlerts.vue @@ -20,10 +20,11 @@