From d0937fe6a834f2d5d86f29b8ecae1e7b825b2645 Mon Sep 17 00:00:00 2001 From: shamoon Date: Sat, 14 Dec 2024 23:02:11 -0800 Subject: [PATCH 01/16] Updated requirements --- CONTRIBUTING.md | 2 +- docs/widgets/authoring/getting-started.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0cc5fad0..0d85c731 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,7 +63,7 @@ The homepage team appreciates all effort and interest from the community in fili - Issues, pull requests and discussions that are closed will be locked after 30 days of inactivity. - Discussions with a marked answer will be automatically closed. - Discussions in the 'General' or 'Support' categories will be closed after 180 days of inactivity. -- Feature requests that do not meet the following thresholds will be closed: 5 "up-votes" after 180 days of inactivity or 10 "up-votes" after 365 days. +- Feature requests that do not meet the following thresholds will be closed: 10 "up-votes" after 180 days of inactivity or 20 "up-votes" after 365 days. In all cases, threads can be re-opened by project maintainers and, of course, users can always create a new discussion for related concerns. Finally, remember that all information remains searchable and 'closed' feature requests can still serve as inspiration for new features. diff --git a/docs/widgets/authoring/getting-started.md b/docs/widgets/authoring/getting-started.md index 4b9126ea..dd33c21e 100644 --- a/docs/widgets/authoring/getting-started.md +++ b/docs/widgets/authoring/getting-started.md @@ -55,7 +55,7 @@ self-hosted / open-source alternative, we ask that any widgets, etc. are develop To ensure cohesiveness of various widgets, the following should be used as a guide for developing new widgets: -- Please only submit widgets that target a feature request discussion with at least 10 'up-votes'. The purpose of this requirement is to avoid the addition (and maintenance) of service widgets that might only benefit a small number of users. +- Please only submit widgets that target a feature request discussion with at least 20 'up-votes'. The purpose of this requirement is to avoid the addition (and maintenance) of service widgets that might only benefit a small number of users. - Note that we reserve the right to decline widgets for projects that are very young (eg < ~1y) or those with a small reach (eg low GitHub stars). Again, this is in an effort to keep overall widget maintenance under control. - Widgets should be only one row of blocks - Widgets should be no more than 4 blocks wide and generally conform to the styling / design choices of other widgets From dd3a2295599ff9dd871f00e91b16630118e04122 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:25:32 -0800 Subject: [PATCH 02/16] Update getting-started.md --- docs/widgets/authoring/getting-started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/widgets/authoring/getting-started.md b/docs/widgets/authoring/getting-started.md index d3aa106f..73d8b84c 100644 --- a/docs/widgets/authoring/getting-started.md +++ b/docs/widgets/authoring/getting-started.md @@ -46,9 +46,9 @@ See the [pre-commit documentation](https://pre-commit.com/#install) to get start In general, homepage is meant to be a dashboard for 'self-hosted' services and we believe it is a small way we can help showcase this kind of software. While exceptions are made, mostly when there is no viable self-hosted / open-source alternative, we ask that any widgets, etc. are developed primarily for a self-hosted tool. -## New Feature Guidelines +## New Feature or Enhancement Guidelines {#new-feature-guidelines} -- New features should be linked to an existing feature request. The purpose of this requirement is to avoid the addition (and maintenance) of features that might only benefit a small number of users. +- New features or enhancements, **no matter how small**, should be linked to an existing feature request. The purpose of this requirement is to avoid the addition (and maintenance) of features that might only benefit a small number of users. - If you have ideas for a larger feature you may want to open a discussion first. ## Service Widget Guidelines From 101461b7b59f4c194c260bb6980a9cfd64f9d88e Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:25:32 -0800 Subject: [PATCH 03/16] Update getting-started.md --- docs/widgets/authoring/getting-started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/widgets/authoring/getting-started.md b/docs/widgets/authoring/getting-started.md index d3aa106f..73d8b84c 100644 --- a/docs/widgets/authoring/getting-started.md +++ b/docs/widgets/authoring/getting-started.md @@ -46,9 +46,9 @@ See the [pre-commit documentation](https://pre-commit.com/#install) to get start In general, homepage is meant to be a dashboard for 'self-hosted' services and we believe it is a small way we can help showcase this kind of software. While exceptions are made, mostly when there is no viable self-hosted / open-source alternative, we ask that any widgets, etc. are developed primarily for a self-hosted tool. -## New Feature Guidelines +## New Feature or Enhancement Guidelines {#new-feature-guidelines} -- New features should be linked to an existing feature request. The purpose of this requirement is to avoid the addition (and maintenance) of features that might only benefit a small number of users. +- New features or enhancements, **no matter how small**, should be linked to an existing feature request. The purpose of this requirement is to avoid the addition (and maintenance) of features that might only benefit a small number of users. - If you have ideas for a larger feature you may want to open a discussion first. ## Service Widget Guidelines From a0b5ac318a655fa7e8900dcdc9b53a01caeb6045 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:34:24 -0800 Subject: [PATCH 04/16] Update PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ba593523..1edf79cc 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,6 +6,7 @@ ==================== STOP ==== ⚠️ Before opening this pull request please review the guidelines in the checklist below. + If this PR does not meet those guidelines it will not be accepted, and everyone will be sad. --> @@ -14,9 +15,6 @@ If this PR does not meet those guidelines it will not be accepted, and everyone @@ -30,13 +28,13 @@ What type of change does your PR introduce to Homepage? - [ ] New service widget - [ ] Bug fix (non-breaking change which fixes an issue) -- [ ] New feature (non-breaking change which adds functionality) +- [ ] New feature or enhancement (non-breaking change which adds functionality) - [ ] Documentation only - [ ] Other (please explain) ## Checklist: - [ ] If applicable, I have added corresponding documentation changes. -- [ ] If applicable, I have reviewed the [feature](https://gethomepage.dev/more/development/#new-feature-guidelines) and / or [service widget guidelines](https://gethomepage.dev/more/development/#service-widget-guidelines). +- [ ] If applicable, I have reviewed the [feature / enhancement](https://gethomepage.dev/more/development/#new-feature-guidelines) and / or [service widget guidelines](https://gethomepage.dev/more/development/#service-widget-guidelines). - [ ] I have checked that all code style checks pass using [pre-commit hooks](https://gethomepage.dev/more/development/#code-formatting-with-pre-commit-hooks) and [linting checks](https://gethomepage.dev/more/development/#code-linting). - [ ] If applicable, I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers. From 98e816204a32a962f77a92c32d6252616eb3a8c4 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 2 Jan 2025 17:13:36 -0800 Subject: [PATCH 05/16] Update getting-started.md --- docs/widgets/authoring/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/widgets/authoring/getting-started.md b/docs/widgets/authoring/getting-started.md index 73d8b84c..8e16b915 100644 --- a/docs/widgets/authoring/getting-started.md +++ b/docs/widgets/authoring/getting-started.md @@ -48,7 +48,7 @@ self-hosted / open-source alternative, we ask that any widgets, etc. are develop ## New Feature or Enhancement Guidelines {#new-feature-guidelines} -- New features or enhancements, **no matter how small**, should be linked to an existing feature request. The purpose of this requirement is to avoid the addition (and maintenance) of features that might only benefit a small number of users. +- New features or enhancements, **no matter how small**, must be linked to an existing feature request. The purpose of this requirement is to avoid the addition (and maintenance) of features that might only benefit a small number of users. - If you have ideas for a larger feature you may want to open a discussion first. ## Service Widget Guidelines From a6e85240c6152caee146035a85178f4883d090ff Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 2 Jan 2025 17:13:36 -0800 Subject: [PATCH 06/16] Update getting-started.md --- docs/widgets/authoring/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/widgets/authoring/getting-started.md b/docs/widgets/authoring/getting-started.md index 73d8b84c..8e16b915 100644 --- a/docs/widgets/authoring/getting-started.md +++ b/docs/widgets/authoring/getting-started.md @@ -48,7 +48,7 @@ self-hosted / open-source alternative, we ask that any widgets, etc. are develop ## New Feature or Enhancement Guidelines {#new-feature-guidelines} -- New features or enhancements, **no matter how small**, should be linked to an existing feature request. The purpose of this requirement is to avoid the addition (and maintenance) of features that might only benefit a small number of users. +- New features or enhancements, **no matter how small**, must be linked to an existing feature request. The purpose of this requirement is to avoid the addition (and maintenance) of features that might only benefit a small number of users. - If you have ideas for a larger feature you may want to open a discussion first. ## Service Widget Guidelines From 3020a2d1fd57a0374f6cd6a39c80180e395ee48e Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 2 Jan 2025 18:56:48 -0800 Subject: [PATCH 07/16] Fix: better fs height (#4552) --- src/widgets/glances/metrics/fs.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/glances/metrics/fs.jsx b/src/widgets/glances/metrics/fs.jsx index 3285bd0e..adcd1df7 100644 --- a/src/widgets/glances/metrics/fs.jsx +++ b/src/widgets/glances/metrics/fs.jsx @@ -46,7 +46,7 @@ export default function Component({ service }) {
From 6f429a6a4be147c1dfedf6ba8b780f5ab86a32c9 Mon Sep 17 00:00:00 2001 From: Peder Toftegaard Olsen Date: Fri, 3 Jan 2025 04:11:33 +0100 Subject: [PATCH 08/16] Enhancement: add duration format to customapi widget (#4549) Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> --- docs/widgets/services/customapi.md | 4 +++- src/widgets/customapi/component.jsx | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/widgets/services/customapi.md b/docs/widgets/services/customapi.md index c392d942..0deb8294 100644 --- a/docs/widgets/services/customapi.md +++ b/docs/widgets/services/customapi.md @@ -62,10 +62,12 @@ widget: format: size ``` -Supported formats for the values are `text`, `number`, `float`, `percent`, `bytes`, `bitrate`, `size`, `date` and `relativeDate`. +Supported formats for the values are `text`, `number`, `float`, `percent`, `duration`, `bytes`, `bitrate`, `size`, `date` and `relativeDate`. The `dateStyle` and `timeStyle` options of the `date` format are passed directly to [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) and the `style` and `numeric` options of `relativeDate` are passed to [Intl.RelativeTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat). +The `duration` format expects the duration to be specified in seconds. The `scale` transformation tool can be used if a conversion is required. + The `size` format will return the length of the array or string, or the number of keys in an object. This is then formatted as `number`. ## Example diff --git a/src/widgets/customapi/component.jsx b/src/widgets/customapi/component.jsx index 3f1825b2..ea187ae1 100644 --- a/src/widgets/customapi/component.jsx +++ b/src/widgets/customapi/component.jsx @@ -78,6 +78,9 @@ function formatValue(t, mapping, rawValue) { case "percent": value = t("common.percent", { value }); break; + case "duration": + value = t("common.duration", { value }); + break; case "bytes": value = t("common.bytes", { value }); break; From 1a85175b153341aa5e73c944aa4119594fa26fff Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:13:14 -0800 Subject: [PATCH 09/16] Fix: toggle light / dark makes background white (#4553) --- src/pages/index.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 7dbadbf1..fdf716f6 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -459,7 +459,7 @@ function Home({ initialSettings }) { } export default function Wrapper({ initialSettings, fallback }) { - const { theme } = useContext(ThemeContext); + const { themeContext } = useContext(ThemeContext); const wrappedStyle = {}; let backgroundBlur = false; let backgroundSaturate = false; @@ -490,9 +490,9 @@ export default function Wrapper({ initialSettings, fallback }) { id="page_wrapper" className={classNames( "relative", - theme && theme, + initialSettings.theme && initialSettings.theme, initialSettings.color && `theme-${initialSettings.color}`, - theme === "dark" ? "scheme-dark" : "scheme-light", + themeContext === "dark" ? "scheme-dark" : "scheme-light", )} >
Date: Fri, 3 Jan 2025 16:07:55 +1100 Subject: [PATCH 10/16] Documentation: update gluetun apikey config instructions (#4554) Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> --- docs/widgets/services/gluetun.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: From 1b79e5119460df58764d0472382e5ae350c28c78 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sat, 4 Jan 2025 22:13:28 -0800 Subject: [PATCH 11/16] Update source.md --- docs/installation/source.md | 2 ++ 1 file changed, 2 insertions(+) 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. From 2f7d948a5c2070d2d0d454d14b5b04e3bea8f803 Mon Sep 17 00:00:00 2001 From: Adi Vaknin <6841988+DeepSpace2@users.noreply.github.com> Date: Sun, 5 Jan 2025 17:56:12 +0200 Subject: [PATCH 12/16] Fix: quick launch not showing nested services (#4561) Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> --- src/pages/index.jsx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 7dbadbf1..3b4506ef 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) { From 2ee5fd123b2ed5253ca9d3328f27d99a8c908780 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sun, 5 Jan 2025 07:58:28 -0800 Subject: [PATCH 13/16] code style --- src/pages/index.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/index.jsx b/src/pages/index.jsx index ffd920ed..acf23340 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -167,15 +167,15 @@ const headerStyles = { }; function getAllServices(services) { - function get(sg) { - let nestedServices = [...sg.services]; - if (sg.groups.length > 0) { - nestedServices = [...nestedServices, ...sg.groups.map(get).flat()]; + function getServices(group) { + let nestedServices = [...group.services]; + if (group.groups.length > 0) { + nestedServices = [...nestedServices, ...group.groups.map(getServices).flat()]; } return nestedServices; } - return [...services.map(get).flat()]; + return [...services.map(getServices).flat()]; } function Home({ initialSettings }) { From 6a0fbba407baef91b3114793838fefef9338bc09 Mon Sep 17 00:00:00 2001 From: Bjorn Lammers Date: Sun, 5 Jan 2025 22:45:15 +0100 Subject: [PATCH 14/16] Chore: migrate dashboard-icons to homarr-labs (#4564) --- docs/configs/services.md | 2 +- src/components/resolvedicon.jsx | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/docs/configs/services.md b/docs/configs/services.md index 6ef25c39..b1883043 100644 --- a/docs/configs/services.md +++ b/docs/configs/services.md @@ -134,7 +134,7 @@ Services may have descriptions, ## Icons -Services may have an icon attached to them, you can use icons from [Dashboard Icons](https://github.com/walkxcode/dashboard-icons) automatically, by passing the name of the icon, with, or without `.png` or with `.svg` to use the svg version. +Services may have an icon attached to them, you can use icons from [Dashboard Icons](https://github.com/homarr-labs/dashboard-icons) automatically, by passing the name of the icon, with, or without `.png`, `.webp` or `.svg` to specify the desired version. You can also specify prefixed icons from: diff --git a/src/components/resolvedicon.jsx b/src/components/resolvedicon.jsx index de29c0cd..4858f3d5 100644 --- a/src/components/resolvedicon.jsx +++ b/src/components/resolvedicon.jsx @@ -101,7 +101,26 @@ export default function ResolvedIcon({ icon, width = 32, height = 32, alt = "log const iconName = icon.replace(".svg", ""); return ( {alt} + ); + } + + if (icon.endsWith(".webp")) { + const iconName = icon.replace(".webp", ""); + return ( + log
   const iconName = icon.replace( Date: Mon, 6 Jan 2025 00:53:10 -0800 Subject: [PATCH 15/16] Update errorboundry.jsx --- src/components/errorboundry.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/errorboundry.jsx b/src/components/errorboundry.jsx index bad4b552..1b2a3b1e 100644 --- a/src/components/errorboundry.jsx +++ b/src/components/errorboundry.jsx @@ -14,8 +14,10 @@ export default class ErrorBoundary extends React.Component { }); // You can also log error messages to an error reporting service here - // eslint-disable-next-line no-console - console.error(error, errorInfo); + if (error || errorInfo) { + // eslint-disable-next-line no-console + console.error("component error: %s, info: %s", error, errorInfo); + } } render() { From b5f4daa8ef9dc097a0cb66f4ea1716679142f36a Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 6 Jan 2025 07:25:14 -0800 Subject: [PATCH 16/16] Fix: fix bing search logo (#4571) --- src/components/widgets/search/search.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/widgets/search/search.jsx b/src/components/widgets/search/search.jsx index 5a7edc04..f57d7a36 100644 --- a/src/components/widgets/search/search.jsx +++ b/src/components/widgets/search/search.jsx @@ -1,7 +1,8 @@ import { useState, useEffect, Fragment } from "react"; import { useTranslation } from "next-i18next"; import { FiSearch } from "react-icons/fi"; -import { SiDuckduckgo, SiMicrosoftbing, SiGoogle, SiBaidu, SiBrave } from "react-icons/si"; +import { SiDuckduckgo, SiGoogle, SiBaidu, SiBrave } from "react-icons/si"; +import { BiLogoBing } from "react-icons/bi"; import { Listbox, Transition, Combobox } from "@headlessui/react"; import classNames from "classnames"; @@ -25,7 +26,7 @@ export const searchProviders = { name: "Bing", url: "https://www.bing.com/search?q=", suggestionUrl: "https://api.bing.com/osjson.aspx?query=", - icon: SiMicrosoftbing, + icon: BiLogoBing, }, baidu: { name: "Baidu",