diff --git a/docs/installation/source.md b/docs/installation/source.md index 42e5fe91..573711a8 100644 --- a/docs/installation/source.md +++ b/docs/installation/source.md @@ -23,3 +23,5 @@ Finally, run the server: ```bash pnpm start ``` + +When updating homepage versions you will need to re-build the static files i.e. repeat the process above. diff --git a/docs/widgets/services/gluetun.md b/docs/widgets/services/gluetun.md index 44775b15..1cc68c9a 100644 --- a/docs/widgets/services/gluetun.md +++ b/docs/widgets/services/gluetun.md @@ -11,7 +11,7 @@ Learn more about [Gluetun](https://github.com/qdm12/gluetun). Allowed fields: `["public_ip", "region", "country"]`. -To setup authentication, follow [the official Gluetun documentation](https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/control-server.md#authentication). +To setup authentication, follow [the official Gluetun documentation](https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/control-server.md#authentication). Note that to use the api key method, you must add the route `GET /v1/publicip/ip` to the `routes` array in your Gluetun config.toml. ```yaml widget: diff --git a/src/pages/index.jsx b/src/pages/index.jsx index fdf716f6..ffd920ed 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -166,6 +166,18 @@ const headerStyles = { boxedWidgets: "m-5 mb-0 sm:m-9 sm:mb-0 sm:mt-1", }; +function getAllServices(services) { + function get(sg) { + let nestedServices = [...sg.services]; + if (sg.groups.length > 0) { + nestedServices = [...nestedServices, ...sg.groups.map(get).flat()]; + } + return nestedServices; + } + + return [...services.map(get).flat()]; +} + function Home({ initialSettings }) { const { i18n } = useTranslation(); const { theme, setTheme } = useContext(ThemeContext); @@ -182,10 +194,9 @@ function Home({ initialSettings }) { const { data: bookmarks } = useSWR("/api/bookmarks"); const { data: widgets } = useSWR("/api/widgets"); - const servicesAndBookmarks = [ - ...services.map((sg) => sg.services).flat(), - ...bookmarks.map((bg) => bg.bookmarks).flat(), - ].filter((i) => i?.href); + const servicesAndBookmarks = [...bookmarks.map((bg) => bg.bookmarks).flat(), ...getAllServices(services)].filter( + (i) => i?.href, + ); useEffect(() => { if (settings.language) {