From 897309a47cb94ff9d2d45eb875e7a09ff291b5dc Mon Sep 17 00:00:00 2001
From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Sun, 24 Nov 2024 22:43:13 -0800
Subject: [PATCH 01/43] Enhancement: resources network widget (#4327)
---
docs/installation/k8s.md | 3 +-
docs/widgets/info/resources.md | 3 +-
src/components/widgets/resources/network.jsx | 47 +++++++++++++++++++
.../widgets/resources/resources.jsx | 2 +
src/components/widgets/widget/resource.jsx | 7 ++-
src/pages/api/widgets/resources.js | 28 ++++++++++-
6 files changed, 86 insertions(+), 4 deletions(-)
create mode 100644 src/components/widgets/resources/network.jsx
diff --git a/docs/installation/k8s.md b/docs/installation/k8s.md
index 6805139b6..24be2c341 100644
--- a/docs/installation/k8s.md
+++ b/docs/installation/k8s.md
@@ -175,6 +175,7 @@ data:
expanded: true
cpu: true
memory: true
+ network: default
- search:
provider: duckduckgo
target: _blank
@@ -370,7 +371,7 @@ prevent unnecessary re-renders on page loads and window / tab focusing. The
procedure for enabling sticky sessions depends on your Ingress controller. Below
is an example using Traefik as the Ingress controller.
-```
+```yaml
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
diff --git a/docs/widgets/info/resources.md b/docs/widgets/info/resources.md
index 19323dc30..7fcf9c5cd 100644
--- a/docs/widgets/info/resources.md
+++ b/docs/widgets/info/resources.md
@@ -24,9 +24,10 @@ _Note: unfortunately, the package used for getting CPU temp ([systeminformation]
tempmin: 0 # optional, minimum cpu temp
tempmax: 100 # optional, maximum cpu temp
uptime: true
- units: imperial # only used by cpu temp
+ units: imperial # only used by cpu temp, options: 'imperial' or 'metric'
refresh: 3000 # optional, in ms
diskUnits: bytes # optional, bytes (default) or bbytes. Only applies to disk
+ network: true # optional, uses 'default' if true or specify a network interface name
```
You can also pass a `label` option, which allows you to group resources under named sections,
diff --git a/src/components/widgets/resources/network.jsx b/src/components/widgets/resources/network.jsx
new file mode 100644
index 000000000..5b5cc0043
--- /dev/null
+++ b/src/components/widgets/resources/network.jsx
@@ -0,0 +1,47 @@
+import useSWR from "swr";
+import { FaNetworkWired } from "react-icons/fa";
+import { useTranslation } from "next-i18next";
+
+import Resource from "../widget/resource";
+import Error from "../widget/error";
+
+export default function Network({ options, refresh = 1500 }) {
+ const { t } = useTranslation();
+ // eslint-disable-next-line no-param-reassign
+ if (options.network === true) options.network = "default";
+
+ const { data, error } = useSWR(`/api/widgets/resources?type=network&interfaceName=${options.network}`, {
+ refreshInterval: refresh,
+ });
+
+ if (error || data?.error) {
+ return ;
+ }
+
+ if (!data || !data.network) {
+ return (
+
+ );
+ }
+
+ return (
+
+ );
+}
diff --git a/src/components/widgets/resources/resources.jsx b/src/components/widgets/resources/resources.jsx
index 634e0ff53..db26caa78 100644
--- a/src/components/widgets/resources/resources.jsx
+++ b/src/components/widgets/resources/resources.jsx
@@ -6,6 +6,7 @@ import Cpu from "./cpu";
import Memory from "./memory";
import CpuTemp from "./cputemp";
import Uptime from "./uptime";
+import Network from "./network";
export default function Resources({ options }) {
const { expanded, units, diskUnits, tempmin, tempmax } = options;
@@ -23,6 +24,7 @@ export default function Resources({ options }) {
))
: options.disk && }
+ {options.network && }
{options.cputemp && (
)}
diff --git a/src/components/widgets/widget/resource.jsx b/src/components/widgets/widget/resource.jsx
index 8c9759284..b1f737407 100644
--- a/src/components/widgets/widget/resource.jsx
+++ b/src/components/widgets/widget/resource.jsx
@@ -10,6 +10,7 @@ export default function Resource({
percentage,
expanded = false,
additionalClassNames = "",
+ wide = false,
}) {
const Icon = icon;
@@ -18,7 +19,11 @@ export default function Resource({
className={`flex-none flex flex-row items-center mr-3 py-1.5 information-widget-resource ${additionalClassNames}`}
>
-
+
{value}
{label}
diff --git a/src/pages/api/widgets/resources.js b/src/pages/api/widgets/resources.js
index 66449bff0..4df544e82 100644
--- a/src/pages/api/widgets/resources.js
+++ b/src/pages/api/widgets/resources.js
@@ -7,7 +7,7 @@ const logger = createLogger("resources");
const si = require("systeminformation");
export default async function handler(req, res) {
- const { type, target } = req.query;
+ const { type, target, interfaceName = "default" } = req.query;
if (type === "cpu") {
const load = await si.currentLoad();
@@ -57,6 +57,32 @@ export default async function handler(req, res) {
});
}
+ if (type === "network") {
+ let networkData = await si.networkStats();
+ let interfaceDefault;
+ logger.debug("networkData:", JSON.stringify(networkData));
+ if (interfaceName && interfaceName !== "default") {
+ networkData = networkData.filter((network) => network.iface === interfaceName).at(0);
+ if (!networkData) {
+ return res.status(404).json({
+ error: "Interface not found",
+ });
+ }
+ } else {
+ interfaceDefault = await si.networkInterfaceDefault();
+ networkData = networkData.filter((network) => network.iface === interfaceDefault).at(0);
+ if (!networkData) {
+ return res.status(404).json({
+ error: "Default interface not found",
+ });
+ }
+ }
+ return res.status(200).json({
+ network: networkData,
+ interface: interfaceName !== "default" ? interfaceName : interfaceDefault,
+ });
+ }
+
return res.status(400).json({
error: "invalid type",
});
From cbf304a4c81df5bbec1164bae858a3d684867bc8 Mon Sep 17 00:00:00 2001
From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Sun, 24 Nov 2024 22:43:17 -0800
Subject: [PATCH 02/43] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 4f898387d..588209428 100644
--- a/README.md
+++ b/README.md
@@ -52,7 +52,7 @@ Homepage has built-in support for Docker, and can automatically discover and add
## Service Widgets
-Homepage also has support for over 100 3rd party services, including all popular starr apps, and most popular self-hosted apps. Some examples include: Radarr, Sonarr, Lidarr, Bazarr, Ombi, Tautulli, Plex, Jellyfin, Emby, Transmission, qBittorrent, Deluge, Jackett, NZBGet, SABnzbd, etc. As well as service integrations, Homepage also has a number of information providers, sourcing information from a variety of external 3rd party APIs. See the [Service](https://gethomepage.dev/widgets/) page for more information.
+Homepage also has support for hundreds of 3rd-party services, including all popular \*arr apps, and most popular self-hosted apps. Some examples include: Radarr, Sonarr, Lidarr, Bazarr, Ombi, Tautulli, Plex, Jellyfin, Emby, Transmission, qBittorrent, Deluge, Jackett, NZBGet, SABnzbd, etc. As well as service integrations, Homepage also has a number of information providers, sourcing information from a variety of external 3rd-party APIs. See the [Service](https://gethomepage.dev/widgets/) page for more information.
## Information Widgets
From 385511f773daea10bd27c5673231582131f00b86 Mon Sep 17 00:00:00 2001
From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Sun, 24 Nov 2024 23:11:07 -0800
Subject: [PATCH 03/43] Fix: resources network better startup behavior
---
src/components/widgets/resources/network.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/widgets/resources/network.jsx b/src/components/widgets/resources/network.jsx
index 5b5cc0043..a2a3acac5 100644
--- a/src/components/widgets/resources/network.jsx
+++ b/src/components/widgets/resources/network.jsx
@@ -18,7 +18,7 @@ export default function Network({ options, refresh = 1500 }) {
return ;
}
- if (!data || !data.network) {
+ if (!data || !data.network || !data.network.rx_sec || !data.network.tx_sec) {
return (
Date: Wed, 27 Nov 2024 02:33:40 -0800
Subject: [PATCH 04/43] Enhancement: multiple widgets per service (#4338)
---
docs/configs/docker.md | 12 ++
docs/configs/service-widgets.md | 20 ++-
docs/widgets/index.md | 11 +-
src/components/services/item.jsx | 4 +-
src/components/services/widget.jsx | 10 +-
src/pages/api/services/proxy.js | 6 +-
src/utils/config/service-helpers.js | 159 ++++++++++++-----------
src/utils/proxy/api-helpers.js | 1 +
src/utils/proxy/handlers/credentialed.js | 4 +-
src/utils/proxy/handlers/generic.js | 4 +-
src/utils/proxy/handlers/jsonrpc.js | 4 +-
src/utils/proxy/handlers/synology.js | 4 +-
src/widgets/audiobookshelf/proxy.js | 4 +-
src/widgets/beszel/proxy.js | 4 +-
src/widgets/calendar/proxy.js | 4 +-
src/widgets/crowdsec/proxy.js | 4 +-
src/widgets/deluge/proxy.js | 4 +-
src/widgets/flood/proxy.js | 4 +-
src/widgets/freshrss/proxy.js | 4 +-
src/widgets/fritzbox/proxy.js | 4 +-
src/widgets/gamedig/proxy.js | 4 +-
src/widgets/homeassistant/proxy.js | 4 +-
src/widgets/homebox/proxy.js | 4 +-
src/widgets/homebridge/proxy.js | 4 +-
src/widgets/jackett/proxy.js | 4 +-
src/widgets/jdownloader/proxy.js | 4 +-
src/widgets/kavita/proxy.js | 4 +-
src/widgets/minecraft/proxy.js | 4 +-
src/widgets/npm/proxy.js | 4 +-
src/widgets/omada/proxy.js | 4 +-
src/widgets/openmediavault/proxy.js | 4 +-
src/widgets/openwrt/proxy.js | 4 +-
src/widgets/photoprism/proxy.js | 4 +-
src/widgets/pihole/proxy.js | 4 +-
src/widgets/plex/proxy.js | 4 +-
src/widgets/pyload/proxy.js | 4 +-
src/widgets/qbittorrent/proxy.js | 4 +-
src/widgets/qnap/proxy.js | 4 +-
src/widgets/rutorrent/proxy.js | 4 +-
src/widgets/suwayomi/proxy.js | 4 +-
src/widgets/tdarr/proxy.js | 4 +-
src/widgets/transmission/proxy.js | 4 +-
src/widgets/unifi/proxy.js | 8 +-
src/widgets/urbackup/proxy.js | 4 +-
src/widgets/watchtower/proxy.js | 4 +-
src/widgets/xteve/proxy.js | 4 +-
46 files changed, 210 insertions(+), 169 deletions(-)
diff --git a/docs/configs/docker.md b/docs/configs/docker.md
index 51f6b5238..7cea1fdce 100644
--- a/docs/configs/docker.md
+++ b/docs/configs/docker.md
@@ -153,6 +153,18 @@ labels:
- homepage.widget.fields=["field1","field2"] # optional
```
+Multiple widgets can be specified by incrementing the index, e.g.
+
+```yaml
+labels: ...
+ - homepage.widget[0].type=emby
+ - homepage.widget[0].url=http://emby.home
+ - homepage.widget[0].key=yourembyapikeyhere
+ - homepage.widget[1].type=uptimekuma
+ - homepage.widget[1].url=http://uptimekuma.home
+ - homepage.widget[1].slug=youreventslughere
+```
+
You can add specify fields for e.g. the [CustomAPI](../widgets/services/customapi.md) widget by using array-style dot notation:
```yaml
diff --git a/docs/configs/service-widgets.md b/docs/configs/service-widgets.md
index 9c54964ec..df696f618 100644
--- a/docs/configs/service-widgets.md
+++ b/docs/configs/service-widgets.md
@@ -5,7 +5,7 @@ description: Service Widget Configuration
Unless otherwise noted, URLs should not end with a `/` or other API path. Each widget will handle the path on its own.
-Each service can have one widget attached to it (often matching the service type, but that's not forced).
+Each service can have widgets attached to it (often matching the service type, but that's not forced).
In addition to the href of the service, you can also specify the target location in which to open that link. See [Link Target](settings.md#link-target) for more details.
@@ -22,6 +22,24 @@ Using Emby as an example, this is how you would attach the Emby service widget.
key: apikeyapikeyapikeyapikeyapikey
```
+## Multiple Widgets
+
+Each service can have multiple widgets attached to it, for example:
+
+```yaml
+- Emby:
+ icon: emby.png
+ href: http://emby.host.or.ip/
+ description: Movies & TV Shows
+ widgets:
+ - type: emby
+ url: http://emby.host.or.ip
+ key: apikeyapikeyapikeyapikeyapikey
+ - type: uptimekuma
+ url: http://uptimekuma.host.or.ip:port
+ slug: statuspageslug
+```
+
## Field Visibility
Each widget can optionally provide a list of which fields should be visible via the `fields` widget property. If no fields are specified, then all fields will be displayed. The `fields` property must be a valid YAML array of strings. As an example, here is the entry for Sonarr showing only a couple of fields.
diff --git a/docs/widgets/index.md b/docs/widgets/index.md
index 8b81ee402..4bd45af71 100644
--- a/docs/widgets/index.md
+++ b/docs/widgets/index.md
@@ -19,10 +19,13 @@ Service widgets are used to display the status of a service, often a web service
description: Watch movies and TV shows.
server: localhost
container: plex
- widget:
- type: tautulli
- url: http://172.16.1.1:8181
- key: aabbccddeeffgghhiijjkkllmmnnoo
+ widgets:
+ - type: tautulli
+ url: http://172.16.1.1:8181
+ key: aabbccddeeffgghhiijjkkllmmnnoo
+ - type: uptimekuma
+ url: http://172.16.1.2:8080
+ slug: aaaaaaabbbbb
```
## Info Widgets
diff --git a/src/components/services/item.jsx b/src/components/services/item.jsx
index a38dfaa3a..54560d6f2 100644
--- a/src/components/services/item.jsx
+++ b/src/components/services/item.jsx
@@ -154,7 +154,9 @@ export default function Item({ service, group, useEqualHeights }) {
Date: Wed, 27 Nov 2024 22:49:14 -0800
Subject: [PATCH 09/43] Documentation: doc updates for nesting, reorganizing,
fixes
---
docs/configs/info-widgets.md | 24 +++++++++++
docs/configs/service-widgets.md | 58 -------------------------
docs/configs/services.md | 71 +++++++++++++++++++++++++++++++
docs/configs/settings.md | 29 +++++++++++--
docs/troubleshooting/index.md | 2 +-
docs/widgets/authoring/proxies.md | 2 +-
docs/widgets/index.md | 4 ++
docs/widgets/info/openmeteo.md | 2 +-
docs/widgets/info/weather.md | 22 ----------
mkdocs.yml | 4 +-
src/skeleton/services.yaml | 2 +-
src/skeleton/settings.yaml | 2 +-
src/skeleton/widgets.yaml | 2 +-
13 files changed, 132 insertions(+), 92 deletions(-)
create mode 100644 docs/configs/info-widgets.md
delete mode 100644 docs/configs/service-widgets.md
delete mode 100644 docs/widgets/info/weather.md
diff --git a/docs/configs/info-widgets.md b/docs/configs/info-widgets.md
new file mode 100644
index 000000000..763143960
--- /dev/null
+++ b/docs/configs/info-widgets.md
@@ -0,0 +1,24 @@
+---
+title: Information Widgets
+description: Homepage info widgets.
+---
+
+Information widgets are widgets that provide information about your system or environment and are displayed at the top of the homepage. You can find a list of all available info widgets under the [Info Widgets](../widgets/info/index.md) section.
+
+Info widgets are defined in the widgets.yaml
+
+Each widget has its own configuration options, which are detailed in the widget's documentation.
+
+## Layout
+
+Info widgets are displayed in the order they are defined in the `widgets.yaml` file. You can change the order by moving the widgets around in the file. However, some widgets (weather, search and datetime) are aligned to the right side of the screen which can affect the layout of the widgets.
+
+## Adding A Link
+
+You can add a link to an info widget such as the logo or text widgets by adding an `href` option, for example:
+
+```yaml
+logo:
+ href: https://example.com
+ target: _blank # Optional, can be set in settings
+```
diff --git a/docs/configs/service-widgets.md b/docs/configs/service-widgets.md
deleted file mode 100644
index df696f618..000000000
--- a/docs/configs/service-widgets.md
+++ /dev/null
@@ -1,58 +0,0 @@
----
-title: Service Widgets
-description: Service Widget Configuration
----
-
-Unless otherwise noted, URLs should not end with a `/` or other API path. Each widget will handle the path on its own.
-
-Each service can have widgets attached to it (often matching the service type, but that's not forced).
-
-In addition to the href of the service, you can also specify the target location in which to open that link. See [Link Target](settings.md#link-target) for more details.
-
-Using Emby as an example, this is how you would attach the Emby service widget.
-
-```yaml
-- Emby:
- icon: emby.png
- href: http://emby.host.or.ip/
- description: Movies & TV Shows
- widget:
- type: emby
- url: http://emby.host.or.ip
- key: apikeyapikeyapikeyapikeyapikey
-```
-
-## Multiple Widgets
-
-Each service can have multiple widgets attached to it, for example:
-
-```yaml
-- Emby:
- icon: emby.png
- href: http://emby.host.or.ip/
- description: Movies & TV Shows
- widgets:
- - type: emby
- url: http://emby.host.or.ip
- key: apikeyapikeyapikeyapikeyapikey
- - type: uptimekuma
- url: http://uptimekuma.host.or.ip:port
- slug: statuspageslug
-```
-
-## Field Visibility
-
-Each widget can optionally provide a list of which fields should be visible via the `fields` widget property. If no fields are specified, then all fields will be displayed. The `fields` property must be a valid YAML array of strings. As an example, here is the entry for Sonarr showing only a couple of fields.
-
-**In all cases a widget will work and display all fields without specifying the `fields` property.**
-
-```yaml
-- Sonarr:
- icon: sonarr.png
- href: http://sonarr.host.or.ip
- widget:
- type: sonarr
- fields: ["wanted", "queued"]
- url: http://sonarr.host.or.ip
- key: apikeyapikeyapikeyapikeyapikey
-```
diff --git a/docs/configs/services.md b/docs/configs/services.md
index 9cb75177e..6ef25c39f 100644
--- a/docs/configs/services.md
+++ b/docs/configs/services.md
@@ -21,6 +21,23 @@ Groups are defined as top-level array entries.
+### Nested Groups
+
+Groups can be nested by using the same format as the top-level groups.
+
+```yaml
+- Group A:
+ - Service A:
+ href: http://localhost/
+
+ - Group B:
+ - Service B:
+ href: http://localhost/
+
+ - Service C:
+ href: http://localhost/
+```
+
## Services
Services are defined as array entries on groups,
@@ -43,6 +60,60 @@ Services are defined as array entries on groups,
+### Service Widgets
+
+Each service can have widgets attached to it (often matching the service type, but that's not forced).
+
+In addition to the href of the service, you can also specify the target location in which to open that link. See [Link Target](settings.md#link-target) for more details.
+
+Using Emby as an example, this is how you would attach the Emby service widget.
+
+```yaml
+- Emby:
+ icon: emby.png
+ href: http://emby.host.or.ip/
+ description: Movies & TV Shows
+ widget:
+ type: emby
+ url: http://emby.host.or.ip
+ key: apikeyapikeyapikeyapikeyapikey
+```
+
+#### Multiple Widgets
+
+Each service can have multiple widgets attached to it, for example:
+
+```yaml
+- Emby:
+ icon: emby.png
+ href: http://emby.host.or.ip/
+ description: Movies & TV Shows
+ widgets:
+ - type: emby
+ url: http://emby.host.or.ip
+ key: apikeyapikeyapikeyapikeyapikey
+ - type: uptimekuma
+ url: http://uptimekuma.host.or.ip:port
+ slug: statuspageslug
+```
+
+#### Field Visibility
+
+Each widget can optionally provide a list of which fields should be visible via the `fields` widget property. If no fields are specified, then all fields will be displayed. The `fields` property must be a valid YAML array of strings. As an example, here is the entry for Sonarr showing only a couple of fields.
+
+**In all cases a widget will work and display all fields without specifying the `fields` property.**
+
+```yaml
+- Sonarr:
+ icon: sonarr.png
+ href: http://sonarr.host.or.ip
+ widget:
+ type: sonarr
+ fields: ["wanted", "queued"]
+ url: http://sonarr.host.or.ip
+ key: apikeyapikeyapikeyapikeyapikey
+```
+
## Descriptions
Services may have descriptions,
diff --git a/docs/configs/settings.md b/docs/configs/settings.md
index 2f387a65b..7e1815bb1 100644
--- a/docs/configs/settings.md
+++ b/docs/configs/settings.md
@@ -137,6 +137,27 @@ layout:
columns: 3
```
+### Nested Groups
+
+If your services config has nested groups, you can apply settings to these groups by nesting them in the layout block
+and using the same settings. For example
+
+```yaml
+layout:
+ Group A:
+ style: row
+ columns: 4
+ Group C:
+ style: row
+ columns: 2
+ Nested Group A:
+ style: row
+ columns: 2
+ Nested Group B:
+ style: row
+ columns: 2
+```
+
### Headers
You can hide headers for each section in the layout as well by passing `header` as false, like so:
@@ -348,12 +369,12 @@ This can also be set for individual services. Note setting this at the service l
## Providers
-The `providers` section allows you to define shared API provider options and secrets. Currently this allows you to define your weather API keys in secret and is also the location of the Longhorn URL and credentials.
+The `providers` section allows you to define shared API provider options and secrets.
```yaml
providers:
openweathermap: openweathermapapikey
- weatherapi: weatherapiapikey
+ finnhub: yourfinnhubapikeyhere
longhorn:
url: https://longhorn.example.com
username: admin
@@ -363,10 +384,10 @@ providers:
You can then pass `provider` instead of `apiKey` in your widget configuration.
```yaml
-- weatherapi:
+- openweathermap:
latitude: 50.449684
longitude: 30.525026
- provider: weatherapi
+ provider: openweathermap
```
## Quick Launch
diff --git a/docs/troubleshooting/index.md b/docs/troubleshooting/index.md
index 82a7381cf..bbde4cf3c 100644
--- a/docs/troubleshooting/index.md
+++ b/docs/troubleshooting/index.md
@@ -17,7 +17,7 @@ hide:
All service widgets work essentially the same, that is, homepage makes a proxied call to an API made available by that service. The majority of the time widgets don't work it is a configuration issue. Of course, sometimes things do break. Some basic steps to try:
-1. Ensure that you follow the rule mentioned on https://gethomepage.dev/configs/service-widgets/. **Unless otherwise noted, URLs should not end with a / or other API path. Each widget will handle the path on its own.**. This is very important as including a trailing slash can result in an error.
+1. **URLs should not end with a / or other API path. Each widget will handle the path on its own.**. Including a trailing slash can result in an error.
2. Verify the homepage installation can connect to the IP address or host you are using for the widget `url`. This is most simply achieved by pinging the server from the homepage machine, in Docker this means _from inside the container_ itself, e.g.:
diff --git a/docs/widgets/authoring/proxies.md b/docs/widgets/authoring/proxies.md
index 15cdb6703..a8b8073e0 100644
--- a/docs/widgets/authoring/proxies.md
+++ b/docs/widgets/authoring/proxies.md
@@ -50,7 +50,7 @@ You can also pass API keys from the widget configuration to the proxy handler, f
### `credentialedProxyHandler`
-A proxy handler that makes authenticated by setting request headers. Credentials are pulled from the widgets configuration.
+A proxy handler that makes authenticated requests by setting request headers. Credentials are pulled from the widgets configuration.
By default the key is passed as an `X-API-Key` header. If you need to pass the key as something else, either add a case to the credentialedProxyHandler or create a new proxy handler.
diff --git a/docs/widgets/index.md b/docs/widgets/index.md
index 4bd45af71..fbb8edc63 100644
--- a/docs/widgets/index.md
+++ b/docs/widgets/index.md
@@ -28,6 +28,8 @@ Service widgets are used to display the status of a service, often a web service
slug: aaaaaaabbbbb
```
+More detail on configuring service widgets can be found in the [Service Widgets Config](../configs/services.md) section.
+
## Info Widgets
Info widgets are used to display information in the header, often about your system or environment. Info widgets are defined your `widgets.yaml` file. Here's an example:
@@ -39,3 +41,5 @@ Info widgets are used to display information in the header, often about your sys
longitude: -117.51
cache: 5
```
+
+More detail on configuring info widgets can be found in the [Info Widgets Config](../configs/info-widgets.md) section.
diff --git a/docs/widgets/info/openmeteo.md b/docs/widgets/info/openmeteo.md
index fb5bb1717..ec84ab174 100644
--- a/docs/widgets/info/openmeteo.md
+++ b/docs/widgets/info/openmeteo.md
@@ -3,7 +3,7 @@ title: Open-Meteo
description: Open-Meteo Information Widget Configuration
---
-No registration is required at all! See [https://open-meteo.com/en/docs](https://open-meteo.com/en/docs)
+Homepage's recommended weather widget. No registration is required at all! See [https://open-meteo.com/en/docs](https://open-meteo.com/en/docs)
```yaml
- openmeteo:
diff --git a/docs/widgets/info/weather.md b/docs/widgets/info/weather.md
deleted file mode 100644
index ab13b6736..000000000
--- a/docs/widgets/info/weather.md
+++ /dev/null
@@ -1,22 +0,0 @@
----
-title: Weather API
-description: Weather API Information Widget Configuration
----
-
-**Note: this widget is considered 'deprecated' since there is no longer a free Weather API tier for new members. See the openmeteo or openweathermap widgets for alternatives.**
-
-The free tier is all that's required, you will need to [register](https://www.weatherapi.com/signup.aspx) and grab your API key.
-
-```yaml
-- weatherapi:
- label: Kyiv # optional
- latitude: 50.449684
- longitude: 30.525026
- units: metric # or imperial
- apiKey: yourweatherapikey
- cache: 5 # Time in minutes to cache API responses, to stay within limits
- format: # optional, Intl.NumberFormat options
- maximumFractionDigits: 1
-```
-
-You can optionally not pass a `latitude` and `longitude` and the widget will use your current location (requires a secure context, eg. HTTPS).
diff --git a/mkdocs.yml b/mkdocs.yml
index a19d3b839..fa2188ad5 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -21,8 +21,8 @@ nav:
- configs/index.md
- configs/settings.md
- configs/bookmarks.md
+ - configs/info-widgets.md
- configs/services.md
- - configs/service-widgets.md
- configs/kubernetes.md
- configs/docker.md
- configs/custom-css-js.md
@@ -142,6 +142,7 @@ nav:
- widgets/services/spoolman.md
- widgets/services/stash.md
- widgets/services/stocks.md
+ - widgets/services/suwayomi.md
- widgets/services/swagdashboard.md
- widgets/services/syncthing-relay-server.md
- widgets/services/tailscale.md
@@ -177,7 +178,6 @@ nav:
- widgets/info/search.md
- widgets/info/stocks.md
- widgets/info/unifi_controller.md
- - widgets/info/weather.md
- "Learn":
- widgets/authoring/index.md
- "Getting Started": widgets/authoring/getting-started.md
diff --git a/src/skeleton/services.yaml b/src/skeleton/services.yaml
index 77626b1c8..39b379263 100644
--- a/src/skeleton/services.yaml
+++ b/src/skeleton/services.yaml
@@ -1,6 +1,6 @@
---
# For configuration options and examples, please see:
-# https://gethomepage.dev/configs/services
+# https://gethomepage.dev/configs/services/
- My First Group:
- My First Service:
diff --git a/src/skeleton/settings.yaml b/src/skeleton/settings.yaml
index 141053f5b..2e828c082 100644
--- a/src/skeleton/settings.yaml
+++ b/src/skeleton/settings.yaml
@@ -1,6 +1,6 @@
---
# For configuration options and examples, please see:
-# https://gethomepage.dev/configs/settings
+# https://gethomepage.dev/configs/settings/
providers:
openweathermap: openweathermapapikey
diff --git a/src/skeleton/widgets.yaml b/src/skeleton/widgets.yaml
index 23c8d6136..b1cf0f558 100644
--- a/src/skeleton/widgets.yaml
+++ b/src/skeleton/widgets.yaml
@@ -1,6 +1,6 @@
---
# For configuration options and examples, please see:
-# https://gethomepage.dev/configs/service-widgets
+# https://gethomepage.dev/configs/info-widgets/
- resources:
cpu: true
From 5cc487a96ddd6327d2d7a0d6acfabc3d5f960e59 Mon Sep 17 00:00:00 2001
From: zombaru <16330202+zombaru@users.noreply.github.com>
Date: Thu, 28 Nov 2024 20:15:28 -0800
Subject: [PATCH 10/43] Documentation: Add missing admonition type to UniFi
docs (#4353)
---
docs/widgets/info/unifi_controller.md | 2 +-
docs/widgets/services/unifi-controller.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/widgets/info/unifi_controller.md b/docs/widgets/info/unifi_controller.md
index b77d8ed00..e16ca40b0 100644
--- a/docs/widgets/info/unifi_controller.md
+++ b/docs/widgets/info/unifi_controller.md
@@ -7,7 +7,7 @@ _(Find the Unifi Controller service widget [here](../services/unifi-controller.m
You can display general connectivity status from your Unifi (Network) Controller.
-!!!
+!!! warning
When authenticating you will want to use a local account that has at least read privileges.
diff --git a/docs/widgets/services/unifi-controller.md b/docs/widgets/services/unifi-controller.md
index d137c2a95..c5efc688e 100644
--- a/docs/widgets/services/unifi-controller.md
+++ b/docs/widgets/services/unifi-controller.md
@@ -9,7 +9,7 @@ _(Find the Unifi Controller information widget [here](../info/unifi_controller.m
You can display general connectivity status from your Unifi (Network) Controller.
-!!!
+!!! warning
When authenticating you will want to use a local account that has at least read privileges.
From 276a1c3ef423f7b027a84ad5c8ac7ef30d04ca2f Mon Sep 17 00:00:00 2001
From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Thu, 28 Nov 2024 21:54:22 -0800
Subject: [PATCH 11/43] Chore: better tailscale error handling
---
src/widgets/tailscale/component.jsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/widgets/tailscale/component.jsx b/src/widgets/tailscale/component.jsx
index 3929b2ed1..d3c937d5d 100644
--- a/src/widgets/tailscale/component.jsx
+++ b/src/widgets/tailscale/component.jsx
@@ -11,8 +11,8 @@ export default function Component({ service }) {
const { data: statsData, error: statsError } = useWidgetAPI(widget, "device");
- if (statsError) {
- return ;
+ if (statsError || statsData?.message) {
+ return ;
}
if (!statsData) {
From a28952ce698e330c9cfef55289acf8c5cc30efe6 Mon Sep 17 00:00:00 2001
From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Fri, 29 Nov 2024 10:14:53 -0800
Subject: [PATCH 12/43] Chore: move custom css loading, add letter-spacing
(#4359)
---
src/pages/_document.jsx | 2 ++
src/pages/index.jsx | 2 --
src/styles/globals.css | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/pages/_document.jsx b/src/pages/_document.jsx
index bfe3fc933..e69ca0079 100644
--- a/src/pages/_document.jsx
+++ b/src/pages/_document.jsx
@@ -10,6 +10,8 @@ export default function Document() {
/>
+
+ {/* eslint-disable-line @next/next/no-css-tags */}
diff --git a/src/pages/index.jsx b/src/pages/index.jsx
index 3f8ebf86d..0bdc78b60 100644
--- a/src/pages/index.jsx
+++ b/src/pages/index.jsx
@@ -374,8 +374,6 @@ function Home({ initialSettings }) {
)}
-
- {/* eslint-disable-line @next/next/no-css-tags */}
diff --git a/src/styles/globals.css b/src/styles/globals.css
index f3bfec786..1e91f86ee 100644
--- a/src/styles/globals.css
+++ b/src/styles/globals.css
@@ -16,6 +16,7 @@ body {
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
+ letter-spacing: 0.1px;
}
#page_wrapper {
From 91e529f87a042a4e152afa449e6f47c735841ea5 Mon Sep 17 00:00:00 2001
From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Fri, 29 Nov 2024 23:32:59 -0800
Subject: [PATCH 13/43] Enhancement: glances containers metric widget (#4361)
---
docs/widgets/services/glances.md | 2 +
src/widgets/glances/component.jsx | 5 ++
src/widgets/glances/metrics/containers.jsx | 73 ++++++++++++++++++++++
src/widgets/glances/widget.js | 2 +-
4 files changed, 81 insertions(+), 1 deletion(-)
create mode 100644 src/widgets/glances/metrics/containers.jsx
diff --git a/docs/widgets/services/glances.md b/docs/widgets/services/glances.md
index 562cf57a2..d28462eb1 100644
--- a/docs/widgets/services/glances.md
+++ b/docs/widgets/services/glances.md
@@ -51,6 +51,8 @@ The metric field in the configuration determines the type of system monitoring d
`process`: Top 5 processes based on CPU usage. Gives an overview of which processes are consuming the most resources.
+`containers`: Docker or Kubernetes containers list. Shows up to 5 containers running on the system and their resource usage.
+
`network:`: Network data usage for the specified interface. Replace `` with the name of your network interface, e.g., `network:enp0s25`, as specified in glances.
`sensor:`: Temperature of the specified sensor, typically used to monitor CPU temperature. Replace `` with the name of your sensor, e.g., `sensor:Package id 0` as specified in glances.
diff --git a/src/widgets/glances/component.jsx b/src/widgets/glances/component.jsx
index df916b4ba..bff31ac16 100644
--- a/src/widgets/glances/component.jsx
+++ b/src/widgets/glances/component.jsx
@@ -7,6 +7,7 @@ import Disk from "./metrics/disk";
import GPU from "./metrics/gpu";
import Info from "./metrics/info";
import Fs from "./metrics/fs";
+import Containers from "./metrics/containers";
export default function Component({ service }) {
const { widget } = service;
@@ -23,6 +24,10 @@ export default function Component({ service }) {
return ;
}
+ if (widget.metric === "containers") {
+ return ;
+ }
+
if (widget.metric === "cpu") {
return ;
}
diff --git a/src/widgets/glances/metrics/containers.jsx b/src/widgets/glances/metrics/containers.jsx
new file mode 100644
index 000000000..dac52be3c
--- /dev/null
+++ b/src/widgets/glances/metrics/containers.jsx
@@ -0,0 +1,73 @@
+import { useTranslation } from "next-i18next";
+
+import Container from "../components/container";
+import Block from "../components/block";
+
+import useWidgetAPI from "utils/proxy/use-widget-api";
+import ResolvedIcon from "components/resolvedicon";
+
+const statusMap = {
+ running: ,
+ paused: ,
+};
+
+const defaultInterval = 1000;
+
+export default function Component({ service }) {
+ const { t } = useTranslation();
+ const { widget } = service;
+ const { chart, refreshInterval = defaultInterval, version = 3 } = widget;
+
+ const idKey = version === 3 ? "Id" : "id";
+ const statusKey = version === 3 ? "Status" : "status";
+
+ const { data, error } = useWidgetAPI(service.widget, `${version}/containers`, {
+ refreshInterval: Math.max(defaultInterval, refreshInterval),
+ });
+
+ if (error) {
+ return ;
+ }
+
+ if (!data) {
+ return (
+
+ -
+
+ );
+ }
+
+ data.splice(chart ? 5 : 1);
+
+ return (
+
+
+