From e3360349bba916191ad4c4d4577608bb9ae6906a Mon Sep 17 00:00:00 2001 From: Chris Nielsen Date: Fri, 12 May 2023 19:06:32 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Permit=20users=20to=20choose=20Cels?= =?UTF-8?q?ius=20or=20Fahrenheit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/widgets.md | 7 ++ src/components/Widgets/GlCpuTemp.vue | 113 ++++++++++++++++++--------- src/utils/MiscHelpers.js | 5 ++ 3 files changed, 86 insertions(+), 39 deletions(-) diff --git a/docs/widgets.md b/docs/widgets.md index e3c67e20..cc9a1450 100644 --- a/docs/widgets.md +++ b/docs/widgets.md @@ -2380,12 +2380,19 @@ You'll need to enable the sensors plugin to use this widget, using: `--enable-pl

+#### Options + +**Field** | **Type** | **Required** | **Description** +--- | --- | --- | --- +**`units`** | `string` | _Optional_ | Use `C` to display temperatures in Celsius or `F` to use Fahrenheit. Defaults to `C`. + #### Example ```yaml - type: gl-cpu-temp options: hostname: http://192.168.130.2:61208 + units: C ``` --- diff --git a/src/components/Widgets/GlCpuTemp.vue b/src/components/Widgets/GlCpuTemp.vue index 37356d44..9fcc83ed 100644 --- a/src/components/Widgets/GlCpuTemp.vue +++ b/src/components/Widgets/GlCpuTemp.vue @@ -2,7 +2,7 @@

{{ sensor.label | formatLbl }}

-

{{ sensor.value | formatVal(sensor.sensorType) }}

+

{{ sensor.value | formatVal(sensor.unit) }}

@@ -10,7 +10,7 @@