Merge branch 'main' into dev

This commit is contained in:
shamoon 2025-01-05 07:57:05 -08:00
commit 86a13817df
3 changed files with 18 additions and 5 deletions

View File

@ -23,3 +23,5 @@ Finally, run the server:
```bash ```bash
pnpm start pnpm start
``` ```
When updating homepage versions you will need to re-build the static files i.e. repeat the process above.

View File

@ -11,7 +11,7 @@ Learn more about [Gluetun](https://github.com/qdm12/gluetun).
Allowed fields: `["public_ip", "region", "country"]`. 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 ```yaml
widget: widget:

View File

@ -166,6 +166,18 @@ const headerStyles = {
boxedWidgets: "m-5 mb-0 sm:m-9 sm:mb-0 sm:mt-1", 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 }) { function Home({ initialSettings }) {
const { i18n } = useTranslation(); const { i18n } = useTranslation();
const { theme, setTheme } = useContext(ThemeContext); const { theme, setTheme } = useContext(ThemeContext);
@ -182,10 +194,9 @@ function Home({ initialSettings }) {
const { data: bookmarks } = useSWR("/api/bookmarks"); const { data: bookmarks } = useSWR("/api/bookmarks");
const { data: widgets } = useSWR("/api/widgets"); const { data: widgets } = useSWR("/api/widgets");
const servicesAndBookmarks = [ const servicesAndBookmarks = [...bookmarks.map((bg) => bg.bookmarks).flat(), ...getAllServices(services)].filter(
...services.map((sg) => sg.services).flat(), (i) => i?.href,
...bookmarks.map((bg) => bg.bookmarks).flat(), );
].filter((i) => i?.href);
useEffect(() => { useEffect(() => {
if (settings.language) { if (settings.language) {