mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-21 13:26:20 +01:00
Merge branch 'main' into dev
This commit is contained in:
commit
86a13817df
@ -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.
|
||||
|
@ -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:
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user