From c79d45f91e775b0d2eed070263021d0cffe695c9 Mon Sep 17 00:00:00 2001 From: Denis Papec Date: Sun, 16 Apr 2023 00:05:50 +0100 Subject: [PATCH 01/59] Add optional boxed styling and error component to information widgets Signed-off-by: Denis Papec --- src/components/widgets/datetime/datetime.jsx | 8 +++-- src/components/widgets/error.jsx | 23 +++++++++++++ src/components/widgets/glances/glances.jsx | 30 +++++++--------- src/components/widgets/greeting/greeting.jsx | 7 +++- .../widgets/kubernetes/kubernetes.jsx | 29 +++++++--------- src/components/widgets/logo/logo.jsx | 7 +++- src/components/widgets/longhorn/longhorn.jsx | 25 +++++++------- .../widgets/openmeteo/openmeteo.jsx | 34 +++++++++---------- .../widgets/openweathermap/weather.jsx | 33 +++++++++--------- .../widgets/resources/resources.jsx | 7 +++- src/components/widgets/search/search.jsx | 11 +++--- .../widgets/unifi_console/unifi_console.jsx | 26 +++++++------- src/components/widgets/weather/weather.jsx | 33 +++++++++--------- src/pages/api/widgets/longhorn.js | 2 +- 14 files changed, 153 insertions(+), 122 deletions(-) create mode 100644 src/components/widgets/error.jsx diff --git a/src/components/widgets/datetime/datetime.jsx b/src/components/widgets/datetime/datetime.jsx index 86983473..fc883ec3 100644 --- a/src/components/widgets/datetime/datetime.jsx +++ b/src/components/widgets/datetime/datetime.jsx @@ -1,5 +1,6 @@ import { useState, useEffect } from "react"; import { useTranslation } from "next-i18next"; +import classNames from "classnames"; const textSizes = { "4xl": "text-4xl", @@ -17,7 +18,7 @@ export default function DateTime({ options }) { const { i18n } = useTranslation(); const [date, setDate] = useState(""); const dateLocale = locale ?? i18n.language; - + useEffect(() => { const dateFormat = new Intl.DateTimeFormat(dateLocale, { ...format }); const interval = setInterval(() => { @@ -27,7 +28,10 @@ export default function DateTime({ options }) { }, [date, setDate, dateLocale, format]); return ( -
+
{date} diff --git a/src/components/widgets/error.jsx b/src/components/widgets/error.jsx new file mode 100644 index 00000000..92e0076a --- /dev/null +++ b/src/components/widgets/error.jsx @@ -0,0 +1,23 @@ +import { useTranslation } from "react-i18next"; +import { BiError } from "react-icons/bi"; +import classNames from "classnames"; + +export default function Error({ options }) { + const { t } = useTranslation(); + + return ( +
+
+
+ +
+ {t("widget.api_error")} +
+
+
+
+ ); +} diff --git a/src/components/widgets/glances/glances.jsx b/src/components/widgets/glances/glances.jsx index 85dd44c0..b6daba7b 100644 --- a/src/components/widgets/glances/glances.jsx +++ b/src/components/widgets/glances/glances.jsx @@ -1,11 +1,12 @@ import useSWR from "swr"; import { useContext } from "react"; -import { BiError } from "react-icons/bi"; import { FaMemory, FaRegClock, FaThermometerHalf } from "react-icons/fa"; import { FiCpu, FiHardDrive } from "react-icons/fi"; import { useTranslation } from "next-i18next"; +import classNames from "classnames"; import UsageBar from "../resources/usage-bar"; +import Error from "../error"; import { SettingsContext } from "utils/contexts/settings"; @@ -26,23 +27,15 @@ export default function Widget({ options }) { ); if (error || data?.error) { - return ( -
-
-
- -
- {t("widget.api_error")} -
-
-
-
- ); + return } if (!data) { return ( -
+
@@ -101,7 +94,10 @@ export default function Widget({ options }) { } return ( - +
@@ -184,7 +180,7 @@ export default function Widget({ options }) {
- {t("common.number", { + {t("common.number", { value: mainTemp, maximumFractionDigits: 1, style: "unit", @@ -196,7 +192,7 @@ export default function Widget({ options }) { {options.expanded && (
- {t("common.number", { + {t("common.number", { value: maxTemp, maximumFractionDigits: 1, style: "unit", diff --git a/src/components/widgets/greeting/greeting.jsx b/src/components/widgets/greeting/greeting.jsx index da0f063d..2e129560 100644 --- a/src/components/widgets/greeting/greeting.jsx +++ b/src/components/widgets/greeting/greeting.jsx @@ -1,3 +1,5 @@ +import classNames from "classnames"; + const textSizes = { "4xl": "text-4xl", "3xl": "text-3xl", @@ -12,7 +14,10 @@ const textSizes = { export default function Greeting({ options }) { if (options.text) { return ( -
+
{options.text} diff --git a/src/components/widgets/kubernetes/kubernetes.jsx b/src/components/widgets/kubernetes/kubernetes.jsx index 78c4caaf..514993da 100644 --- a/src/components/widgets/kubernetes/kubernetes.jsx +++ b/src/components/widgets/kubernetes/kubernetes.jsx @@ -1,12 +1,14 @@ import useSWR from "swr"; -import { BiError } from "react-icons/bi"; import { useTranslation } from "next-i18next"; +import classNames from "classnames"; + +import Error from "../error"; import Node from "./node"; export default function Widget({ options }) { const { cluster, nodes } = options; - const { t, i18n } = useTranslation(); + const { i18n } = useTranslation(); const defaultData = { cpu: { @@ -29,23 +31,15 @@ export default function Widget({ options }) { ); if (error || data?.error) { - return ( -
-
-
- -
- {t("widget.api_error")} -
-
-
-
- ); + return } if (!data) { return ( -
+
{cluster.show && @@ -59,7 +53,10 @@ export default function Widget({ options }) { } return ( -
+
{cluster.show && diff --git a/src/components/widgets/logo/logo.jsx b/src/components/widgets/logo/logo.jsx index 96e8569f..6cba17bf 100644 --- a/src/components/widgets/logo/logo.jsx +++ b/src/components/widgets/logo/logo.jsx @@ -1,8 +1,13 @@ +import classNames from "classnames"; + import ResolvedIcon from "components/resolvedicon" export default function Logo({ options }) { return ( -
+
{options.icon ? : // fallback to homepage logo diff --git a/src/components/widgets/longhorn/longhorn.jsx b/src/components/widgets/longhorn/longhorn.jsx index 9fcb21b4..5139f00a 100644 --- a/src/components/widgets/longhorn/longhorn.jsx +++ b/src/components/widgets/longhorn/longhorn.jsx @@ -1,37 +1,36 @@ import useSWR from "swr"; -import { BiError } from "react-icons/bi"; -import { useTranslation } from "next-i18next"; +import classNames from "classnames"; + +import Error from "../error"; import Node from "./node"; export default function Longhorn({ options }) { const { expanded, total, labels, include, nodes } = options; - const { t } = useTranslation(); const { data, error } = useSWR(`/api/widgets/longhorn`, { refreshInterval: 1500 }); if (error || data?.error) { - return ( -
- -
- {t("widget.api_error")} -
-
- ); + return } if (!data) { return ( -
+
); } return ( -
+
{data.nodes .filter((node) => { diff --git a/src/components/widgets/openmeteo/openmeteo.jsx b/src/components/widgets/openmeteo/openmeteo.jsx index 0d29aef5..1381cc55 100644 --- a/src/components/widgets/openmeteo/openmeteo.jsx +++ b/src/components/widgets/openmeteo/openmeteo.jsx @@ -1,9 +1,11 @@ import useSWR from "swr"; import { useState } from "react"; -import { BiError } from "react-icons/bi"; import { WiCloudDown } from "react-icons/wi"; import { MdLocationDisabled, MdLocationSearching } from "react-icons/md"; import { useTranslation } from "next-i18next"; +import classNames from "classnames"; + +import Error from "../error"; import Icon from "./icon"; @@ -15,24 +17,15 @@ function Widget({ options }) { ); if (error || data?.error) { - return ( -
-
-
- -
- {t("widget.api_error")} - - -
-
-
-
- ); + return } if (!data) { return ( -
+
@@ -50,7 +43,10 @@ function Widget({ options }) { const timeOfDay = data.current_weather.time > data.daily.sunrise[0] && data.current_weather.time < data.daily.sunset[0] ? "day" : "night"; return ( -
+
@@ -107,8 +103,10 @@ export default function OpenMeteo({ options }) { - ); + return + {t("weather.current")} + {t("weather.allow")} + + ; } return ; diff --git a/src/components/widgets/openweathermap/weather.jsx b/src/components/widgets/openweathermap/weather.jsx index b404039f..30531513 100644 --- a/src/components/widgets/openweathermap/weather.jsx +++ b/src/components/widgets/openweathermap/weather.jsx @@ -3,12 +3,17 @@ import { useState } from "react"; import { WiCloudDown } from "react-icons/wi"; import { MdLocationDisabled, MdLocationSearching } from "react-icons/md"; import { useTranslation } from "next-i18next"; -import classNames from "classnames"; -import Error from "../error"; +import Error from "../widget/error"; +import Container from "../widget/container"; +import ContainerButton from "../widget/container_button"; +import PrimaryText from "../widget/primary_text"; +import SecondaryText from "../widget/secondary_text"; +import WidgetIcon from "../widget/widget_icon"; import Icon from "./icon"; + function Widget({ options }) { const { t, i18n } = useTranslation(); @@ -21,48 +26,26 @@ function Widget({ options }) { } if (!data) { - return ( -
-
-
- -
-
- {t("weather.updating")} - {t("weather.wait")} -
-
-
- ); + return + {t("weather.updating")} + {t("weather.wait")} + + ; } const unit = options.units === "metric" ? "celsius" : "fahrenheit"; - return ( -
-
-
- data.sys.sunrise && data.dt < data.sys.sunset ? "day" : "night"} - /> -
-
- - {options.label && `${options.label}, `} - {t("common.number", { value: data.main.temp, style: "unit", unit })} - - {data.weather[0].description} -
-
-
- ); + const weatherInfo = { + condition: data.weather[0].id, + timeOfDay: data.dt > data.sys.sunrise && data.dt < data.sys.sunset ? "day" : "night" + }; + + return + {options.label && `${options.label}, `} + {t("common.number", { value: data.main.temp, style: "unit", unit })} + {data.weather[0].description} + + ; } export default function OpenWeatherMap({ options }) { @@ -94,33 +77,12 @@ export default function OpenWeatherMap({ options }) { } }; - // if (!requesting && !location) requestLocation(); - if (!location) { - return ( - - ); + return + {t("weather.current")} + {t("weather.allow")} + + ; } return ; diff --git a/src/components/widgets/resources/cpu.jsx b/src/components/widgets/resources/cpu.jsx index 7069e3c4..242e7a3d 100644 --- a/src/components/widgets/resources/cpu.jsx +++ b/src/components/widgets/resources/cpu.jsx @@ -1,8 +1,13 @@ import useSWR from "swr"; import { FiCpu } from "react-icons/fi"; -import { BiError } from "react-icons/bi"; import { useTranslation } from "next-i18next"; +import SingleResource from "../widget/single_resource"; +import WidgetIcon from "../widget/widget_icon"; +import ResourceValue from "../widget/resource_value"; +import ResourceLabel from "../widget/resource_label"; +import Error from "../widget/error"; + import UsageBar from "./usage-bar"; export default function Cpu({ expanded }) { @@ -13,67 +18,38 @@ export default function Cpu({ expanded }) { }); if (error || data?.error) { - return ( -
- -
- {t("widget.api_error")} -
-
- ); + return } if (!data) { - return ( -
- -
-
-
-
-
{t("resources.cpu")}
-
- {expanded && ( -
-
-
-
{t("resources.load")}
-
- )} - -
-
- ); + return + + - + {t("resources.cpu")} + - + {t("resources.load")} + + } - const percent = data.cpu.usage; - - return ( -
- -
-
-
- {t("common.number", { - value: data.cpu.usage, - style: "unit", - unit: "percent", - maximumFractionDigits: 0, - })} -
-
{t("resources.cpu")}
-
- {expanded && ( -
-
- {t("common.number", { - value: data.cpu.load, - maximumFractionDigits: 2, - })} -
-
{t("resources.load")}
-
- )} - -
-
- ); + return + + + {t("common.number", { + value: data.cpu.usage, + style: "unit", + unit: "percent", + maximumFractionDigits: 0, + })} + + {t("resources.cpu")} + + {t("common.number", { + value: data.cpu.load, + maximumFractionDigits: 2, + })} + + {t("resources.load")} + + } diff --git a/src/components/widgets/resources/cputemp.jsx b/src/components/widgets/resources/cputemp.jsx index 571e6c8a..1a62aa31 100644 --- a/src/components/widgets/resources/cputemp.jsx +++ b/src/components/widgets/resources/cputemp.jsx @@ -1,8 +1,13 @@ import useSWR from "swr"; import { FaThermometerHalf } from "react-icons/fa"; -import { BiError } from "react-icons/bi"; import { useTranslation } from "next-i18next"; +import SingleResource from "../widget/single_resource"; +import WidgetIcon from "../widget/widget_icon"; +import ResourceValue from "../widget/resource_value"; +import ResourceLabel from "../widget/resource_label"; +import Error from "../widget/error"; + import UsageBar from "./usage-bar"; function convertToFahrenheit(t) { @@ -17,34 +22,17 @@ export default function CpuTemp({ expanded, units }) { }); if (error || data?.error) { - return ( -
- -
- {t("widget.api_error")} -
-
- ); + return } if (!data || !data.cputemp) { - return ( -
- -
- -
-
-
{t("resources.temp")}
-
- {expanded && ( - -
-
-
{t("resources.max")}
-
- )} -
-
- ); + return + + - + {t("resources.temp")} + - + {t("resources.max")} + } let mainTemp = data.cputemp.main; @@ -54,38 +42,27 @@ export default function CpuTemp({ expanded, units }) { const unit = units === "imperial" ? "fahrenheit" : "celsius"; mainTemp = (unit === "celsius") ? mainTemp : convertToFahrenheit(mainTemp); const maxTemp = (unit === "celsius") ? data.cputemp.max : convertToFahrenheit(data.cputemp.max); - const percent = Math.round((mainTemp / maxTemp) * 100); - return ( -
- -
- -
- {t("common.number", { - value: mainTemp, - maximumFractionDigits: 1, - style: "unit", - unit - })} -
-
{t("resources.temp")}
-
- {expanded && ( - -
- {t("common.number", { - value: maxTemp, - maximumFractionDigits: 1, - style: "unit", - unit - })} -
-
{t("resources.max")}
-
- )} - -
-
- ); + return + + + {t("common.number", { + value: mainTemp, + maximumFractionDigits: 1, + style: "unit", + unit + })} + + {t("resources.temp")} + + {t("common.number", { + value: maxTemp, + maximumFractionDigits: 1, + style: "unit", + unit + })} + + {t("resources.max")} + + ; } diff --git a/src/components/widgets/resources/disk.jsx b/src/components/widgets/resources/disk.jsx index ca09c095..742ff9d7 100644 --- a/src/components/widgets/resources/disk.jsx +++ b/src/components/widgets/resources/disk.jsx @@ -1,8 +1,13 @@ import useSWR from "swr"; import { FiHardDrive } from "react-icons/fi"; -import { BiError } from "react-icons/bi"; import { useTranslation } from "next-i18next"; +import SingleResource from "../widget/single_resource"; +import WidgetIcon from "../widget/widget_icon"; +import ResourceValue from "../widget/resource_value"; +import ResourceLabel from "../widget/resource_label"; +import Error from "../widget/error"; + import UsageBar from "./usage-bar"; export default function Disk({ options, expanded }) { @@ -13,56 +18,29 @@ export default function Disk({ options, expanded }) { }); if (error || data?.error) { - return ( -
- -
- {t("widget.api_error")} -
-
- ); + return } if (!data) { - return ( -
- -
- -
-
-
{t("resources.free")}
-
- {expanded && ( - -
-
-
{t("resources.total")}
-
- )} - -
-
- ); + return + + - + {t("resources.free")} + - + {t("resources.total")} + + ; } // data.drive.used not accurate? const percent = Math.round(((data.drive.size - data.drive.available) / data.drive.size) * 100); - return ( -
- -
- -
{t("common.bytes", { value: data.drive.available })}
-
{t("resources.free")}
-
- {expanded && ( - -
{t("common.bytes", { value: data.drive.size })}
-
{t("resources.total")}
-
- )} - -
-
- ); + return + + {t("common.bytes", { value: data.drive.available })} + {t("resources.free")} + {t("common.bytes", { value: data.drive.size })} + {t("resources.total")} + + ; } diff --git a/src/components/widgets/resources/memory.jsx b/src/components/widgets/resources/memory.jsx index 30b7c8eb..97c74acc 100644 --- a/src/components/widgets/resources/memory.jsx +++ b/src/components/widgets/resources/memory.jsx @@ -1,8 +1,13 @@ import useSWR from "swr"; import { FaMemory } from "react-icons/fa"; -import { BiError } from "react-icons/bi"; import { useTranslation } from "next-i18next"; +import SingleResource from "../widget/single_resource"; +import WidgetIcon from "../widget/widget_icon"; +import ResourceValue from "../widget/resource_value"; +import ResourceLabel from "../widget/resource_label"; +import Error from "../widget/error"; + import UsageBar from "./usage-bar"; export default function Memory({ expanded }) { @@ -13,63 +18,34 @@ export default function Memory({ expanded }) { }); if (error || data?.error) { - return ( -
- -
- {t("widget.api_error")} -
-
- ); + return } if (!data) { - return ( -
- -
- -
-
-
{t("resources.free")}
-
- {expanded && ( - -
-
-
{t("resources.total")}
-
- )} - -
-
- ); + return + + - + {t("resources.free")} + - + {t("resources.total")} + + ; } const percent = Math.round((data.memory.active / data.memory.total) * 100); - return ( -
- -
- -
- {t("common.bytes", { value: data.memory.available, maximumFractionDigits: 1, binary: true })} -
-
{t("resources.free")}
-
- {expanded && ( - -
- {t("common.bytes", { - value: data.memory.total, - maximumFractionDigits: 1, - binary: true, - })} -
-
{t("resources.total")}
-
- )} - -
-
- ); + return + + {t("common.bytes", { value: data.memory.available, maximumFractionDigits: 1, binary: true })} + {t("resources.free")} + + {t("common.bytes", { + value: data.memory.total, + maximumFractionDigits: 1, + binary: true, + })} + + {t("resources.total")} + + ; } diff --git a/src/components/widgets/resources/resources.jsx b/src/components/widgets/resources/resources.jsx index 5727a2a0..0cc2c301 100644 --- a/src/components/widgets/resources/resources.jsx +++ b/src/components/widgets/resources/resources.jsx @@ -1,4 +1,5 @@ -import classNames from "classnames"; +import Container from "../widget/container"; +import Raw from "../widget/raw"; import Disk from "./disk"; import Cpu from "./cpu"; @@ -8,11 +9,8 @@ import Uptime from "./uptime"; export default function Resources({ options }) { const { expanded, units } = options; - return ( -
+ return +
{options.cpu && } {options.memory && } @@ -25,6 +23,6 @@ export default function Resources({ options }) { {options.label && (
{options.label}
)} -
- ); +
+
; } diff --git a/src/components/widgets/resources/uptime.jsx b/src/components/widgets/resources/uptime.jsx index 3bf785b1..6cc2b8c5 100644 --- a/src/components/widgets/resources/uptime.jsx +++ b/src/components/widgets/resources/uptime.jsx @@ -1,8 +1,13 @@ import useSWR from "swr"; import { FaRegClock } from "react-icons/fa"; -import { BiError } from "react-icons/bi"; import { useTranslation } from "next-i18next"; +import SingleResource from "../widget/single_resource"; +import WidgetIcon from "../widget/widget_icon"; +import ResourceValue from "../widget/resource_value"; +import ResourceLabel from "../widget/resource_label"; +import Error from "../widget/error"; + import UsageBar from "./usage-bar"; export default function Uptime() { @@ -13,35 +18,22 @@ export default function Uptime() { }); if (error || data?.error) { - return ( -
- -
- {t("widget.api_error")} -
-
- ); + return } if (!data) { - return ( -
- -
- -
-
-
{t("resources.temp")}
-
-
-
- ); + return + + - + {t("resources.uptime")} + ; } const mo = Math.floor(data.uptime / (3600 * 24 * 31)); const d = Math.floor(data.uptime % (3600 * 24 * 31) / (3600 * 24)); const h = Math.floor(data.uptime % (3600 * 24) / 3600); const m = Math.floor(data.uptime % 3600 / 60); - + let uptime; if (mo > 0) uptime = `${mo}${t("resources.months")} ${d}${t("resources.days")}`; else if (d > 0) uptime = `${d}${t("resources.days")} ${h}${t("resources.hours")}`; @@ -49,18 +41,10 @@ export default function Uptime() { const percent = Math.round((new Date().getSeconds() / 60) * 100); - return ( -
- -
- -
- {uptime} -
-
{t("resources.uptime")}
-
- -
-
- ); + return + + {uptime} + {t("resources.uptime")} + + ; } diff --git a/src/components/widgets/search/search.jsx b/src/components/widgets/search/search.jsx index bca3eb58..1bac4a61 100644 --- a/src/components/widgets/search/search.jsx +++ b/src/components/widgets/search/search.jsx @@ -1,10 +1,13 @@ -import { useState, useEffect, Fragment } from "react"; +import { useState, useEffect, useCallback, 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 { Listbox, Transition } from "@headlessui/react"; import classNames from "classnames"; +import ContainerForm from "../widget/container_form"; +import Raw from "../widget/raw"; + export const searchProviders = { google: { name: "Google", @@ -77,13 +80,8 @@ export default function Search({ options }) { } }, [availableProviderIds]); - if (!availableProviderIds) { - return null; - } - - function handleSubmit(event) { + const submitCallback = useCallback(event => { const q = encodeURIComponent(query); - const { url } = selectedProvider; if (url) { window.open(`${url}${q}`, options.target || "_blank"); @@ -94,6 +92,10 @@ export default function Search({ options }) { event.preventDefault(); event.target.reset(); setQuery(""); + }, [options.target, options.url, query, selectedProvider]); + + if (!availableProviderIds) { + return null; } const onChangeProvider = (provider) => { @@ -101,80 +103,79 @@ export default function Search({ options }) { localStorage.setItem(localStorageKey, provider.name); } - return ( - -
- setQuery(s.currentTarget.value)} - required - autoCapitalize="off" - autoCorrect="off" - autoComplete="off" - // eslint-disable-next-line jsx-a11y/no-autofocus - autoFocus={options.focus} - /> - -
- + +
+
+ setQuery(s.currentTarget.value)} + required + autoCapitalize="off" + autoCorrect="off" + autoComplete="off" + // eslint-disable-next-line jsx-a11y/no-autofocus + autoFocus={options.focus} + /> + +
+ + + {t("search.search")} + +
+ - - {t("search.search")} - -
- - -
- {availableProviderIds.map((providerId) => { - const p = searchProviders[providerId]; - return ( - - {({ active }) => ( -
  • - -
  • - )} -
    - ); - })} -
    -
    -
    - - - ); + +
    + {availableProviderIds.map((providerId) => { + const p = searchProviders[providerId]; + return ( + + {({ active }) => ( +
  • + +
  • + )} +
    + ); + })} +
    +
    + + +
    +
    + ; } diff --git a/src/components/widgets/unifi_console/unifi_console.jsx b/src/components/widgets/unifi_console/unifi_console.jsx index 1896771f..dad92cc7 100644 --- a/src/components/widgets/unifi_console/unifi_console.jsx +++ b/src/components/widgets/unifi_console/unifi_console.jsx @@ -2,9 +2,12 @@ import { BiError, BiWifi, BiCheckCircle, BiXCircle, BiNetworkChart } from "react import { MdSettingsEthernet } from "react-icons/md"; import { useTranslation } from "next-i18next"; import { SiUbiquiti } from "react-icons/si"; -import classNames from "classnames"; -import Error from "../error"; +import Error from "../widget/error"; +import Container from "../widget/container"; +import Raw from "../widget/raw"; +import WidgetIcon from "../widget/widget_icon"; +import PrimaryText from "../widget/primary_text"; import useWidgetAPI from "utils/proxy/use-widget-api"; @@ -22,21 +25,10 @@ export default function Widget({ options }) { const defaultSite = options.site ? statsData?.data.find(s => s.desc === options.site) : statsData?.data?.find(s => s.name === "default"); if (!defaultSite) { - return ( -
    -
    -
    - -
    -
    - {t("unifi.wait")} -
    -
    -
    - ); + return + {t("unifi.wait")} + + ; } const wan = defaultSite.health.find(h => h.subsystem === "wan"); @@ -51,11 +43,9 @@ export default function Widget({ options }) { const dataEmpty = !(wan.show || lan.show || wlan.show || uptime); - return ( -
    + return + +
    @@ -139,6 +129,7 @@ export default function Widget({ options }) {
    }
    -
    - ); +
    + + } diff --git a/src/components/widgets/weather/weather.jsx b/src/components/widgets/weather/weather.jsx index 51801455..702ea669 100644 --- a/src/components/widgets/weather/weather.jsx +++ b/src/components/widgets/weather/weather.jsx @@ -3,9 +3,13 @@ import { useState } from "react"; import { WiCloudDown } from "react-icons/wi"; import { MdLocationDisabled, MdLocationSearching } from "react-icons/md"; import { useTranslation } from "next-i18next"; -import classNames from "classnames"; -import Error from "../error"; +import Error from "../widget/error"; +import Container from "../widget/container"; +import PrimaryText from "../widget/primary_text"; +import SecondaryText from "../widget/secondary_text"; +import WidgetIcon from "../widget/widget_icon"; +import ContainerButton from "../widget/container_button"; import Icon from "./icon"; @@ -21,49 +25,31 @@ function Widget({ options }) { } if (!data) { - return ( -
    -
    -
    - -
    -
    - {t("weather.updating")} - {t("weather.wait")} -
    -
    -
    - ); + return + {t("weather.updating")} + {t("weather.wait")} + + ; } const unit = options.units === "metric" ? "celsius" : "fahrenheit"; + const weatherInfo = { + condition: data.current.condition.code, + timeOfDay: data.current.is_day ? "day" : "night", + }; - return ( -
    -
    -
    - -
    -
    - - {options.label && `${options.label}, `} - {t("common.number", { - value: options.units === "metric" ? data.current.temp_c : data.current.temp_f, - style: "unit", - unit, - })} - - {data.current.condition.text} -
    -
    -
    - ); + return + + {options.label && `${options.label}, `} + {t("common.number", { + value: options.units === "metric" ? data.current.temp_c : data.current.temp_f, + style: "unit", + unit, + })} + + {data.current.condition.text} + + ; } export default function WeatherApi({ options }) { @@ -95,33 +81,12 @@ export default function WeatherApi({ options }) { } }; - // if (!requesting && !location) requestLocation(); - if (!location) { - return ( - - ); + return + {t("weather.current")} + {t("weather.allow")} + + ; } return ; diff --git a/src/components/widgets/widget.jsx b/src/components/widgets/widget.jsx index 47141887..b4fdb143 100644 --- a/src/components/widgets/widget.jsx +++ b/src/components/widgets/widget.jsx @@ -17,13 +17,13 @@ const widgetMappings = { kubernetes: dynamic(() => import("components/widgets/kubernetes/kubernetes")), }; -export default function Widget({ widget }) { +export default function Widget({ widget, style }) { const InfoWidget = widgetMappings[widget.type]; if (InfoWidget) { return ( - + ); } diff --git a/src/components/widgets/widget/container.jsx b/src/components/widgets/widget/container.jsx new file mode 100644 index 00000000..3a4a9f57 --- /dev/null +++ b/src/components/widgets/widget/container.jsx @@ -0,0 +1,42 @@ +import classNames from "classnames"; + +import WidgetIcon from "./widget_icon"; +import PrimaryText from "./primary_text"; +import SecondaryText from "./secondary_text"; +import Raw from "./raw"; + +export function getAllClasses(options, additionalClassNames = '') { + return classNames( + "flex flex-col justify-center first:ml-0 ml-4 mr-2", + additionalClassNames, + options?.style === "boxedWidgets" && " ml-4 mt-2 m:mb-0 rounded-md shadow-md shadow-theme-900/10 dark:shadow-theme-900/20 bg-theme-100/20 dark:bg-white/5 p-2 pl-3", + ); +} + +export function getInnerBlock(children) { + // children won't be an array if it's Raw component + return Array.isArray(children) &&
    +
    {children.find(child => child.type === WidgetIcon)}
    +
    + {children.find(child => child.type === PrimaryText)} + {children.find(child => child.type === SecondaryText)} +
    +
    ; +} + +export function getBottomBlock(children) { + if (children.type !== Raw) { + return children.find(child => child.type === Raw) || []; + } + + return [children]; +} + +export default function Container({ children = [], options, additionalClassNames = '' }) { + return ( +
    + {getInnerBlock(children)} + {getBottomBlock(children)} +
    + ); +} diff --git a/src/components/widgets/widget/container_button.jsx b/src/components/widgets/widget/container_button.jsx new file mode 100644 index 00000000..92d8a416 --- /dev/null +++ b/src/components/widgets/widget/container_button.jsx @@ -0,0 +1,10 @@ +import { getAllClasses, getInnerBlock, getBottomBlock } from "./container"; + +export default function ContainerButton ({ children = [], options, additionalClassNames = '', callback }) { + return ( + + ); +} diff --git a/src/components/widgets/widget/container_form.jsx b/src/components/widgets/widget/container_form.jsx new file mode 100644 index 00000000..7d28a1bb --- /dev/null +++ b/src/components/widgets/widget/container_form.jsx @@ -0,0 +1,10 @@ +import { getAllClasses, getInnerBlock, getBottomBlock } from "./container"; + +export default function ContainerForm ({ children = [], options, additionalClassNames = '', callback }) { + return ( +
    + {getInnerBlock(children)} + {getBottomBlock(children)} +
    + ); +} diff --git a/src/components/widgets/widget/container_link.jsx b/src/components/widgets/widget/container_link.jsx new file mode 100644 index 00000000..8ef0e80a --- /dev/null +++ b/src/components/widgets/widget/container_link.jsx @@ -0,0 +1,10 @@ +import { getAllClasses, getInnerBlock, getBottomBlock } from "./container"; + +export default function ContainerLink ({ children = [], options, additionalClassNames = '', target }) { + return ( + + {getInnerBlock(children)} + {getBottomBlock(children)} + + ); +} diff --git a/src/components/widgets/widget/error.jsx b/src/components/widgets/widget/error.jsx new file mode 100644 index 00000000..a3dbab85 --- /dev/null +++ b/src/components/widgets/widget/error.jsx @@ -0,0 +1,15 @@ +import { useTranslation } from "react-i18next"; +import { BiError } from "react-icons/bi"; + +import Container from "./container"; +import PrimaryText from "./primary_text"; +import WidgetIcon from "./widget_icon"; + +export default function Error({ options }) { + const { t } = useTranslation(); + + return + {t("widget.api_error")} + + ; +} diff --git a/src/components/widgets/widget/primary_text.jsx b/src/components/widgets/widget/primary_text.jsx new file mode 100644 index 00000000..3418b92c --- /dev/null +++ b/src/components/widgets/widget/primary_text.jsx @@ -0,0 +1,5 @@ +export default function PrimaryText({ children }) { + return ( + {children} + ); +} diff --git a/src/components/widgets/widget/raw.jsx b/src/components/widgets/widget/raw.jsx new file mode 100644 index 00000000..44e3dddc --- /dev/null +++ b/src/components/widgets/widget/raw.jsx @@ -0,0 +1,7 @@ +export default function Raw({ children }) { + if (children.type === Raw) { + return [children]; + } + + return children; +} diff --git a/src/components/widgets/widget/resource_label.jsx b/src/components/widgets/widget/resource_label.jsx new file mode 100644 index 00000000..87f2ad22 --- /dev/null +++ b/src/components/widgets/widget/resource_label.jsx @@ -0,0 +1,5 @@ +export default function ResourceLabel({ children }) { + return ( +
    {children}
    + ); +} diff --git a/src/components/widgets/widget/resource_value.jsx b/src/components/widgets/widget/resource_value.jsx new file mode 100644 index 00000000..8971c748 --- /dev/null +++ b/src/components/widgets/widget/resource_value.jsx @@ -0,0 +1,5 @@ +export default function ResourceValue({ children }) { + return ( +
    {children}
    + ); +} diff --git a/src/components/widgets/widget/resources.jsx b/src/components/widgets/widget/resources.jsx new file mode 100644 index 00000000..0771ec5e --- /dev/null +++ b/src/components/widgets/widget/resources.jsx @@ -0,0 +1,15 @@ +import ContainerLink from "./container_link"; +import SingleResource from "./single_resource"; +import Raw from "./raw"; +import WidgetLabel from "./widget_label"; + +export default function Resources({ options, children, target }) { + return + +
    + {children.filter(child => child && child.type === SingleResource)} +
    + {children.filter(child => child && child.type === WidgetLabel)} +
    +
    ; +} diff --git a/src/components/widgets/widget/secondary_text.jsx b/src/components/widgets/widget/secondary_text.jsx new file mode 100644 index 00000000..363d1bd0 --- /dev/null +++ b/src/components/widgets/widget/secondary_text.jsx @@ -0,0 +1,5 @@ +export default function SecondaryText({ children }) { + return ( + {children} + ); +} diff --git a/src/components/widgets/widget/single_resource.jsx b/src/components/widgets/widget/single_resource.jsx new file mode 100644 index 00000000..7a83d8be --- /dev/null +++ b/src/components/widgets/widget/single_resource.jsx @@ -0,0 +1,28 @@ +import UsageBar from "../resources/usage-bar"; + +import WidgetIcon from "./widget_icon"; +import ResourceValue from "./resource_value"; +import ResourceLabel from "./resource_label"; +import Raw from "./raw"; + +export default function SingleResource({ children, key, expanded = false }) { + const values = children.filter(child => child.type === ResourceValue); + const labels = children.filter(child => child.type === ResourceLabel); + + return
    + {children.find(child => child.type === WidgetIcon)} +
    +
    + {values.pop()} + {labels.pop()} +
    + { expanded &&
    + {values.pop()} + {labels.pop()} +
    + } + {children.find(child => child.type === UsageBar)} +
    + {children.find(child => child.type === Raw)} +
    ; +} diff --git a/src/components/widgets/widget/widget_icon.jsx b/src/components/widgets/widget/widget_icon.jsx new file mode 100644 index 00000000..9766a879 --- /dev/null +++ b/src/components/widgets/widget/widget_icon.jsx @@ -0,0 +1,18 @@ +export default function WidgetIcon({ icon, size = "s", pulse = false, weatherInfo = {} }) { + const Icon = icon; + const { condition, timeOfDay } = weatherInfo; + let additionalClasses = "text-theme-800 dark:text-theme-200 "; + + switch (size) { + case "m": additionalClasses += "w-6 h-6 "; break; + case "l": additionalClasses += "w-8 h-8 "; break; + case "xl": additionalClasses += "w-10 h-10 "; break; + default: additionalClasses += "w-5 h-5 "; + } + + if (pulse) { + additionalClasses += "animate-pulse "; + } + + return ; +} diff --git a/src/components/widgets/widget/widget_label.jsx b/src/components/widgets/widget/widget_label.jsx new file mode 100644 index 00000000..dcb9b9e9 --- /dev/null +++ b/src/components/widgets/widget/widget_label.jsx @@ -0,0 +1,3 @@ +export default function WidgetLabel({ label = "" }) { + return
    {label}
    +} diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 06e55010..902c79df 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -160,6 +160,7 @@ const headerStyles = { "m-4 mb-0 sm:m-8 sm:mb-0 rounded-md shadow-md shadow-theme-900/10 dark:shadow-theme-900/20 bg-theme-100/20 dark:bg-white/5 p-3", underlined: "m-4 mb-0 sm:m-8 sm:mb-1 border-b-2 pb-4 border-theme-800 dark:border-theme-200/50", clean: "m-4 mb-0 sm:m-8 sm:mb-0", + boxedWidgets: "m-4 mb-0 sm:m-8 sm:mb-0 sm:mt-1", }; function Home({ initialSettings }) { @@ -208,6 +209,7 @@ function Home({ initialSettings }) { searchProvider = searchProviders[searchWidget.options?.provider]; } } + const headerStyle = initialSettings?.headerStyle || "underlined"; useEffect(() => { function handleKeyDown(e) { @@ -256,7 +258,7 @@ function Home({ initialSettings }) {
    !rightAlignedWidgets.includes(widget.type)) .map((widget, i) => ( - + ))} -
    +
    {widgets .filter((widget) => rightAlignedWidgets.includes(widget.type)) .map((widget, i) => ( - + ))}
    From a55fe939cbbc32dc636d2e61127acda30333aa81 Mon Sep 17 00:00:00 2001 From: Denis Papec Date: Mon, 5 Jun 2023 23:18:18 +0100 Subject: [PATCH 03/59] Further improvements to simplify information widgets Signed-off-by: Denis Papec --- src/components/widgets/glances/glances.jsx | 130 ++++++++---------- src/components/widgets/longhorn/node.jsx | 25 ++-- src/components/widgets/resources/cpu.jsx | 54 +++----- src/components/widgets/resources/cputemp.jsx | 63 ++++----- src/components/widgets/resources/disk.jsx | 41 +++--- src/components/widgets/resources/memory.jsx | 47 +++---- src/components/widgets/resources/uptime.jsx | 22 +-- src/components/widgets/widget/resource.jsx | 22 +++ .../widgets/widget/resource_label.jsx | 5 - .../widgets/widget/resource_value.jsx | 5 - src/components/widgets/widget/resources.jsx | 6 +- .../widgets/widget/single_resource.jsx | 28 ---- 12 files changed, 181 insertions(+), 267 deletions(-) create mode 100644 src/components/widgets/widget/resource.jsx delete mode 100644 src/components/widgets/widget/resource_label.jsx delete mode 100644 src/components/widgets/widget/resource_value.jsx delete mode 100644 src/components/widgets/widget/single_resource.jsx diff --git a/src/components/widgets/glances/glances.jsx b/src/components/widgets/glances/glances.jsx index debb09c7..b45dfefe 100644 --- a/src/components/widgets/glances/glances.jsx +++ b/src/components/widgets/glances/glances.jsx @@ -4,12 +4,8 @@ import { FaMemory, FaRegClock, FaThermometerHalf } from "react-icons/fa"; import { FiCpu, FiHardDrive } from "react-icons/fi"; import { useTranslation } from "next-i18next"; -import UsageBar from "../resources/usage-bar"; import Error from "../widget/error"; -import SingleResource from "../widget/single_resource"; -import WidgetIcon from "../widget/widget_icon"; -import ResourceValue from "../widget/resource_value"; -import ResourceLabel from "../widget/resource_label"; +import Resource from "../widget/resource"; import Resources from "../widget/resources"; import WidgetLabel from "../widget/widget_label"; @@ -37,31 +33,11 @@ export default function Widget({ options }) { if (!data) { return - - - {t("glances.wait")} - - - - - {t("glances.wait")} - - - {options.cputemp && - - - {t("glances.wait")} - - - } - {options.uptime && - - - {t("glances.wait")} - - - } - {options.label && } + + + { options.cputemp && } + { options.uptime && } + { options.label && } ; } @@ -93,77 +69,81 @@ export default function Widget({ options }) { return ( - - - {t("common.number", { + - {t("glances.cpu")} - {t("common.number", { + })} + label={t("glances.cpu")} + expandedValue={t("common.number", { value: data.load.min15, style: "unit", unit: "percent", - maximumFractionDigits: 0, - })} - {t("glances.load")} - - - - - {t("common.bytes", { + maximumFractionDigits: 0 + })} + expandedLabel={t("glances.load")} + percentage={data.cpu.total} + expanded={options.expanded} + /> + - {t("glances.free")} - {t("common.bytes", { + })} + label={t("glances.free")} + expandedValue={t("common.bytes", { value: data.mem.total, maximumFractionDigits: 1, binary: true, - })} - {t("glances.total")} - - + })} + expandedLabel={t("glances.total")} + percentage={data.mem.percent} + expanded={options.expanded} + /> {disks.map((disk) => ( - - - {t("common.bytes", { value: disk.free })} - {t("glances.free")} - {t("common.bytes", { value: disk.size })} - {t("glances.total")} - - + ))} {options.cputemp && mainTemp > 0 && - - - {t("common.number", { + - {t("glances.temp")} - {t("common.number", { + })} + label={t("glances.temp")} + expandedValue={t("common.number", { value: maxTemp, maximumFractionDigits: 1, style: "unit", unit - })} - {t("glances.warn")} - - + })} + expandedLabel={t("glances.warn")} + percentage={tempPercent} + expanded={options.expanded} + /> } {options.uptime && data.uptime && - - - {data.uptime.replace(" days,", t("glances.days")).replace(/:\d\d:\d\d$/g, t("glances.hours"))} - {t("glances.uptime")} - - + } {options.label && } diff --git a/src/components/widgets/longhorn/node.jsx b/src/components/widgets/longhorn/node.jsx index 9983486e..5235698a 100644 --- a/src/components/widgets/longhorn/node.jsx +++ b/src/components/widgets/longhorn/node.jsx @@ -1,23 +1,20 @@ import { useTranslation } from "next-i18next"; import { FaThermometerHalf } from "react-icons/fa"; -import UsageBar from "../resources/usage-bar"; -import SingleResource from "../widget/single_resource"; -import WidgetIcon from "../widget/widget_icon"; -import ResourceValue from "../widget/resource_value"; -import ResourceLabel from "../widget/resource_label"; +import Resource from "../widget/resource"; import WidgetLabel from "../widget/widget_label"; export default function Node({ data, expanded, labels }) { const { t } = useTranslation(); - return - - {t("common.bytes", { value: data.node.available })} - {t("resources.free")} - {t("common.bytes", { value: data.node.maximum })} - {t("resources.total")} - - { labels && } - + return { labels && } + } diff --git a/src/components/widgets/resources/cpu.jsx b/src/components/widgets/resources/cpu.jsx index 242e7a3d..12972fe8 100644 --- a/src/components/widgets/resources/cpu.jsx +++ b/src/components/widgets/resources/cpu.jsx @@ -2,14 +2,9 @@ import useSWR from "swr"; import { FiCpu } from "react-icons/fi"; import { useTranslation } from "next-i18next"; -import SingleResource from "../widget/single_resource"; -import WidgetIcon from "../widget/widget_icon"; -import ResourceValue from "../widget/resource_value"; -import ResourceLabel from "../widget/resource_label"; +import Resource from "../widget/resource"; import Error from "../widget/error"; -import UsageBar from "./usage-bar"; - export default function Cpu({ expanded }) { const { t } = useTranslation(); @@ -22,34 +17,25 @@ export default function Cpu({ expanded }) { } if (!data) { - return - - - - {t("resources.cpu")} - - - {t("resources.load")} - - + return } - return - - - {t("common.number", { - value: data.cpu.usage, - style: "unit", - unit: "percent", - maximumFractionDigits: 0, - })} - - {t("resources.cpu")} - - {t("common.number", { - value: data.cpu.load, - maximumFractionDigits: 2, - })} - - {t("resources.load")} - - + return } diff --git a/src/components/widgets/resources/cputemp.jsx b/src/components/widgets/resources/cputemp.jsx index 1a62aa31..ba6d9b73 100644 --- a/src/components/widgets/resources/cputemp.jsx +++ b/src/components/widgets/resources/cputemp.jsx @@ -2,14 +2,9 @@ import useSWR from "swr"; import { FaThermometerHalf } from "react-icons/fa"; import { useTranslation } from "next-i18next"; -import SingleResource from "../widget/single_resource"; -import WidgetIcon from "../widget/widget_icon"; -import ResourceValue from "../widget/resource_value"; -import ResourceLabel from "../widget/resource_label"; +import Resource from "../widget/resource"; import Error from "../widget/error"; -import UsageBar from "./usage-bar"; - function convertToFahrenheit(t) { return t * 9/5 + 32 } @@ -26,13 +21,14 @@ export default function CpuTemp({ expanded, units }) { } if (!data || !data.cputemp) { - return - - - - {t("resources.temp")} - - - {t("resources.max")} - + return ; } let mainTemp = data.cputemp.main; @@ -43,26 +39,23 @@ export default function CpuTemp({ expanded, units }) { mainTemp = (unit === "celsius") ? mainTemp : convertToFahrenheit(mainTemp); const maxTemp = (unit === "celsius") ? data.cputemp.max : convertToFahrenheit(data.cputemp.max); - return - - - {t("common.number", { - value: mainTemp, - maximumFractionDigits: 1, - style: "unit", - unit - })} - - {t("resources.temp")} - - {t("common.number", { - value: maxTemp, - maximumFractionDigits: 1, - style: "unit", - unit - })} - - {t("resources.max")} - - ; + return ; } diff --git a/src/components/widgets/resources/disk.jsx b/src/components/widgets/resources/disk.jsx index 742ff9d7..ab56624d 100644 --- a/src/components/widgets/resources/disk.jsx +++ b/src/components/widgets/resources/disk.jsx @@ -2,14 +2,9 @@ import useSWR from "swr"; import { FiHardDrive } from "react-icons/fi"; import { useTranslation } from "next-i18next"; -import SingleResource from "../widget/single_resource"; -import WidgetIcon from "../widget/widget_icon"; -import ResourceValue from "../widget/resource_value"; -import ResourceLabel from "../widget/resource_label"; +import Resource from "../widget/resource"; import Error from "../widget/error"; -import UsageBar from "./usage-bar"; - export default function Disk({ options, expanded }) { const { t } = useTranslation(); @@ -22,25 +17,27 @@ export default function Disk({ options, expanded }) { } if (!data) { - return - - - - {t("resources.free")} - - - {t("resources.total")} - - ; + return ; } // data.drive.used not accurate? const percent = Math.round(((data.drive.size - data.drive.available) / data.drive.size) * 100); - return - - {t("common.bytes", { value: data.drive.available })} - {t("resources.free")} - {t("common.bytes", { value: data.drive.size })} - {t("resources.total")} - - ; + return ; } diff --git a/src/components/widgets/resources/memory.jsx b/src/components/widgets/resources/memory.jsx index 97c74acc..19ae8687 100644 --- a/src/components/widgets/resources/memory.jsx +++ b/src/components/widgets/resources/memory.jsx @@ -2,14 +2,9 @@ import useSWR from "swr"; import { FaMemory } from "react-icons/fa"; import { useTranslation } from "next-i18next"; -import SingleResource from "../widget/single_resource"; -import WidgetIcon from "../widget/widget_icon"; -import ResourceValue from "../widget/resource_value"; -import ResourceLabel from "../widget/resource_label"; +import Resource from "../widget/resource"; import Error from "../widget/error"; -import UsageBar from "./usage-bar"; - export default function Memory({ expanded }) { const { t } = useTranslation(); @@ -22,30 +17,26 @@ export default function Memory({ expanded }) { } if (!data) { - return - - - - {t("resources.free")} - - - {t("resources.total")} - - ; + return ; } const percent = Math.round((data.memory.active / data.memory.total) * 100); - return - - {t("common.bytes", { value: data.memory.available, maximumFractionDigits: 1, binary: true })} - {t("resources.free")} - - {t("common.bytes", { - value: data.memory.total, - maximumFractionDigits: 1, - binary: true, - })} - - {t("resources.total")} - - ; + return ; } diff --git a/src/components/widgets/resources/uptime.jsx b/src/components/widgets/resources/uptime.jsx index 6cc2b8c5..3984975f 100644 --- a/src/components/widgets/resources/uptime.jsx +++ b/src/components/widgets/resources/uptime.jsx @@ -2,14 +2,9 @@ import useSWR from "swr"; import { FaRegClock } from "react-icons/fa"; import { useTranslation } from "next-i18next"; -import SingleResource from "../widget/single_resource"; -import WidgetIcon from "../widget/widget_icon"; -import ResourceValue from "../widget/resource_value"; -import ResourceLabel from "../widget/resource_label"; +import Resource from "../widget/resource"; import Error from "../widget/error"; -import UsageBar from "./usage-bar"; - export default function Uptime() { const { t } = useTranslation(); @@ -22,11 +17,7 @@ export default function Uptime() { } if (!data) { - return - - - - {t("resources.uptime")} - ; + return ; } const mo = Math.floor(data.uptime / (3600 * 24 * 31)); @@ -39,12 +30,7 @@ export default function Uptime() { else if (d > 0) uptime = `${d}${t("resources.days")} ${h}${t("resources.hours")}`; else uptime = `${h}${t("resources.hours")} ${m}${t("resources.minutes")}`; - const percent = Math.round((new Date().getSeconds() / 60) * 100); + const percent = Math.round((new Date().getSeconds() / 60) * 100).toString(); - return - - {uptime} - {t("resources.uptime")} - - ; + return ; } diff --git a/src/components/widgets/widget/resource.jsx b/src/components/widgets/widget/resource.jsx new file mode 100644 index 00000000..e77bcb5a --- /dev/null +++ b/src/components/widgets/widget/resource.jsx @@ -0,0 +1,22 @@ +import UsageBar from "../resources/usage-bar"; + +export default function Resource({ children, icon, value, label, expandedValue, expandedLabel, percentage, key, expanded = false }) { + const Icon = icon; + + return
    + +
    +
    +
    {value}
    +
    {label}
    +
    + { expanded &&
    +
    {expandedValue}
    +
    {expandedLabel}
    +
    + } + { percentage && } + { children } +
    +
    ; +} diff --git a/src/components/widgets/widget/resource_label.jsx b/src/components/widgets/widget/resource_label.jsx deleted file mode 100644 index 87f2ad22..00000000 --- a/src/components/widgets/widget/resource_label.jsx +++ /dev/null @@ -1,5 +0,0 @@ -export default function ResourceLabel({ children }) { - return ( -
    {children}
    - ); -} diff --git a/src/components/widgets/widget/resource_value.jsx b/src/components/widgets/widget/resource_value.jsx deleted file mode 100644 index 8971c748..00000000 --- a/src/components/widgets/widget/resource_value.jsx +++ /dev/null @@ -1,5 +0,0 @@ -export default function ResourceValue({ children }) { - return ( -
    {children}
    - ); -} diff --git a/src/components/widgets/widget/resources.jsx b/src/components/widgets/widget/resources.jsx index 0771ec5e..19fb021d 100644 --- a/src/components/widgets/widget/resources.jsx +++ b/src/components/widgets/widget/resources.jsx @@ -1,5 +1,5 @@ import ContainerLink from "./container_link"; -import SingleResource from "./single_resource"; +import Resource from "./resource"; import Raw from "./raw"; import WidgetLabel from "./widget_label"; @@ -7,9 +7,9 @@ export default function Resources({ options, children, target }) { return
    - {children.filter(child => child && child.type === SingleResource)} + { children.filter(child => child && child.type === Resource) }
    - {children.filter(child => child && child.type === WidgetLabel)} + { children.filter(child => child && child.type === WidgetLabel) }
    ; } diff --git a/src/components/widgets/widget/single_resource.jsx b/src/components/widgets/widget/single_resource.jsx deleted file mode 100644 index 7a83d8be..00000000 --- a/src/components/widgets/widget/single_resource.jsx +++ /dev/null @@ -1,28 +0,0 @@ -import UsageBar from "../resources/usage-bar"; - -import WidgetIcon from "./widget_icon"; -import ResourceValue from "./resource_value"; -import ResourceLabel from "./resource_label"; -import Raw from "./raw"; - -export default function SingleResource({ children, key, expanded = false }) { - const values = children.filter(child => child.type === ResourceValue); - const labels = children.filter(child => child.type === ResourceLabel); - - return
    - {children.find(child => child.type === WidgetIcon)} -
    -
    - {values.pop()} - {labels.pop()} -
    - { expanded &&
    - {values.pop()} - {labels.pop()} -
    - } - {children.find(child => child.type === UsageBar)} -
    - {children.find(child => child.type === Raw)} -
    ; -} From 91e0ec2f830a3135b5e12715d4622ebe8e685490 Mon Sep 17 00:00:00 2001 From: Denis Papec Date: Wed, 7 Jun 2023 00:53:10 +0100 Subject: [PATCH 04/59] Fixes for portainer and kubernetes widget error messages, and error messages for services behind the reverse proxy Signed-off-by: Denis Papec --- src/components/services/widget/error.jsx | 6 ++++-- src/widgets/kubernetes/component.jsx | 2 +- src/widgets/portainer/component.jsx | 9 +++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/services/widget/error.jsx b/src/components/services/widget/error.jsx index 587c572f..cf5e1366 100644 --- a/src/components/services/widget/error.jsx +++ b/src/components/services/widget/error.jsx @@ -9,10 +9,12 @@ function displayData(data) { return (data.type === 'Buffer') ? Buffer.from(data).toString() : JSON.stringify(data, 4); } -export default function Error({ error: err }) { +export default function Error({ error }) { const { t } = useTranslation(); - const { error } = err?.data ?? { error: err }; + if (error?.data?.error) { + error = error.data.error; // eslint-disable-line no-param-reassign + } return (
    diff --git a/src/widgets/kubernetes/component.jsx b/src/widgets/kubernetes/component.jsx index c4d67553..e756e4be 100644 --- a/src/widgets/kubernetes/component.jsx +++ b/src/widgets/kubernetes/component.jsx @@ -16,7 +16,7 @@ export default function Component({ service }) { `/api/kubernetes/stats/${widget.namespace}/${widget.app}?${podSelectorString}`); if (statsError || statusError) { - return ; + return ; } if (statusData && statusData.status !== "running") { diff --git a/src/widgets/portainer/component.jsx b/src/widgets/portainer/component.jsx index aab9eba1..7da289c4 100644 --- a/src/widgets/portainer/component.jsx +++ b/src/widgets/portainer/component.jsx @@ -1,12 +1,8 @@ -import { useTranslation } from "next-i18next"; - import Container from "components/services/widget/container"; import Block from "components/services/widget/block"; import useWidgetAPI from "utils/proxy/use-widget-api"; export default function Component({ service }) { - const { t } = useTranslation(); - const { widget } = service; const { data: containersData, error: containersError } = useWidgetAPI(widget, "docker/containers/json", { @@ -27,8 +23,9 @@ export default function Component({ service }) { ); } - if (containersData.error) { - return ; + if (containersData.error || !Array.isArray(containersData)) { + // containersData can be itself an error object + return ; } const running = containersData.filter((c) => c.State === "running").length; From ea50a851f3ec4a2f8b3513be6984953050f0edbb Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 8 Jun 2023 07:12:14 -0700 Subject: [PATCH 05/59] Change lidarr to artist instead of album --- public/locales/en/common.json | 2 +- src/widgets/lidarr/component.jsx | 14 ++++++-------- src/widgets/lidarr/widget.js | 7 ++----- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/public/locales/en/common.json b/public/locales/en/common.json index e20e1908..c90287da 100755 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -209,7 +209,7 @@ "lidarr": { "wanted": "Wanted", "queued": "Queued", - "albums": "Albums" + "artists": "Artists" }, "readarr": { "wanted": "Wanted", diff --git a/src/widgets/lidarr/component.jsx b/src/widgets/lidarr/component.jsx index 77d831f8..68360d82 100644 --- a/src/widgets/lidarr/component.jsx +++ b/src/widgets/lidarr/component.jsx @@ -9,23 +9,21 @@ export default function Component({ service }) { const { widget } = service; - // album API endpoint can get massive, so we prevent calling if not included in fields see https://github.com/benphelps/homepage/discussions/1577 - const showAlbums = widget.fields?.includes('albums') || !widget.fields; - const { data: albumsData, error: albumsError } = useWidgetAPI(widget, showAlbums ? "album" : ""); + const { data: artistsData, error: artistsError } = useWidgetAPI(widget, "artist"); const { data: wantedData, error: wantedError } = useWidgetAPI(widget, "wanted/missing"); const { data: queueData, error: queueError } = useWidgetAPI(widget, "queue/status"); - if (albumsError || wantedError || queueError) { - const finalError = albumsError ?? wantedError ?? queueError; + if (artistsError || wantedError || queueError) { + const finalError = artistsError ?? wantedError ?? queueError; return ; } - if ((showAlbums && !albumsData) || !wantedData || !queueData) { + if (!artistsData || !wantedData || !queueData) { return ( - + ); } @@ -34,7 +32,7 @@ export default function Component({ service }) { - {showAlbums && } + ); } diff --git a/src/widgets/lidarr/widget.js b/src/widgets/lidarr/widget.js index 6ff93254..55975e63 100644 --- a/src/widgets/lidarr/widget.js +++ b/src/widgets/lidarr/widget.js @@ -6,11 +6,8 @@ const widget = { proxyHandler: genericProxyHandler, mappings: { - album: { - endpoint: "album", - map: (data) => ({ - have: jsonArrayFilter(data, (item) => item?.statistics?.percentOfTracks === 100).length, - }), + artist: { + endpoint: "artist", }, "wanted/missing": { endpoint: "wanted/missing", From 07c0c0faf4a9687377cb532e0b6b9e0901ab0364 Mon Sep 17 00:00:00 2001 From: gallegonovato Date: Wed, 7 Jun 2023 14:33:09 +0000 Subject: [PATCH 06/59] Translated using Weblate (Spanish) Currently translated at 100.0% (465 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/es/ --- public/locales/es/common.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/locales/es/common.json b/public/locales/es/common.json index 5d528e64..b0efcd6b 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -67,16 +67,16 @@ "wanted": "Buscando", "queued": "En cola", "series": "Series", - "queue": "Queue", - "unknown": "Unknown" + "queue": "Poner a la cola", + "unknown": "Desconocido" }, "radarr": { "wanted": "Buscando", "queued": "En cola", "movies": "Películas", "missing": "Faltan", - "queue": "Queue", - "unknown": "Unknown" + "queue": "Poner a la cola", + "unknown": "Desconocido" }, "readarr": { "wanted": "Buscando", From b934fc429deea078f864ab2179352739ed208781 Mon Sep 17 00:00:00 2001 From: Nonoss117 Date: Tue, 6 Jun 2023 21:45:19 +0000 Subject: [PATCH 07/59] Translated using Weblate (French) Currently translated at 100.0% (465 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/fr/ --- public/locales/fr/common.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/locales/fr/common.json b/public/locales/fr/common.json index 12f2098c..269a1adb 100644 --- a/public/locales/fr/common.json +++ b/public/locales/fr/common.json @@ -67,16 +67,16 @@ "wanted": "Demande", "queued": "Attente", "series": "Séries", - "queue": "Queue", - "unknown": "Unknown" + "queue": "Attente", + "unknown": "Inconnu" }, "radarr": { "wanted": "Demande", "queued": "Attente", "movies": "Films", "missing": "Manquant", - "queue": "Queue", - "unknown": "Unknown" + "queue": "Attente", + "unknown": "Inconnu" }, "readarr": { "wanted": "Demande", From 7588dd03dbdce48e12bdb8721d0e84703e9ff57a Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 7 Jun 2023 08:25:34 +0000 Subject: [PATCH 08/59] Translated using Weblate (Ukrainian) Currently translated at 100.0% (465 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/uk/ --- public/locales/uk/common.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/locales/uk/common.json b/public/locales/uk/common.json index 2561f4a8..08c16483 100644 --- a/public/locales/uk/common.json +++ b/public/locales/uk/common.json @@ -233,16 +233,16 @@ "wanted": "Розшукується", "queued": "У черзі", "series": "Серії", - "queue": "Queue", - "unknown": "Unknown" + "queue": "Черга", + "unknown": "Невідомо" }, "radarr": { "wanted": "Розшукується", "missing": "Відсутній", "queued": "У черзі", "movies": "Фільми", - "queue": "Queue", - "unknown": "Unknown" + "queue": "Черга", + "unknown": "Невідомо" }, "lidarr": { "wanted": "Розшукується", From 3d0cc6aeeba5e191b68d0dc12901baa868fce10a Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 8 Jun 2023 16:16:16 +0200 Subject: [PATCH 09/59] Update translation files Updated by "Cleanup translation files" hook in Weblate. Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ --- public/locales/ar/common.json | 3 +-- public/locales/bg/common.json | 3 +-- public/locales/ca/common.json | 3 +-- public/locales/cs/common.json | 3 +-- public/locales/da/common.json | 3 +-- public/locales/de/common.json | 3 +-- public/locales/el/common.json | 3 +-- public/locales/eo/common.json | 3 +-- public/locales/es/common.json | 3 +-- public/locales/fi/common.json | 3 +-- public/locales/fr/common.json | 3 +-- public/locales/he/common.json | 3 +-- public/locales/hi/common.json | 3 +-- public/locales/hr/common.json | 3 +-- public/locales/hu/common.json | 1 - public/locales/id/common.json | 3 +-- public/locales/it/common.json | 3 +-- public/locales/ja/common.json | 3 +-- public/locales/ko/common.json | 3 +-- public/locales/lv/common.json | 3 +-- public/locales/ms/common.json | 1 - public/locales/nb-NO/common.json | 3 +-- public/locales/nl/common.json | 3 +-- public/locales/pl/common.json | 3 +-- public/locales/pt-BR/common.json | 3 +-- public/locales/pt/common.json | 3 +-- public/locales/ro/common.json | 3 +-- public/locales/ru/common.json | 3 +-- public/locales/sk/common.json | 3 +-- public/locales/sl/common.json | 3 +-- public/locales/sr/common.json | 3 +-- public/locales/sv/common.json | 3 +-- public/locales/te/common.json | 3 +-- public/locales/th/common.json | 3 +-- public/locales/tr/common.json | 3 +-- public/locales/uk/common.json | 3 +-- public/locales/vi/common.json | 3 +-- public/locales/yue/common.json | 3 +-- public/locales/zh-CN/common.json | 3 +-- public/locales/zh-Hant/common.json | 3 +-- 40 files changed, 38 insertions(+), 78 deletions(-) diff --git a/public/locales/ar/common.json b/public/locales/ar/common.json index cecfb771..7562e8ea 100644 --- a/public/locales/ar/common.json +++ b/public/locales/ar/common.json @@ -193,8 +193,7 @@ }, "lidarr": { "wanted": "مطلوب", - "queued": "في الإنتظار", - "albums": "ألبومات" + "queued": "في الإنتظار" }, "readarr": { "wanted": "مطلوب", diff --git a/public/locales/bg/common.json b/public/locales/bg/common.json index e567de17..7b96b3d0 100644 --- a/public/locales/bg/common.json +++ b/public/locales/bg/common.json @@ -131,8 +131,7 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued", - "albums": "Albums" + "queued": "Queued" }, "readarr": { "wanted": "Wanted", diff --git a/public/locales/ca/common.json b/public/locales/ca/common.json index b133c24f..399a9649 100644 --- a/public/locales/ca/common.json +++ b/public/locales/ca/common.json @@ -176,8 +176,7 @@ }, "lidarr": { "wanted": "Volgut", - "queued": "En cua", - "albums": "Àlbums" + "queued": "En cua" }, "adguard": { "queries": "Consultes", diff --git a/public/locales/cs/common.json b/public/locales/cs/common.json index e4699e86..e38cc629 100644 --- a/public/locales/cs/common.json +++ b/public/locales/cs/common.json @@ -147,8 +147,7 @@ }, "lidarr": { "wanted": "Hledané", - "queued": "Ve frontě", - "albums": "Alba" + "queued": "Ve frontě" }, "readarr": { "wanted": "Hledané", diff --git a/public/locales/da/common.json b/public/locales/da/common.json index ccaa5d52..7f4ceffd 100644 --- a/public/locales/da/common.json +++ b/public/locales/da/common.json @@ -15,8 +15,7 @@ }, "lidarr": { "wanted": "Ønsket", - "queued": "I Kø", - "albums": "Albums" + "queued": "I Kø" }, "jellyseerr": { "available": "Tilgængelig", diff --git a/public/locales/de/common.json b/public/locales/de/common.json index 0d664d99..5d28be49 100644 --- a/public/locales/de/common.json +++ b/public/locales/de/common.json @@ -176,8 +176,7 @@ }, "lidarr": { "wanted": "Gesucht", - "queued": "In Warteschlange", - "albums": "Alben" + "queued": "In Warteschlange" }, "adguard": { "queries": "Anfragen", diff --git a/public/locales/el/common.json b/public/locales/el/common.json index 19f4a0ae..a2eb9ac5 100644 --- a/public/locales/el/common.json +++ b/public/locales/el/common.json @@ -226,8 +226,7 @@ }, "lidarr": { "wanted": "Θέλετε", - "queued": "Στη σειρά", - "albums": "Δίσκοι" + "queued": "Στη σειρά" }, "readarr": { "wanted": "Θέλετε", diff --git a/public/locales/eo/common.json b/public/locales/eo/common.json index 8aa16f14..c489979d 100644 --- a/public/locales/eo/common.json +++ b/public/locales/eo/common.json @@ -145,8 +145,7 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued", - "albums": "Albumoj" + "queued": "Queued" }, "readarr": { "wanted": "Wanted", diff --git a/public/locales/es/common.json b/public/locales/es/common.json index b0efcd6b..129946fc 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -176,8 +176,7 @@ }, "lidarr": { "queued": "En cola", - "wanted": "Buscando", - "albums": "Álbumes" + "wanted": "Buscando" }, "adguard": { "queries": "Consultas", diff --git a/public/locales/fi/common.json b/public/locales/fi/common.json index 07dbb8e5..0dddbbce 100644 --- a/public/locales/fi/common.json +++ b/public/locales/fi/common.json @@ -108,8 +108,7 @@ }, "lidarr": { "wanted": "Haluttu", - "queued": "Jonossa", - "albums": "Albumeja" + "queued": "Jonossa" }, "readarr": { "wanted": "Haluttu", diff --git a/public/locales/fr/common.json b/public/locales/fr/common.json index 269a1adb..051af841 100644 --- a/public/locales/fr/common.json +++ b/public/locales/fr/common.json @@ -176,8 +176,7 @@ }, "lidarr": { "wanted": "Demandé", - "queued": "En queue", - "albums": "Albums" + "queued": "En queue" }, "adguard": { "queries": "Requêtes", diff --git a/public/locales/he/common.json b/public/locales/he/common.json index 9e682c20..ceed0eea 100644 --- a/public/locales/he/common.json +++ b/public/locales/he/common.json @@ -108,8 +108,7 @@ }, "lidarr": { "wanted": "מבוקש", - "queued": "בתור", - "albums": "אלבומים" + "queued": "בתור" }, "readarr": { "wanted": "מבוקש", diff --git a/public/locales/hi/common.json b/public/locales/hi/common.json index 4efc87e0..10488f5d 100644 --- a/public/locales/hi/common.json +++ b/public/locales/hi/common.json @@ -169,8 +169,7 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued", - "albums": "Albums" + "queued": "Queued" }, "overseerr": { "pending": "Pending", diff --git a/public/locales/hr/common.json b/public/locales/hr/common.json index fce370ce..48a8df02 100644 --- a/public/locales/hr/common.json +++ b/public/locales/hr/common.json @@ -139,8 +139,7 @@ }, "lidarr": { "wanted": "Zatraženo", - "queued": "U redu čekanja", - "albums": "Albumi" + "queued": "U redu čekanja" }, "readarr": { "wanted": "Zatraženo", diff --git a/public/locales/hu/common.json b/public/locales/hu/common.json index 98687d9f..2164d696 100644 --- a/public/locales/hu/common.json +++ b/public/locales/hu/common.json @@ -31,7 +31,6 @@ "healthy": "Healthy" }, "lidarr": { - "albums": "Albumok", "wanted": "Keresett", "queued": "Sorban áll" }, diff --git a/public/locales/id/common.json b/public/locales/id/common.json index c36ae790..eb63e939 100644 --- a/public/locales/id/common.json +++ b/public/locales/id/common.json @@ -69,8 +69,7 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued", - "albums": "Albums" + "queued": "Queued" }, "readarr": { "wanted": "Wanted", diff --git a/public/locales/it/common.json b/public/locales/it/common.json index 5eed8b41..b78706f3 100644 --- a/public/locales/it/common.json +++ b/public/locales/it/common.json @@ -176,8 +176,7 @@ }, "lidarr": { "wanted": "Mancanti", - "queued": "In coda", - "albums": "Album" + "queued": "In coda" }, "adguard": { "queries": "Interrogazioni", diff --git a/public/locales/ja/common.json b/public/locales/ja/common.json index 1a96786b..8625cb15 100644 --- a/public/locales/ja/common.json +++ b/public/locales/ja/common.json @@ -207,8 +207,7 @@ }, "lidarr": { "wanted": "募集中", - "queued": "キュー", - "albums": "アルバム" + "queued": "キュー" }, "readarr": { "wanted": "募集中", diff --git a/public/locales/ko/common.json b/public/locales/ko/common.json index 56e8dd77..26e8475b 100644 --- a/public/locales/ko/common.json +++ b/public/locales/ko/common.json @@ -177,8 +177,7 @@ }, "lidarr": { "wanted": "요청", - "queued": "대기 중", - "albums": "앨범" + "queued": "대기 중" }, "readarr": { "wanted": "요청", diff --git a/public/locales/lv/common.json b/public/locales/lv/common.json index 3e4c9173..e38f8671 100644 --- a/public/locales/lv/common.json +++ b/public/locales/lv/common.json @@ -168,8 +168,7 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued", - "albums": "Albumi" + "queued": "Queued" }, "readarr": { "wanted": "Wanted", diff --git a/public/locales/ms/common.json b/public/locales/ms/common.json index 716049ef..d57b2805 100644 --- a/public/locales/ms/common.json +++ b/public/locales/ms/common.json @@ -33,7 +33,6 @@ }, "lidarr": { "queued": "Dibaris Gilir", - "albums": "Album", "wanted": "Mahu" }, "readarr": { diff --git a/public/locales/nb-NO/common.json b/public/locales/nb-NO/common.json index 5761e333..5f6862a5 100644 --- a/public/locales/nb-NO/common.json +++ b/public/locales/nb-NO/common.json @@ -176,8 +176,7 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued", - "albums": "Albums" + "queued": "Queued" }, "adguard": { "queries": "Queries", diff --git a/public/locales/nl/common.json b/public/locales/nl/common.json index fad081f6..410f40dd 100644 --- a/public/locales/nl/common.json +++ b/public/locales/nl/common.json @@ -176,8 +176,7 @@ }, "lidarr": { "wanted": "Gezocht", - "queued": "In de wachtrij", - "albums": "Albums" + "queued": "In de wachtrij" }, "adguard": { "queries": "Queries", diff --git a/public/locales/pl/common.json b/public/locales/pl/common.json index 18a57078..7413c2ba 100644 --- a/public/locales/pl/common.json +++ b/public/locales/pl/common.json @@ -124,8 +124,7 @@ }, "lidarr": { "wanted": "Poszukiwane", - "queued": "W kolejce", - "albums": "Albumy" + "queued": "W kolejce" }, "readarr": { "wanted": "Poszukiwane", diff --git a/public/locales/pt-BR/common.json b/public/locales/pt-BR/common.json index d4392e18..fbd72df2 100644 --- a/public/locales/pt-BR/common.json +++ b/public/locales/pt-BR/common.json @@ -126,8 +126,7 @@ }, "lidarr": { "wanted": "Desejado", - "queued": "Na fila", - "albums": "Álbuns" + "queued": "Na fila" }, "readarr": { "wanted": "Desejado", diff --git a/public/locales/pt/common.json b/public/locales/pt/common.json index ef5f7cd8..483e23f8 100644 --- a/public/locales/pt/common.json +++ b/public/locales/pt/common.json @@ -189,8 +189,7 @@ }, "lidarr": { "queued": "Enfileirado", - "wanted": "Desejado", - "albums": "Álbuns" + "wanted": "Desejado" }, "adguard": { "queries": "Consultas", diff --git a/public/locales/ro/common.json b/public/locales/ro/common.json index 535ecb7d..6bfc767c 100644 --- a/public/locales/ro/common.json +++ b/public/locales/ro/common.json @@ -148,8 +148,7 @@ }, "lidarr": { "wanted": "Dorite", - "queued": "În coadă", - "albums": "Albume" + "queued": "În coadă" }, "readarr": { "wanted": "Dorite", diff --git a/public/locales/ru/common.json b/public/locales/ru/common.json index 5e16f154..5b604ec7 100644 --- a/public/locales/ru/common.json +++ b/public/locales/ru/common.json @@ -176,8 +176,7 @@ }, "lidarr": { "wanted": "Хотел", - "queued": "В очереди", - "albums": "Альбомы" + "queued": "В очереди" }, "adguard": { "queries": "Запросы", diff --git a/public/locales/sk/common.json b/public/locales/sk/common.json index 70c699f8..6a294895 100644 --- a/public/locales/sk/common.json +++ b/public/locales/sk/common.json @@ -287,8 +287,7 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued", - "albums": "Albums" + "queued": "Queued" }, "readarr": { "wanted": "Wanted", diff --git a/public/locales/sl/common.json b/public/locales/sl/common.json index 7632e2aa..49be2e8a 100644 --- a/public/locales/sl/common.json +++ b/public/locales/sl/common.json @@ -249,8 +249,7 @@ }, "lidarr": { "wanted": "Iskano", - "queued": "V vrsti", - "albums": "Albumi" + "queued": "V vrsti" }, "readarr": { "wanted": "Iskano", diff --git a/public/locales/sr/common.json b/public/locales/sr/common.json index 5c6e0b2e..2a2971b2 100644 --- a/public/locales/sr/common.json +++ b/public/locales/sr/common.json @@ -131,8 +131,7 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued", - "albums": "Albums" + "queued": "Queued" }, "readarr": { "wanted": "Wanted", diff --git a/public/locales/sv/common.json b/public/locales/sv/common.json index 0da6efb3..3861157d 100644 --- a/public/locales/sv/common.json +++ b/public/locales/sv/common.json @@ -102,8 +102,7 @@ }, "lidarr": { "wanted": "Eftersöker", - "queued": "I kö", - "albums": "Album" + "queued": "I kö" }, "readarr": { "wanted": "Eftersökt", diff --git a/public/locales/te/common.json b/public/locales/te/common.json index 867baeae..c9b6c7d8 100644 --- a/public/locales/te/common.json +++ b/public/locales/te/common.json @@ -125,8 +125,7 @@ }, "lidarr": { "wanted": "కావలెను", - "queued": "క్యూయూఎడ్", - "albums": "ఆల్బములు" + "queued": "క్యూయూఎడ్" }, "bazarr": { "missingEpisodes": "ఎపిసోడ్‌లు లేవు", diff --git a/public/locales/th/common.json b/public/locales/th/common.json index 660744b7..d0ec6c6b 100644 --- a/public/locales/th/common.json +++ b/public/locales/th/common.json @@ -224,8 +224,7 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued", - "albums": "Albums" + "queued": "Queued" }, "ombi": { "pending": "Pending", diff --git a/public/locales/tr/common.json b/public/locales/tr/common.json index d2f9667d..198860f4 100644 --- a/public/locales/tr/common.json +++ b/public/locales/tr/common.json @@ -131,8 +131,7 @@ }, "lidarr": { "wanted": "Aranan", - "queued": "Kuyrukta", - "albums": "Albümler" + "queued": "Kuyrukta" }, "readarr": { "wanted": "Aranan", diff --git a/public/locales/uk/common.json b/public/locales/uk/common.json index 08c16483..6f6a4c11 100644 --- a/public/locales/uk/common.json +++ b/public/locales/uk/common.json @@ -246,8 +246,7 @@ }, "lidarr": { "wanted": "Розшукується", - "queued": "У черзі", - "albums": "Альбоми" + "queued": "У черзі" }, "traefik": { "middleware": "Проміжне програмне забезпечення", diff --git a/public/locales/vi/common.json b/public/locales/vi/common.json index 2b551546..b495c735 100644 --- a/public/locales/vi/common.json +++ b/public/locales/vi/common.json @@ -176,8 +176,7 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued", - "albums": "Albums" + "queued": "Queued" }, "adguard": { "queries": "Queries", diff --git a/public/locales/yue/common.json b/public/locales/yue/common.json index ce9af7e4..e3a508c3 100644 --- a/public/locales/yue/common.json +++ b/public/locales/yue/common.json @@ -108,8 +108,7 @@ }, "lidarr": { "wanted": "想睇", - "queued": "排緊隊", - "albums": "專輯" + "queued": "排緊隊" }, "readarr": { "wanted": "想睇", diff --git a/public/locales/zh-CN/common.json b/public/locales/zh-CN/common.json index 1b6a7ea2..cb8ba5c4 100644 --- a/public/locales/zh-CN/common.json +++ b/public/locales/zh-CN/common.json @@ -176,8 +176,7 @@ }, "lidarr": { "wanted": "订阅", - "queued": "队列", - "albums": "相册" + "queued": "队列" }, "adguard": { "queries": "查询", diff --git a/public/locales/zh-Hant/common.json b/public/locales/zh-Hant/common.json index 7ea7c835..59886f94 100644 --- a/public/locales/zh-Hant/common.json +++ b/public/locales/zh-Hant/common.json @@ -176,8 +176,7 @@ }, "lidarr": { "wanted": "關注中", - "queued": "已加入佇列", - "albums": "專輯" + "queued": "已加入佇列" }, "adguard": { "queries": "查詢", From a19304e7e7b492aac401a245155ee8d3db4cdbb8 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:17:01 +0000 Subject: [PATCH 10/59] Translated using Weblate (German) Currently translated at 98.2% (457 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/de/ --- public/locales/de/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/de/common.json b/public/locales/de/common.json index 5d28be49..dc06f5d3 100644 --- a/public/locales/de/common.json +++ b/public/locales/de/common.json @@ -176,7 +176,8 @@ }, "lidarr": { "wanted": "Gesucht", - "queued": "In Warteschlange" + "queued": "In Warteschlange", + "artists": "Artists" }, "adguard": { "queries": "Anfragen", From f780deca629ce55f0eeb72ca54fae5a44943b516 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:17:01 +0000 Subject: [PATCH 11/59] Translated using Weblate (Spanish) Currently translated at 99.7% (464 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/es/ --- public/locales/es/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/es/common.json b/public/locales/es/common.json index 129946fc..1782bb92 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -176,7 +176,8 @@ }, "lidarr": { "queued": "En cola", - "wanted": "Buscando" + "wanted": "Buscando", + "artists": "Artists" }, "adguard": { "queries": "Consultas", From 2b0cddb05f094852a67d3ea946f74b03cd301c0e Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:17:02 +0000 Subject: [PATCH 12/59] Translated using Weblate (French) Currently translated at 99.7% (464 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/fr/ --- public/locales/fr/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/fr/common.json b/public/locales/fr/common.json index 051af841..4cc6dce6 100644 --- a/public/locales/fr/common.json +++ b/public/locales/fr/common.json @@ -176,7 +176,8 @@ }, "lidarr": { "wanted": "Demandé", - "queued": "En queue" + "queued": "En queue", + "artists": "Artists" }, "adguard": { "queries": "Requêtes", From 8e89f399790da3bd6598e3151e9808a5f0e32365 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:17:02 +0000 Subject: [PATCH 13/59] Translated using Weblate (Portuguese) Currently translated at 86.8% (404 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/pt/ --- public/locales/pt/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/pt/common.json b/public/locales/pt/common.json index 483e23f8..cc6dfe46 100644 --- a/public/locales/pt/common.json +++ b/public/locales/pt/common.json @@ -189,7 +189,8 @@ }, "lidarr": { "queued": "Enfileirado", - "wanted": "Desejado" + "wanted": "Desejado", + "artists": "Artists" }, "adguard": { "queries": "Consultas", From 637f745ee7d9863d1fe80afd066ea5f76ca09a0d Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:58 +0000 Subject: [PATCH 14/59] Translated using Weblate (Russian) Currently translated at 88.8% (413 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ru/ --- public/locales/ru/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/ru/common.json b/public/locales/ru/common.json index 5b604ec7..f89313db 100644 --- a/public/locales/ru/common.json +++ b/public/locales/ru/common.json @@ -176,7 +176,8 @@ }, "lidarr": { "wanted": "Хотел", - "queued": "В очереди" + "queued": "В очереди", + "artists": "Artists" }, "adguard": { "queries": "Запросы", From a01713c6e6e6df956390b78e9e1cfaa9efdcb998 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:58 +0000 Subject: [PATCH 15/59] Translated using Weblate (Chinese (Simplified)) Currently translated at 95.2% (443 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/zh_Hans/ --- public/locales/zh-CN/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/zh-CN/common.json b/public/locales/zh-CN/common.json index cb8ba5c4..50e36395 100644 --- a/public/locales/zh-CN/common.json +++ b/public/locales/zh-CN/common.json @@ -176,7 +176,8 @@ }, "lidarr": { "wanted": "订阅", - "queued": "队列" + "queued": "队列", + "artists": "Artists" }, "adguard": { "queries": "查询", From 8fa1831b3196f19dd5332a8411a5daa9ad868031 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:56 +0000 Subject: [PATCH 16/59] Translated using Weblate (Italian) Currently translated at 61.5% (286 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/it/ --- public/locales/it/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/it/common.json b/public/locales/it/common.json index b78706f3..2e666af4 100644 --- a/public/locales/it/common.json +++ b/public/locales/it/common.json @@ -176,7 +176,8 @@ }, "lidarr": { "wanted": "Mancanti", - "queued": "In coda" + "queued": "In coda", + "artists": "Artists" }, "adguard": { "queries": "Interrogazioni", From 6584a3194f9fe22e0610c6604aafeada29800b08 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:57 +0000 Subject: [PATCH 17/59] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegian?= =?UTF-8?q?=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 16.9% (79 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/nb_NO/ --- public/locales/nb-NO/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/nb-NO/common.json b/public/locales/nb-NO/common.json index 5f6862a5..cdcda4a8 100644 --- a/public/locales/nb-NO/common.json +++ b/public/locales/nb-NO/common.json @@ -176,7 +176,8 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued" + "queued": "Queued", + "artists": "Artists" }, "adguard": { "queries": "Queries", From 877a091fc05a1b367b81a9d44f0ebc48ad5ab803 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:57 +0000 Subject: [PATCH 18/59] Translated using Weblate (Vietnamese) Currently translated at 9.4% (44 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/vi/ --- public/locales/vi/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/vi/common.json b/public/locales/vi/common.json index b495c735..ef39cd2d 100644 --- a/public/locales/vi/common.json +++ b/public/locales/vi/common.json @@ -176,7 +176,8 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued" + "queued": "Queued", + "artists": "Artists" }, "adguard": { "queries": "Queries", From 7ca6f36125e1445fa693e79f49c6d4688e4ccf00 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:57 +0000 Subject: [PATCH 19/59] Translated using Weblate (Dutch) Currently translated at 51.8% (241 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/nl/ --- public/locales/nl/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/nl/common.json b/public/locales/nl/common.json index 410f40dd..2afed425 100644 --- a/public/locales/nl/common.json +++ b/public/locales/nl/common.json @@ -176,7 +176,8 @@ }, "lidarr": { "wanted": "Gezocht", - "queued": "In de wachtrij" + "queued": "In de wachtrij", + "artists": "Artists" }, "adguard": { "queries": "Queries", From b72d894a30e04d795842ba2b08f1f896bda6b30c Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:59 +0000 Subject: [PATCH 20/59] Translated using Weblate (Chinese (Traditional)) Currently translated at 98.9% (460 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/zh_Hant/ --- public/locales/zh-Hant/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/zh-Hant/common.json b/public/locales/zh-Hant/common.json index 59886f94..75aff10e 100644 --- a/public/locales/zh-Hant/common.json +++ b/public/locales/zh-Hant/common.json @@ -176,7 +176,8 @@ }, "lidarr": { "wanted": "關注中", - "queued": "已加入佇列" + "queued": "已加入佇列", + "artists": "Artists" }, "adguard": { "queries": "查詢", From fd74618b8f84914c8b48227d436b6dcec8b5803f Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:57 +0000 Subject: [PATCH 21/59] Translated using Weblate (Catalan) Currently translated at 55.9% (260 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ca/ --- public/locales/ca/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/ca/common.json b/public/locales/ca/common.json index 399a9649..41391cd5 100644 --- a/public/locales/ca/common.json +++ b/public/locales/ca/common.json @@ -176,7 +176,8 @@ }, "lidarr": { "wanted": "Volgut", - "queued": "En cua" + "queued": "En cua", + "artists": "Artists" }, "adguard": { "queries": "Consultes", From 10cfe20e8aed74272dd9edacf66603029ca195b3 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:54 +0000 Subject: [PATCH 22/59] Translated using Weblate (Polish) Currently translated at 80.4% (374 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/pl/ --- public/locales/pl/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/pl/common.json b/public/locales/pl/common.json index 7413c2ba..d43f9859 100644 --- a/public/locales/pl/common.json +++ b/public/locales/pl/common.json @@ -124,7 +124,8 @@ }, "lidarr": { "wanted": "Poszukiwane", - "queued": "W kolejce" + "queued": "W kolejce", + "artists": "Artists" }, "readarr": { "wanted": "Poszukiwane", From e03c891703fc61f3be6c4580d56462d9c3454af3 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:58 +0000 Subject: [PATCH 23/59] Translated using Weblate (Swedish) Currently translated at 27.9% (130 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/sv/ --- public/locales/sv/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/sv/common.json b/public/locales/sv/common.json index 3861157d..962a57be 100644 --- a/public/locales/sv/common.json +++ b/public/locales/sv/common.json @@ -102,7 +102,8 @@ }, "lidarr": { "wanted": "Eftersöker", - "queued": "I kö" + "queued": "I kö", + "artists": "Artists" }, "readarr": { "wanted": "Eftersökt", From e9722e89466ebac3fef5cb85cd706384570df6c9 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:58 +0000 Subject: [PATCH 24/59] Translated using Weblate (Croatian) Currently translated at 98.4% (458 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/hr/ --- public/locales/hr/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/hr/common.json b/public/locales/hr/common.json index 48a8df02..9a05a55c 100644 --- a/public/locales/hr/common.json +++ b/public/locales/hr/common.json @@ -139,7 +139,8 @@ }, "lidarr": { "wanted": "Zatraženo", - "queued": "U redu čekanja" + "queued": "U redu čekanja", + "artists": "Artists" }, "readarr": { "wanted": "Zatraženo", From 7d51a9b10c047923b8c6a77aa30a694039bfb6bf Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:17:00 +0000 Subject: [PATCH 25/59] Translated using Weblate (Hungarian) Currently translated at 23.0% (107 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/hu/ --- public/locales/hu/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/hu/common.json b/public/locales/hu/common.json index 2164d696..a8218e73 100644 --- a/public/locales/hu/common.json +++ b/public/locales/hu/common.json @@ -32,7 +32,8 @@ }, "lidarr": { "wanted": "Keresett", - "queued": "Sorban áll" + "queued": "Sorban áll", + "artists": "Artists" }, "readarr": { "wanted": "Keresett", From 4c4da54d9940923cc46e6b67ed62c7173abc3049 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:17:00 +0000 Subject: [PATCH 26/59] Translated using Weblate (Hebrew) Currently translated at 21.5% (100 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/he/ --- public/locales/he/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/he/common.json b/public/locales/he/common.json index ceed0eea..dfe2cb84 100644 --- a/public/locales/he/common.json +++ b/public/locales/he/common.json @@ -108,7 +108,8 @@ }, "lidarr": { "wanted": "מבוקש", - "queued": "בתור" + "queued": "בתור", + "artists": "Artists" }, "readarr": { "wanted": "מבוקש", From 1f9ee368c60c8937942dea75211f9a62482fdd5b Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:59 +0000 Subject: [PATCH 27/59] Translated using Weblate (Romanian) Currently translated at 32.2% (150 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ro/ --- public/locales/ro/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/ro/common.json b/public/locales/ro/common.json index 6bfc767c..3ca5004e 100644 --- a/public/locales/ro/common.json +++ b/public/locales/ro/common.json @@ -148,7 +148,8 @@ }, "lidarr": { "wanted": "Dorite", - "queued": "În coadă" + "queued": "În coadă", + "artists": "Artists" }, "readarr": { "wanted": "Dorite", From ac99f651883569278dd17984cccbce4734085153 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:59 +0000 Subject: [PATCH 28/59] Translated using Weblate (Portuguese (Brazil)) Currently translated at 86.8% (404 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/pt_BR/ --- public/locales/pt-BR/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/pt-BR/common.json b/public/locales/pt-BR/common.json index fbd72df2..716ac875 100644 --- a/public/locales/pt-BR/common.json +++ b/public/locales/pt-BR/common.json @@ -126,7 +126,8 @@ }, "lidarr": { "wanted": "Desejado", - "queued": "Na fila" + "queued": "Na fila", + "artists": "Artists" }, "readarr": { "wanted": "Desejado", From aacc2fae9d70604d7434fa88010ec4adc44ebd1b Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:17:03 +0000 Subject: [PATCH 29/59] Translated using Weblate (Yue (Traditional)) Currently translated at 25.1% (117 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/yue_Hant/ --- public/locales/yue/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/yue/common.json b/public/locales/yue/common.json index e3a508c3..73e5998b 100644 --- a/public/locales/yue/common.json +++ b/public/locales/yue/common.json @@ -108,7 +108,8 @@ }, "lidarr": { "wanted": "想睇", - "queued": "排緊隊" + "queued": "排緊隊", + "artists": "Artists" }, "readarr": { "wanted": "想睇", From 193582c8ae2b597db8f8f93ccee308b21f778347 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:17:02 +0000 Subject: [PATCH 30/59] Translated using Weblate (Finnish) Currently translated at 38.0% (177 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/fi/ --- public/locales/fi/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/fi/common.json b/public/locales/fi/common.json index 0dddbbce..f403b6d4 100644 --- a/public/locales/fi/common.json +++ b/public/locales/fi/common.json @@ -108,7 +108,8 @@ }, "lidarr": { "wanted": "Haluttu", - "queued": "Jonossa" + "queued": "Jonossa", + "artists": "Artists" }, "readarr": { "wanted": "Haluttu", From 1097a466698f16a361811766cede3ab48b65d467 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:17:02 +0000 Subject: [PATCH 31/59] Translated using Weblate (Telugu) Currently translated at 46.2% (215 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/te/ --- public/locales/te/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/te/common.json b/public/locales/te/common.json index c9b6c7d8..3d0deb15 100644 --- a/public/locales/te/common.json +++ b/public/locales/te/common.json @@ -125,7 +125,8 @@ }, "lidarr": { "wanted": "కావలెను", - "queued": "క్యూయూఎడ్" + "queued": "క్యూయూఎడ్", + "artists": "Artists" }, "bazarr": { "missingEpisodes": "ఎపిసోడ్‌లు లేవు", From 6794fa1429d807c98a50cc9af5540580b9acd1e2 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:17:03 +0000 Subject: [PATCH 32/59] Translated using Weblate (Bulgarian) Currently translated at 9.8% (46 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/bg/ --- public/locales/bg/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/bg/common.json b/public/locales/bg/common.json index 7b96b3d0..bb6bacbb 100644 --- a/public/locales/bg/common.json +++ b/public/locales/bg/common.json @@ -131,7 +131,8 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued" + "queued": "Queued", + "artists": "Artists" }, "readarr": { "wanted": "Wanted", From 7fc313cc733f9e0fa1325a0ae6c20ffa24dd2b90 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:17:03 +0000 Subject: [PATCH 33/59] Translated using Weblate (Turkish) Currently translated at 84.5% (393 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/tr/ --- public/locales/tr/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/tr/common.json b/public/locales/tr/common.json index 198860f4..09639f67 100644 --- a/public/locales/tr/common.json +++ b/public/locales/tr/common.json @@ -131,7 +131,8 @@ }, "lidarr": { "wanted": "Aranan", - "queued": "Kuyrukta" + "queued": "Kuyrukta", + "artists": "Artists" }, "readarr": { "wanted": "Aranan", From 36717ede616a513cd9adbdf57445284fa3901bfd Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:59 +0000 Subject: [PATCH 34/59] Translated using Weblate (Serbian) Currently translated at 1.9% (9 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/sr/ --- public/locales/sr/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/sr/common.json b/public/locales/sr/common.json index 2a2971b2..8ce72d5c 100644 --- a/public/locales/sr/common.json +++ b/public/locales/sr/common.json @@ -131,7 +131,8 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued" + "queued": "Queued", + "artists": "Artists" }, "readarr": { "wanted": "Wanted", From 1ca12714e08f89cbbd0664feb5fac414eff64718 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:17:00 +0000 Subject: [PATCH 35/59] Translated using Weblate (Arabic) Currently translated at 55.9% (260 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ar/ --- public/locales/ar/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/ar/common.json b/public/locales/ar/common.json index 7562e8ea..7f118dc1 100644 --- a/public/locales/ar/common.json +++ b/public/locales/ar/common.json @@ -193,7 +193,8 @@ }, "lidarr": { "wanted": "مطلوب", - "queued": "في الإنتظار" + "queued": "في الإنتظار", + "artists": "Artists" }, "readarr": { "wanted": "مطلوب", From fabb65995ce221f0faf1515e3e2318a70f13545b Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:55 +0000 Subject: [PATCH 36/59] Translated using Weblate (Czech) Currently translated at 95.4% (444 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/cs/ --- public/locales/cs/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/cs/common.json b/public/locales/cs/common.json index e38cc629..940ec67e 100644 --- a/public/locales/cs/common.json +++ b/public/locales/cs/common.json @@ -147,7 +147,8 @@ }, "lidarr": { "wanted": "Hledané", - "queued": "Ve frontě" + "queued": "Ve frontě", + "artists": "Artists" }, "readarr": { "wanted": "Hledané", From bfb326bd73aee3dd2e4eb22e2902a871a79644c1 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:54 +0000 Subject: [PATCH 37/59] Translated using Weblate (Danish) Currently translated at 42.3% (197 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/da/ --- public/locales/da/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/da/common.json b/public/locales/da/common.json index 7f4ceffd..d1c41aaa 100644 --- a/public/locales/da/common.json +++ b/public/locales/da/common.json @@ -15,7 +15,8 @@ }, "lidarr": { "wanted": "Ønsket", - "queued": "I Kø" + "queued": "I Kø", + "artists": "Artists" }, "jellyseerr": { "available": "Tilgængelig", From 2493e608e88a6cb2b9c733a23235470ea87a8516 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:54 +0000 Subject: [PATCH 38/59] Translated using Weblate (Malay) Currently translated at 53.9% (251 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ms/ --- public/locales/ms/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/ms/common.json b/public/locales/ms/common.json index d57b2805..e249cf43 100644 --- a/public/locales/ms/common.json +++ b/public/locales/ms/common.json @@ -33,7 +33,8 @@ }, "lidarr": { "queued": "Dibaris Gilir", - "wanted": "Mahu" + "wanted": "Mahu", + "artists": "Artists" }, "readarr": { "wanted": "Mahu", From c29e351afcb5b7495022cfd2f79bf4292fd1eb75 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:55 +0000 Subject: [PATCH 39/59] Translated using Weblate (Hindi) Currently translated at 1.9% (9 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/hi/ --- public/locales/hi/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/hi/common.json b/public/locales/hi/common.json index 10488f5d..623775c2 100644 --- a/public/locales/hi/common.json +++ b/public/locales/hi/common.json @@ -169,7 +169,8 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued" + "queued": "Queued", + "artists": "Artists" }, "overseerr": { "pending": "Pending", From 1dea651d8b19acf916fb1aca70fb24fce74acc87 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:55 +0000 Subject: [PATCH 40/59] Translated using Weblate (Esperanto) Currently translated at 31.1% (145 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/eo/ --- public/locales/eo/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/eo/common.json b/public/locales/eo/common.json index c489979d..4ed593be 100644 --- a/public/locales/eo/common.json +++ b/public/locales/eo/common.json @@ -145,7 +145,8 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued" + "queued": "Queued", + "artists": "Artists" }, "readarr": { "wanted": "Wanted", From 678819d0652387c3b0e4b488ec5f1b6658296adb Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:56 +0000 Subject: [PATCH 41/59] Translated using Weblate (Ukrainian) Currently translated at 99.7% (464 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/uk/ --- public/locales/uk/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/uk/common.json b/public/locales/uk/common.json index 6f6a4c11..6b112e8f 100644 --- a/public/locales/uk/common.json +++ b/public/locales/uk/common.json @@ -246,7 +246,8 @@ }, "lidarr": { "wanted": "Розшукується", - "queued": "У черзі" + "queued": "У черзі", + "artists": "Artists" }, "traefik": { "middleware": "Проміжне програмне забезпечення", From 4382bab64b91cbea6b1cc3457e864e30096b305c Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:55 +0000 Subject: [PATCH 42/59] Translated using Weblate (Japanese) Currently translated at 80.2% (373 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ja/ --- public/locales/ja/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/ja/common.json b/public/locales/ja/common.json index 8625cb15..ec9b82a9 100644 --- a/public/locales/ja/common.json +++ b/public/locales/ja/common.json @@ -207,7 +207,8 @@ }, "lidarr": { "wanted": "募集中", - "queued": "キュー" + "queued": "キュー", + "artists": "Artists" }, "readarr": { "wanted": "募集中", From b5c4e36a5303d46c6e8301a8a4827bd4cf27969d Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:56 +0000 Subject: [PATCH 43/59] Translated using Weblate (Latvian) Currently translated at 25.3% (118 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/lv/ --- public/locales/lv/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/lv/common.json b/public/locales/lv/common.json index e38f8671..d8d63388 100644 --- a/public/locales/lv/common.json +++ b/public/locales/lv/common.json @@ -168,7 +168,8 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued" + "queued": "Queued", + "artists": "Artists" }, "readarr": { "wanted": "Wanted", From d06d6f7e44aa3806730e707020996d3416ade2e2 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:53 +0000 Subject: [PATCH 44/59] Translated using Weblate (Thai) Currently translated at 10.1% (47 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/th/ --- public/locales/th/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/th/common.json b/public/locales/th/common.json index d0ec6c6b..3981f0f8 100644 --- a/public/locales/th/common.json +++ b/public/locales/th/common.json @@ -224,7 +224,8 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued" + "queued": "Queued", + "artists": "Artists" }, "ombi": { "pending": "Pending", From 19bcf40d313409f0a71593d9595b0b15dab810ed Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:17:01 +0000 Subject: [PATCH 45/59] Translated using Weblate (Slovak) Currently translated at 1.9% (9 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/sk/ --- public/locales/sk/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/sk/common.json b/public/locales/sk/common.json index 6a294895..ee08f212 100644 --- a/public/locales/sk/common.json +++ b/public/locales/sk/common.json @@ -287,7 +287,8 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued" + "queued": "Queued", + "artists": "Artists" }, "readarr": { "wanted": "Wanted", From ee5fa003ee8913c5432159c7a5432f406a04bd3d Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:17:01 +0000 Subject: [PATCH 46/59] Translated using Weblate (Korean) Currently translated at 37.2% (173 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ko/ --- public/locales/ko/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/ko/common.json b/public/locales/ko/common.json index 26e8475b..6a58072f 100644 --- a/public/locales/ko/common.json +++ b/public/locales/ko/common.json @@ -177,7 +177,8 @@ }, "lidarr": { "wanted": "요청", - "queued": "대기 중" + "queued": "대기 중", + "artists": "Artists" }, "readarr": { "wanted": "요청", From fe647fe67a9a8cbafae346bc046777b10a61824d Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:53 +0000 Subject: [PATCH 47/59] Translated using Weblate (Greek) Currently translated at 30.7% (143 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/el/ --- public/locales/el/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/el/common.json b/public/locales/el/common.json index a2eb9ac5..3492bdd1 100644 --- a/public/locales/el/common.json +++ b/public/locales/el/common.json @@ -226,7 +226,8 @@ }, "lidarr": { "wanted": "Θέλετε", - "queued": "Στη σειρά" + "queued": "Στη σειρά", + "artists": "Artists" }, "readarr": { "wanted": "Θέλετε", From 0be0fa71d372957f3dbd5cd7d8fd6d1f60857c3b Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:56 +0000 Subject: [PATCH 48/59] Translated using Weblate (Slovenian) Currently translated at 96.5% (449 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/sl/ --- public/locales/sl/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/sl/common.json b/public/locales/sl/common.json index 49be2e8a..fe5fe631 100644 --- a/public/locales/sl/common.json +++ b/public/locales/sl/common.json @@ -249,7 +249,8 @@ }, "lidarr": { "wanted": "Iskano", - "queued": "V vrsti" + "queued": "V vrsti", + "artists": "Artists" }, "readarr": { "wanted": "Iskano", From b882065d5ee0e0533dd0aa216cb6c2ecf0bf9f0a Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 8 Jun 2023 14:16:54 +0000 Subject: [PATCH 49/59] Translated using Weblate (Indonesian) Currently translated at 3.2% (15 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/id/ --- public/locales/id/common.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/locales/id/common.json b/public/locales/id/common.json index eb63e939..d54218c4 100644 --- a/public/locales/id/common.json +++ b/public/locales/id/common.json @@ -69,7 +69,8 @@ }, "lidarr": { "wanted": "Wanted", - "queued": "Queued" + "queued": "Queued", + "artists": "Artists" }, "readarr": { "wanted": "Wanted", From 2da66b504b1018be353be10cd6a67d3dc1b28067 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 8 Jun 2023 07:17:58 -0700 Subject: [PATCH 50/59] lint lidarr widget.js --- src/widgets/lidarr/widget.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/widgets/lidarr/widget.js b/src/widgets/lidarr/widget.js index 55975e63..2f036726 100644 --- a/src/widgets/lidarr/widget.js +++ b/src/widgets/lidarr/widget.js @@ -1,5 +1,4 @@ import genericProxyHandler from "utils/proxy/handlers/generic"; -import { jsonArrayFilter } from "utils/proxy/api-helpers"; const widget = { api: "{url}/api/v1/{endpoint}?apikey={key}", From 0101e8ccb950cbae2fb9e1a3310fdf5e387894ac Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 8 Jun 2023 09:40:20 -0700 Subject: [PATCH 51/59] make portainer error detection more specific --- src/widgets/portainer/component.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/portainer/component.jsx b/src/widgets/portainer/component.jsx index 7da289c4..53a6fd26 100644 --- a/src/widgets/portainer/component.jsx +++ b/src/widgets/portainer/component.jsx @@ -23,8 +23,8 @@ export default function Component({ service }) { ); } - if (containersData.error || !Array.isArray(containersData)) { - // containersData can be itself an error object + if (containersData.error || containersData.message) { + // containersData can be itself an error object e.g. if environment fails return ; } From 68b6192d8c38f2961f11bd9dea9e8f1b99e323c3 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 9 Jun 2023 09:01:19 -0700 Subject: [PATCH 52/59] Fix full height layout on tall screens --- src/pages/index.jsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 06e55010..e170d4e1 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -252,7 +252,7 @@ function Home({ initialSettings }) { /> -
    +
    )} -
    - {!initialSettings?.color && } - - {!initialSettings?.theme && } -
    +
    +
    + {!initialSettings?.color && } + + {!initialSettings?.theme && } +
    -
    - {!initialSettings?.hideVersion && } +
    + {!initialSettings?.hideVersion && } +
    From 6b2930ab8d52c70cf6a1dd8bb85fcd5d86b17233 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sat, 10 Jun 2023 23:30:44 -0700 Subject: [PATCH 53/59] Revert "Added optional boxed styling for information widgets and refactored information widgets" --- src/components/widgets/datetime/datetime.jsx | 21 +- src/components/widgets/glances/glances.jsx | 262 ++++++++++++------ src/components/widgets/greeting/greeting.jsx | 11 +- .../widgets/kubernetes/kubernetes.jsx | 38 ++- src/components/widgets/kubernetes/node.jsx | 11 +- .../widgets/kubernetes/usage-bar.jsx | 12 + src/components/widgets/logo/logo.jsx | 11 +- src/components/widgets/longhorn/longhorn.jsx | 32 ++- src/components/widgets/longhorn/node.jsx | 38 ++- .../widgets/openmeteo/openmeteo.jsx | 103 ++++--- .../widgets/openweathermap/weather.jsx | 99 +++++-- src/components/widgets/resources/cpu.jsx | 82 ++++-- src/components/widgets/resources/cputemp.jsx | 90 ++++-- src/components/widgets/resources/disk.jsx | 67 +++-- src/components/widgets/resources/memory.jsx | 75 +++-- .../widgets/resources/resources.jsx | 11 +- src/components/widgets/resources/uptime.jsx | 44 ++- src/components/widgets/search/search.jsx | 162 ++++++----- .../widgets/unifi_console/unifi_console.jsx | 45 +-- src/components/widgets/weather/weather.jsx | 104 ++++--- src/components/widgets/widget.jsx | 4 +- src/components/widgets/widget/container.jsx | 42 --- .../widgets/widget/container_button.jsx | 10 - .../widgets/widget/container_form.jsx | 10 - .../widgets/widget/container_link.jsx | 10 - src/components/widgets/widget/error.jsx | 15 - .../widgets/widget/primary_text.jsx | 5 - src/components/widgets/widget/raw.jsx | 7 - src/components/widgets/widget/resource.jsx | 22 -- src/components/widgets/widget/resources.jsx | 15 - .../widgets/widget/secondary_text.jsx | 5 - src/components/widgets/widget/widget_icon.jsx | 18 -- .../widgets/widget/widget_label.jsx | 3 - src/pages/api/widgets/longhorn.js | 2 +- src/pages/index.jsx | 10 +- 35 files changed, 854 insertions(+), 642 deletions(-) create mode 100644 src/components/widgets/kubernetes/usage-bar.jsx delete mode 100644 src/components/widgets/widget/container.jsx delete mode 100644 src/components/widgets/widget/container_button.jsx delete mode 100644 src/components/widgets/widget/container_form.jsx delete mode 100644 src/components/widgets/widget/container_link.jsx delete mode 100644 src/components/widgets/widget/error.jsx delete mode 100644 src/components/widgets/widget/primary_text.jsx delete mode 100644 src/components/widgets/widget/raw.jsx delete mode 100644 src/components/widgets/widget/resource.jsx delete mode 100644 src/components/widgets/widget/resources.jsx delete mode 100644 src/components/widgets/widget/secondary_text.jsx delete mode 100644 src/components/widgets/widget/widget_icon.jsx delete mode 100644 src/components/widgets/widget/widget_label.jsx diff --git a/src/components/widgets/datetime/datetime.jsx b/src/components/widgets/datetime/datetime.jsx index 454d004d..86983473 100644 --- a/src/components/widgets/datetime/datetime.jsx +++ b/src/components/widgets/datetime/datetime.jsx @@ -1,9 +1,6 @@ import { useState, useEffect } from "react"; import { useTranslation } from "next-i18next"; -import Container from "../widget/container"; -import Raw from "../widget/raw"; - const textSizes = { "4xl": "text-4xl", "3xl": "text-3xl", @@ -20,7 +17,7 @@ export default function DateTime({ options }) { const { i18n } = useTranslation(); const [date, setDate] = useState(""); const dateLocale = locale ?? i18n.language; - + useEffect(() => { const dateFormat = new Intl.DateTimeFormat(dateLocale, { ...format }); const interval = setInterval(() => { @@ -30,14 +27,12 @@ export default function DateTime({ options }) { }, [date, setDate, dateLocale, format]); return ( - - -
    - - {date} - -
    -
    -
    +
    +
    + + {date} + +
    +
    ); } diff --git a/src/components/widgets/glances/glances.jsx b/src/components/widgets/glances/glances.jsx index b45dfefe..85dd44c0 100644 --- a/src/components/widgets/glances/glances.jsx +++ b/src/components/widgets/glances/glances.jsx @@ -1,13 +1,11 @@ import useSWR from "swr"; import { useContext } from "react"; +import { BiError } from "react-icons/bi"; import { FaMemory, FaRegClock, FaThermometerHalf } from "react-icons/fa"; import { FiCpu, FiHardDrive } from "react-icons/fi"; import { useTranslation } from "next-i18next"; -import Error from "../widget/error"; -import Resource from "../widget/resource"; -import Resources from "../widget/resources"; -import WidgetLabel from "../widget/widget_label"; +import UsageBar from "../resources/usage-bar"; import { SettingsContext } from "utils/contexts/settings"; @@ -28,17 +26,52 @@ export default function Widget({ options }) { ); if (error || data?.error) { - return + return ( +
    +
    +
    + +
    + {t("widget.api_error")} +
    +
    +
    +
    + ); } if (!data) { - return - - - { options.cputemp && } - { options.uptime && } - { options.label && } - ; + return ( +
    +
    +
    + +
    +
    +
    + {t("glances.wait")} +
    +
    + +
    +
    +
    + +
    +
    +
    + {t("glances.wait")} +
    +
    + +
    +
    +
    + {options.label && ( +
    {options.label}
    + )} +
    + ); } const unit = options.units === "imperial" ? "fahrenheit" : "celsius"; @@ -68,84 +101,131 @@ export default function Widget({ options }) { } return ( - - - - {disks.map((disk) => ( - - ))} - {options.cputemp && mainTemp > 0 && - - } - {options.uptime && data.uptime && - - } - {options.label && } - + +
    +
    + +
    +
    +
    + {t("common.number", { + value: data.cpu.total, + style: "unit", + unit: "percent", + maximumFractionDigits: 0, + })} +
    +
    {t("glances.cpu")}
    +
    + {options.expanded && ( + +
    + {t("common.number", { + value: data.load.min15, + style: "unit", + unit: "percent", + maximumFractionDigits: 0, + })} +
    +
    {t("glances.load")}
    +
    + )} + +
    +
    +
    + +
    +
    +
    + {t("common.bytes", { + value: data.mem.free, + maximumFractionDigits: 1, + binary: true, + })} +
    +
    {t("glances.free")}
    +
    + {options.expanded && ( + +
    + {t("common.bytes", { + value: data.mem.total, + maximumFractionDigits: 1, + binary: true, + })} +
    +
    {t("glances.total")}
    +
    + )} + +
    +
    + {disks.map((disk) => ( +
    + +
    + +
    {t("common.bytes", { value: disk.free })}
    +
    {t("glances.free")}
    +
    + {options.expanded && ( + +
    {t("common.bytes", { value: disk.size })}
    +
    {t("glances.total")}
    +
    + )} + +
    +
    ))} + {options.cputemp && mainTemp > 0 && + (
    + +
    + +
    + {t("common.number", { + value: mainTemp, + maximumFractionDigits: 1, + style: "unit", + unit + })} +
    +
    {t("glances.temp")}
    +
    + {options.expanded && ( + +
    + {t("common.number", { + value: maxTemp, + maximumFractionDigits: 1, + style: "unit", + unit + })} +
    +
    {t("glances.warn")}
    +
    + )} + +
    +
    )} + {options.uptime && data.uptime && + (
    + +
    + +
    + {data.uptime.replace(" days,", t("glances.days")).replace(/:\d\d:\d\d$/g, t("glances.hours"))} +
    +
    {t("glances.uptime")}
    +
    + +
    +
    )} +
    + {options.label && ( +
    {options.label}
    + )} +
    ); } diff --git a/src/components/widgets/greeting/greeting.jsx b/src/components/widgets/greeting/greeting.jsx index 11de571c..da0f063d 100644 --- a/src/components/widgets/greeting/greeting.jsx +++ b/src/components/widgets/greeting/greeting.jsx @@ -1,6 +1,3 @@ -import Container from "../widget/container"; -import Raw from "../widget/raw"; - const textSizes = { "4xl": "text-4xl", "3xl": "text-3xl", @@ -14,12 +11,12 @@ const textSizes = { export default function Greeting({ options }) { if (options.text) { - return - + return ( +
    {options.text} - - ; +
    + ); } } diff --git a/src/components/widgets/kubernetes/kubernetes.jsx b/src/components/widgets/kubernetes/kubernetes.jsx index 2d1f55e4..78c4caaf 100644 --- a/src/components/widgets/kubernetes/kubernetes.jsx +++ b/src/components/widgets/kubernetes/kubernetes.jsx @@ -1,15 +1,12 @@ import useSWR from "swr"; +import { BiError } from "react-icons/bi"; import { useTranslation } from "next-i18next"; -import Error from "../widget/error"; -import Container from "../widget/container"; -import Raw from "../widget/raw"; - import Node from "./node"; export default function Widget({ options }) { const { cluster, nodes } = options; - const { i18n } = useTranslation(); + const { t, i18n } = useTranslation(); const defaultData = { cpu: { @@ -21,7 +18,7 @@ export default function Widget({ options }) { used: 0, total: 0, free: 0, - percent: 0 + precent: 0 } }; @@ -32,12 +29,23 @@ export default function Widget({ options }) { ); if (error || data?.error) { - return + return ( +
    +
    +
    + +
    + {t("widget.api_error")} +
    +
    +
    +
    + ); } if (!data) { - return - + return ( +
    {cluster.show && @@ -46,12 +54,12 @@ export default function Widget({ options }) { }
    - - ; +
    + ); } - return - + return ( +
    {cluster.show && @@ -61,6 +69,6 @@ export default function Widget({ options }) { ) }
    - - ; +
    + ); } diff --git a/src/components/widgets/kubernetes/node.jsx b/src/components/widgets/kubernetes/node.jsx index cc864be6..7a7c322d 100644 --- a/src/components/widgets/kubernetes/node.jsx +++ b/src/components/widgets/kubernetes/node.jsx @@ -3,7 +3,8 @@ import { FiAlertTriangle, FiCpu, FiServer } from "react-icons/fi"; import { SiKubernetes } from "react-icons/si"; import { useTranslation } from "next-i18next"; -import UsageBar from "../resources/usage-bar"; +import UsageBar from "./usage-bar"; + export default function Node({ type, options, data }) { const { t } = useTranslation(); @@ -28,7 +29,7 @@ export default function Node({ type, options, data }) {
    {t("common.number", { - value: data?.cpu?.percent ?? 0, + value: data.cpu.percent, style: "unit", unit: "percent", maximumFractionDigits: 0 @@ -36,18 +37,18 @@ export default function Node({ type, options, data }) {
    - +
    {t("common.bytes", { - value: data?.memory?.free ?? 0, + value: data.memory.free, maximumFractionDigits: 0, binary: true })}
    - + {options.showLabel && (
    {type === "cluster" ? options.label : data.name}
    )} diff --git a/src/components/widgets/kubernetes/usage-bar.jsx b/src/components/widgets/kubernetes/usage-bar.jsx new file mode 100644 index 00000000..c817db4c --- /dev/null +++ b/src/components/widgets/kubernetes/usage-bar.jsx @@ -0,0 +1,12 @@ +export default function UsageBar({ percent }) { + return ( +
    +
    +
    + ); +} diff --git a/src/components/widgets/logo/logo.jsx b/src/components/widgets/logo/logo.jsx index 3a4a2565..96e8569f 100644 --- a/src/components/widgets/logo/logo.jsx +++ b/src/components/widgets/logo/logo.jsx @@ -1,13 +1,9 @@ -import Container from "../widget/container"; -import Raw from "../widget/raw"; - import ResolvedIcon from "components/resolvedicon" export default function Logo({ options }) { return ( - - - {options.icon ? +
    + {options.icon ? : // fallback to homepage logo } - - +
    ) } diff --git a/src/components/widgets/longhorn/longhorn.jsx b/src/components/widgets/longhorn/longhorn.jsx index c0169ceb..9fcb21b4 100644 --- a/src/components/widgets/longhorn/longhorn.jsx +++ b/src/components/widgets/longhorn/longhorn.jsx @@ -1,31 +1,37 @@ import useSWR from "swr"; - -import Error from "../widget/error"; -import Container from "../widget/container"; -import Raw from "../widget/raw"; +import { BiError } from "react-icons/bi"; +import { useTranslation } from "next-i18next"; import Node from "./node"; export default function Longhorn({ options }) { const { expanded, total, labels, include, nodes } = options; + const { t } = useTranslation(); const { data, error } = useSWR(`/api/widgets/longhorn`, { refreshInterval: 1500 }); if (error || data?.error) { - return + return ( +
    + +
    + {t("widget.api_error")} +
    +
    + ); } if (!data) { - return - + return ( +
    - - ; +
    + ); } - return - + return ( +
    {data.nodes .filter((node) => { @@ -46,6 +52,6 @@ export default function Longhorn({ options }) {
    )}
    -
    -
    ; +
    + ); } diff --git a/src/components/widgets/longhorn/node.jsx b/src/components/widgets/longhorn/node.jsx index 5235698a..e0ee69af 100644 --- a/src/components/widgets/longhorn/node.jsx +++ b/src/components/widgets/longhorn/node.jsx @@ -1,20 +1,32 @@ +import { FiHardDrive } from "react-icons/fi"; import { useTranslation } from "next-i18next"; -import { FaThermometerHalf } from "react-icons/fa"; -import Resource from "../widget/resource"; -import WidgetLabel from "../widget/widget_label"; +import UsageBar from "../resources/usage-bar"; export default function Node({ data, expanded, labels }) { const { t } = useTranslation(); - return { labels && } - + return ( + <> +
    + +
    + +
    {t("common.bytes", { value: data.node.available })}
    +
    {t("resources.free")}
    +
    + {expanded && ( + +
    {t("common.bytes", { value: data.node.maximum })}
    +
    {t("resources.total")}
    +
    + )} + +
    +
    + {labels && ( +
    {data.node.id}
    + )} + + ); } diff --git a/src/components/widgets/openmeteo/openmeteo.jsx b/src/components/widgets/openmeteo/openmeteo.jsx index 040a3b6b..0d29aef5 100644 --- a/src/components/widgets/openmeteo/openmeteo.jsx +++ b/src/components/widgets/openmeteo/openmeteo.jsx @@ -1,16 +1,10 @@ import useSWR from "swr"; import { useState } from "react"; +import { BiError } from "react-icons/bi"; import { WiCloudDown } from "react-icons/wi"; import { MdLocationDisabled, MdLocationSearching } from "react-icons/md"; import { useTranslation } from "next-i18next"; -import Error from "../widget/error"; -import Container from "../widget/container"; -import ContainerButton from "../widget/container_button"; -import WidgetIcon from "../widget/widget_icon"; -import PrimaryText from "../widget/primary_text"; -import SecondaryText from "../widget/secondary_text"; - import Icon from "./icon"; function Widget({ options }) { @@ -21,35 +15,60 @@ function Widget({ options }) { ); if (error || data?.error) { - return + return ( +
    +
    +
    + +
    + {t("widget.api_error")} + - +
    +
    +
    +
    + ); } if (!data) { - return - {t("weather.updating")} - {t("weather.wait")} - - ; + return ( +
    +
    +
    + +
    +
    + {t("weather.updating")} + {t("weather.wait")} +
    +
    +
    + ); } const unit = options.units === "metric" ? "celsius" : "fahrenheit"; - const weatherInfo = { - condition: data.current_weather.weathercode, - timeOfDay: data.current_weather.time > data.daily.sunrise[0] && data.current_weather.time < data.daily.sunset[0] ? "day" : "night" - }; + const timeOfDay = data.current_weather.time > data.daily.sunrise[0] && data.current_weather.time < data.daily.sunset[0] ? "day" : "night"; - return - - {options.label && `${options.label}, `} - {t("common.number", { - value: data.current_weather.temperature, - style: "unit", - unit, - })} - - {t(`wmo.${data.current_weather.weathercode}-${weatherInfo.timeOfDay}`)} - - ; + return ( +
    +
    +
    + +
    +
    + + {options.label && `${options.label}, `} + {t("common.number", { + value: data.current_weather.temperature, + style: "unit", + unit, + })} + + {t(`wmo.${data.current_weather.weathercode}-${timeOfDay}`)} +
    +
    +
    + ); } export default function OpenMeteo({ options }) { @@ -84,11 +103,27 @@ export default function OpenMeteo({ options }) { // if (!requesting && !location) requestLocation(); if (!location) { - return - {t("weather.current")} - {t("weather.allow")} - - ; + return ( + + ); } return ; diff --git a/src/components/widgets/openweathermap/weather.jsx b/src/components/widgets/openweathermap/weather.jsx index 30531513..49f428a0 100644 --- a/src/components/widgets/openweathermap/weather.jsx +++ b/src/components/widgets/openweathermap/weather.jsx @@ -1,19 +1,12 @@ import useSWR from "swr"; import { useState } from "react"; +import { BiError } from "react-icons/bi"; import { WiCloudDown } from "react-icons/wi"; import { MdLocationDisabled, MdLocationSearching } from "react-icons/md"; import { useTranslation } from "next-i18next"; -import Error from "../widget/error"; -import Container from "../widget/container"; -import ContainerButton from "../widget/container_button"; -import PrimaryText from "../widget/primary_text"; -import SecondaryText from "../widget/secondary_text"; -import WidgetIcon from "../widget/widget_icon"; - import Icon from "./icon"; - function Widget({ options }) { const { t, i18n } = useTranslation(); @@ -22,30 +15,58 @@ function Widget({ options }) { ); if (error || data?.cod === 401 || data?.error) { - return + return ( +
    +
    +
    + +
    + {t("widget.api_error")} + - +
    +
    +
    +
    + ); } if (!data) { - return - {t("weather.updating")} - {t("weather.wait")} - - ; + return ( +
    +
    +
    + +
    +
    + {t("weather.updating")} + {t("weather.wait")} +
    +
    +
    + ); } const unit = options.units === "metric" ? "celsius" : "fahrenheit"; - const weatherInfo = { - condition: data.weather[0].id, - timeOfDay: data.dt > data.sys.sunrise && data.dt < data.sys.sunset ? "day" : "night" - }; - - return - {options.label && `${options.label}, `} - {t("common.number", { value: data.main.temp, style: "unit", unit })} - {data.weather[0].description} - - ; + return ( +
    +
    +
    + data.sys.sunrise && data.dt < data.sys.sunset ? "day" : "night"} + /> +
    +
    + + {options.label && `${options.label}, `} + {t("common.number", { value: data.main.temp, style: "unit", unit })} + + {data.weather[0].description} +
    +
    +
    + ); } export default function OpenWeatherMap({ options }) { @@ -77,12 +98,30 @@ export default function OpenWeatherMap({ options }) { } }; + // if (!requesting && !location) requestLocation(); + if (!location) { - return - {t("weather.current")} - {t("weather.allow")} - - ; + return ( + + ); } return ; diff --git a/src/components/widgets/resources/cpu.jsx b/src/components/widgets/resources/cpu.jsx index 12972fe8..7069e3c4 100644 --- a/src/components/widgets/resources/cpu.jsx +++ b/src/components/widgets/resources/cpu.jsx @@ -1,9 +1,9 @@ import useSWR from "swr"; import { FiCpu } from "react-icons/fi"; +import { BiError } from "react-icons/bi"; import { useTranslation } from "next-i18next"; -import Resource from "../widget/resource"; -import Error from "../widget/error"; +import UsageBar from "./usage-bar"; export default function Cpu({ expanded }) { const { t } = useTranslation(); @@ -13,29 +13,67 @@ export default function Cpu({ expanded }) { }); if (error || data?.error) { - return + return ( +
    + +
    + {t("widget.api_error")} +
    +
    + ); } if (!data) { - return + return ( +
    + +
    +
    +
    -
    +
    {t("resources.cpu")}
    +
    + {expanded && ( +
    +
    -
    +
    {t("resources.load")}
    +
    + )} + +
    +
    + ); } - return + const percent = data.cpu.usage; + + return ( +
    + +
    +
    +
    + {t("common.number", { + value: data.cpu.usage, + style: "unit", + unit: "percent", + maximumFractionDigits: 0, + })} +
    +
    {t("resources.cpu")}
    +
    + {expanded && ( +
    +
    + {t("common.number", { + value: data.cpu.load, + maximumFractionDigits: 2, + })} +
    +
    {t("resources.load")}
    +
    + )} + +
    +
    + ); } diff --git a/src/components/widgets/resources/cputemp.jsx b/src/components/widgets/resources/cputemp.jsx index ba6d9b73..571e6c8a 100644 --- a/src/components/widgets/resources/cputemp.jsx +++ b/src/components/widgets/resources/cputemp.jsx @@ -1,9 +1,9 @@ import useSWR from "swr"; import { FaThermometerHalf } from "react-icons/fa"; +import { BiError } from "react-icons/bi"; import { useTranslation } from "next-i18next"; -import Resource from "../widget/resource"; -import Error from "../widget/error"; +import UsageBar from "./usage-bar"; function convertToFahrenheit(t) { return t * 9/5 + 32 @@ -17,18 +17,34 @@ export default function CpuTemp({ expanded, units }) { }); if (error || data?.error) { - return + return ( +
    + +
    + {t("widget.api_error")} +
    +
    + ); } if (!data || !data.cputemp) { - return ; + return ( +
    + +
    + +
    -
    +
    {t("resources.temp")}
    +
    + {expanded && ( + +
    -
    +
    {t("resources.max")}
    +
    + )} +
    +
    + ); } let mainTemp = data.cputemp.main; @@ -38,24 +54,38 @@ export default function CpuTemp({ expanded, units }) { const unit = units === "imperial" ? "fahrenheit" : "celsius"; mainTemp = (unit === "celsius") ? mainTemp : convertToFahrenheit(mainTemp); const maxTemp = (unit === "celsius") ? data.cputemp.max : convertToFahrenheit(data.cputemp.max); + const percent = Math.round((mainTemp / maxTemp) * 100); - return ; + return ( +
    + +
    + +
    + {t("common.number", { + value: mainTemp, + maximumFractionDigits: 1, + style: "unit", + unit + })} +
    +
    {t("resources.temp")}
    +
    + {expanded && ( + +
    + {t("common.number", { + value: maxTemp, + maximumFractionDigits: 1, + style: "unit", + unit + })} +
    +
    {t("resources.max")}
    +
    + )} + +
    +
    + ); } diff --git a/src/components/widgets/resources/disk.jsx b/src/components/widgets/resources/disk.jsx index ab56624d..ca09c095 100644 --- a/src/components/widgets/resources/disk.jsx +++ b/src/components/widgets/resources/disk.jsx @@ -1,9 +1,9 @@ import useSWR from "swr"; import { FiHardDrive } from "react-icons/fi"; +import { BiError } from "react-icons/bi"; import { useTranslation } from "next-i18next"; -import Resource from "../widget/resource"; -import Error from "../widget/error"; +import UsageBar from "./usage-bar"; export default function Disk({ options, expanded }) { const { t } = useTranslation(); @@ -13,31 +13,56 @@ export default function Disk({ options, expanded }) { }); if (error || data?.error) { - return + return ( +
    + +
    + {t("widget.api_error")} +
    +
    + ); } if (!data) { - return ; + return ( +
    + +
    + +
    -
    +
    {t("resources.free")}
    +
    + {expanded && ( + +
    -
    +
    {t("resources.total")}
    +
    + )} + +
    +
    + ); } // data.drive.used not accurate? const percent = Math.round(((data.drive.size - data.drive.available) / data.drive.size) * 100); - return ; + return ( +
    + +
    + +
    {t("common.bytes", { value: data.drive.available })}
    +
    {t("resources.free")}
    +
    + {expanded && ( + +
    {t("common.bytes", { value: data.drive.size })}
    +
    {t("resources.total")}
    +
    + )} + +
    +
    + ); } diff --git a/src/components/widgets/resources/memory.jsx b/src/components/widgets/resources/memory.jsx index 19ae8687..30b7c8eb 100644 --- a/src/components/widgets/resources/memory.jsx +++ b/src/components/widgets/resources/memory.jsx @@ -1,9 +1,9 @@ import useSWR from "swr"; import { FaMemory } from "react-icons/fa"; +import { BiError } from "react-icons/bi"; import { useTranslation } from "next-i18next"; -import Resource from "../widget/resource"; -import Error from "../widget/error"; +import UsageBar from "./usage-bar"; export default function Memory({ expanded }) { const { t } = useTranslation(); @@ -13,30 +13,63 @@ export default function Memory({ expanded }) { }); if (error || data?.error) { - return + return ( +
    + +
    + {t("widget.api_error")} +
    +
    + ); } if (!data) { - return ; + return ( +
    + +
    + +
    -
    +
    {t("resources.free")}
    +
    + {expanded && ( + +
    -
    +
    {t("resources.total")}
    +
    + )} + +
    +
    + ); } const percent = Math.round((data.memory.active / data.memory.total) * 100); - return ; + return ( +
    + +
    + +
    + {t("common.bytes", { value: data.memory.available, maximumFractionDigits: 1, binary: true })} +
    +
    {t("resources.free")}
    +
    + {expanded && ( + +
    + {t("common.bytes", { + value: data.memory.total, + maximumFractionDigits: 1, + binary: true, + })} +
    +
    {t("resources.total")}
    +
    + )} + +
    +
    + ); } diff --git a/src/components/widgets/resources/resources.jsx b/src/components/widgets/resources/resources.jsx index 0cc2c301..4ff0c81c 100644 --- a/src/components/widgets/resources/resources.jsx +++ b/src/components/widgets/resources/resources.jsx @@ -1,6 +1,3 @@ -import Container from "../widget/container"; -import Raw from "../widget/raw"; - import Disk from "./disk"; import Cpu from "./cpu"; import Memory from "./memory"; @@ -9,8 +6,8 @@ import Uptime from "./uptime"; export default function Resources({ options }) { const { expanded, units } = options; - return - + return ( +
    {options.cpu && } {options.memory && } @@ -23,6 +20,6 @@ export default function Resources({ options }) { {options.label && (
    {options.label}
    )} - - ; +
    + ); } diff --git a/src/components/widgets/resources/uptime.jsx b/src/components/widgets/resources/uptime.jsx index 3984975f..3bf785b1 100644 --- a/src/components/widgets/resources/uptime.jsx +++ b/src/components/widgets/resources/uptime.jsx @@ -1,9 +1,9 @@ import useSWR from "swr"; import { FaRegClock } from "react-icons/fa"; +import { BiError } from "react-icons/bi"; import { useTranslation } from "next-i18next"; -import Resource from "../widget/resource"; -import Error from "../widget/error"; +import UsageBar from "./usage-bar"; export default function Uptime() { const { t } = useTranslation(); @@ -13,24 +13,54 @@ export default function Uptime() { }); if (error || data?.error) { - return + return ( +
    + +
    + {t("widget.api_error")} +
    +
    + ); } if (!data) { - return ; + return ( +
    + +
    + +
    -
    +
    {t("resources.temp")}
    +
    +
    +
    + ); } const mo = Math.floor(data.uptime / (3600 * 24 * 31)); const d = Math.floor(data.uptime % (3600 * 24 * 31) / (3600 * 24)); const h = Math.floor(data.uptime % (3600 * 24) / 3600); const m = Math.floor(data.uptime % 3600 / 60); - + let uptime; if (mo > 0) uptime = `${mo}${t("resources.months")} ${d}${t("resources.days")}`; else if (d > 0) uptime = `${d}${t("resources.days")} ${h}${t("resources.hours")}`; else uptime = `${h}${t("resources.hours")} ${m}${t("resources.minutes")}`; - const percent = Math.round((new Date().getSeconds() / 60) * 100).toString(); + const percent = Math.round((new Date().getSeconds() / 60) * 100); - return ; + return ( +
    + +
    + +
    + {uptime} +
    +
    {t("resources.uptime")}
    +
    + +
    +
    + ); } diff --git a/src/components/widgets/search/search.jsx b/src/components/widgets/search/search.jsx index 1bac4a61..4689567f 100644 --- a/src/components/widgets/search/search.jsx +++ b/src/components/widgets/search/search.jsx @@ -1,13 +1,10 @@ -import { useState, useEffect, useCallback, Fragment } from "react"; +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 { Listbox, Transition } from "@headlessui/react"; import classNames from "classnames"; -import ContainerForm from "../widget/container_form"; -import Raw from "../widget/raw"; - export const searchProviders = { google: { name: "Google", @@ -79,9 +76,14 @@ export default function Search({ options }) { setSelectedProvider(storedProvider); } }, [availableProviderIds]); + + if (!availableProviderIds) { + return null; + } - const submitCallback = useCallback(event => { + function handleSubmit(event) { const q = encodeURIComponent(query); + const { url } = selectedProvider; if (url) { window.open(`${url}${q}`, options.target || "_blank"); @@ -92,10 +94,6 @@ export default function Search({ options }) { event.preventDefault(); event.target.reset(); setQuery(""); - }, [options.target, options.url, query, selectedProvider]); - - if (!availableProviderIds) { - return null; } const onChangeProvider = (provider) => { @@ -103,79 +101,77 @@ export default function Search({ options }) { localStorage.setItem(localStorageKey, provider.name); } - return - -
    -
    - setQuery(s.currentTarget.value)} - required - autoCapitalize="off" - autoCorrect="off" - autoComplete="off" - // eslint-disable-next-line jsx-a11y/no-autofocus - autoFocus={options.focus} - /> - -
    - - - {t("search.search")} - -
    - +
    + setQuery(s.currentTarget.value)} + required + autoCapitalize="off" + autoCorrect="off" + autoComplete="off" + // eslint-disable-next-line jsx-a11y/no-autofocus + autoFocus={options.focus} + /> + +
    + - -
    - {availableProviderIds.map((providerId) => { - const p = searchProviders[providerId]; - return ( - - {({ active }) => ( -
  • - -
  • - )} -
    - ); - })} -
    -
    - - -
    - - ; + + {t("search.search")} + +
    + + +
    + {availableProviderIds.map((providerId) => { + const p = searchProviders[providerId]; + return ( + + {({ active }) => ( +
  • + +
  • + )} +
    + ); + })} +
    +
    +
    +
    + + ); } diff --git a/src/components/widgets/unifi_console/unifi_console.jsx b/src/components/widgets/unifi_console/unifi_console.jsx index dad92cc7..13c90bd4 100644 --- a/src/components/widgets/unifi_console/unifi_console.jsx +++ b/src/components/widgets/unifi_console/unifi_console.jsx @@ -3,12 +3,6 @@ import { MdSettingsEthernet } from "react-icons/md"; import { useTranslation } from "next-i18next"; import { SiUbiquiti } from "react-icons/si"; -import Error from "../widget/error"; -import Container from "../widget/container"; -import Raw from "../widget/raw"; -import WidgetIcon from "../widget/widget_icon"; -import PrimaryText from "../widget/primary_text"; - import useWidgetAPI from "utils/proxy/use-widget-api"; export default function Widget({ options }) { @@ -19,16 +13,35 @@ export default function Widget({ options }) { const { data: statsData, error: statsError } = useWidgetAPI(options, "stat/sites", { index: options.index }); if (statsError) { - return + return ( +
    +
    +
    + +
    + {t("widget.api_error")} +
    +
    +
    +
    + ); } const defaultSite = options.site ? statsData?.data.find(s => s.desc === options.site) : statsData?.data?.find(s => s.name === "default"); if (!defaultSite) { - return - {t("unifi.wait")} - - ; + return ( +
    +
    +
    + +
    +
    + {t("unifi.wait")} +
    +
    +
    + ); } const wan = defaultSite.health.find(h => h.subsystem === "wan"); @@ -43,9 +56,8 @@ export default function Widget({ options }) { const dataEmpty = !(wan.show || lan.show || wlan.show || uptime); - return - -
    + return ( +
    @@ -129,7 +141,6 @@ export default function Widget({ options }) {
    }
    -
    -
    -
    +
    + ); } diff --git a/src/components/widgets/weather/weather.jsx b/src/components/widgets/weather/weather.jsx index 702ea669..20bf3dec 100644 --- a/src/components/widgets/weather/weather.jsx +++ b/src/components/widgets/weather/weather.jsx @@ -1,16 +1,10 @@ import useSWR from "swr"; import { useState } from "react"; +import { BiError } from "react-icons/bi"; import { WiCloudDown } from "react-icons/wi"; import { MdLocationDisabled, MdLocationSearching } from "react-icons/md"; import { useTranslation } from "next-i18next"; -import Error from "../widget/error"; -import Container from "../widget/container"; -import PrimaryText from "../widget/primary_text"; -import SecondaryText from "../widget/secondary_text"; -import WidgetIcon from "../widget/widget_icon"; -import ContainerButton from "../widget/container_button"; - import Icon from "./icon"; function Widget({ options }) { @@ -21,35 +15,59 @@ function Widget({ options }) { ); if (error || data?.error) { - return + return ( +
    +
    +
    + +
    + {t("widget.api_error")} + - +
    +
    +
    +
    + ); } if (!data) { - return - {t("weather.updating")} - {t("weather.wait")} - - ; + return ( +
    +
    +
    + +
    +
    + {t("weather.updating")} + {t("weather.wait")} +
    +
    +
    + ); } const unit = options.units === "metric" ? "celsius" : "fahrenheit"; - const weatherInfo = { - condition: data.current.condition.code, - timeOfDay: data.current.is_day ? "day" : "night", - }; - return - - {options.label && `${options.label}, `} - {t("common.number", { - value: options.units === "metric" ? data.current.temp_c : data.current.temp_f, - style: "unit", - unit, - })} - - {data.current.condition.text} - - ; + return ( +
    +
    +
    + +
    +
    + + {options.label && `${options.label}, `} + {t("common.number", { + value: options.units === "metric" ? data.current.temp_c : data.current.temp_f, + style: "unit", + unit, + })} + + {data.current.condition.text} +
    +
    +
    + ); } export default function WeatherApi({ options }) { @@ -81,12 +99,30 @@ export default function WeatherApi({ options }) { } }; + // if (!requesting && !location) requestLocation(); + if (!location) { - return - {t("weather.current")} - {t("weather.allow")} - - ; + return ( + + ); } return ; diff --git a/src/components/widgets/widget.jsx b/src/components/widgets/widget.jsx index b4fdb143..47141887 100644 --- a/src/components/widgets/widget.jsx +++ b/src/components/widgets/widget.jsx @@ -17,13 +17,13 @@ const widgetMappings = { kubernetes: dynamic(() => import("components/widgets/kubernetes/kubernetes")), }; -export default function Widget({ widget, style }) { +export default function Widget({ widget }) { const InfoWidget = widgetMappings[widget.type]; if (InfoWidget) { return ( - + ); } diff --git a/src/components/widgets/widget/container.jsx b/src/components/widgets/widget/container.jsx deleted file mode 100644 index 3a4a9f57..00000000 --- a/src/components/widgets/widget/container.jsx +++ /dev/null @@ -1,42 +0,0 @@ -import classNames from "classnames"; - -import WidgetIcon from "./widget_icon"; -import PrimaryText from "./primary_text"; -import SecondaryText from "./secondary_text"; -import Raw from "./raw"; - -export function getAllClasses(options, additionalClassNames = '') { - return classNames( - "flex flex-col justify-center first:ml-0 ml-4 mr-2", - additionalClassNames, - options?.style === "boxedWidgets" && " ml-4 mt-2 m:mb-0 rounded-md shadow-md shadow-theme-900/10 dark:shadow-theme-900/20 bg-theme-100/20 dark:bg-white/5 p-2 pl-3", - ); -} - -export function getInnerBlock(children) { - // children won't be an array if it's Raw component - return Array.isArray(children) &&
    -
    {children.find(child => child.type === WidgetIcon)}
    -
    - {children.find(child => child.type === PrimaryText)} - {children.find(child => child.type === SecondaryText)} -
    -
    ; -} - -export function getBottomBlock(children) { - if (children.type !== Raw) { - return children.find(child => child.type === Raw) || []; - } - - return [children]; -} - -export default function Container({ children = [], options, additionalClassNames = '' }) { - return ( -
    - {getInnerBlock(children)} - {getBottomBlock(children)} -
    - ); -} diff --git a/src/components/widgets/widget/container_button.jsx b/src/components/widgets/widget/container_button.jsx deleted file mode 100644 index 92d8a416..00000000 --- a/src/components/widgets/widget/container_button.jsx +++ /dev/null @@ -1,10 +0,0 @@ -import { getAllClasses, getInnerBlock, getBottomBlock } from "./container"; - -export default function ContainerButton ({ children = [], options, additionalClassNames = '', callback }) { - return ( - - ); -} diff --git a/src/components/widgets/widget/container_form.jsx b/src/components/widgets/widget/container_form.jsx deleted file mode 100644 index 7d28a1bb..00000000 --- a/src/components/widgets/widget/container_form.jsx +++ /dev/null @@ -1,10 +0,0 @@ -import { getAllClasses, getInnerBlock, getBottomBlock } from "./container"; - -export default function ContainerForm ({ children = [], options, additionalClassNames = '', callback }) { - return ( -
    - {getInnerBlock(children)} - {getBottomBlock(children)} -
    - ); -} diff --git a/src/components/widgets/widget/container_link.jsx b/src/components/widgets/widget/container_link.jsx deleted file mode 100644 index 8ef0e80a..00000000 --- a/src/components/widgets/widget/container_link.jsx +++ /dev/null @@ -1,10 +0,0 @@ -import { getAllClasses, getInnerBlock, getBottomBlock } from "./container"; - -export default function ContainerLink ({ children = [], options, additionalClassNames = '', target }) { - return ( - - {getInnerBlock(children)} - {getBottomBlock(children)} - - ); -} diff --git a/src/components/widgets/widget/error.jsx b/src/components/widgets/widget/error.jsx deleted file mode 100644 index a3dbab85..00000000 --- a/src/components/widgets/widget/error.jsx +++ /dev/null @@ -1,15 +0,0 @@ -import { useTranslation } from "react-i18next"; -import { BiError } from "react-icons/bi"; - -import Container from "./container"; -import PrimaryText from "./primary_text"; -import WidgetIcon from "./widget_icon"; - -export default function Error({ options }) { - const { t } = useTranslation(); - - return - {t("widget.api_error")} - - ; -} diff --git a/src/components/widgets/widget/primary_text.jsx b/src/components/widgets/widget/primary_text.jsx deleted file mode 100644 index 3418b92c..00000000 --- a/src/components/widgets/widget/primary_text.jsx +++ /dev/null @@ -1,5 +0,0 @@ -export default function PrimaryText({ children }) { - return ( - {children} - ); -} diff --git a/src/components/widgets/widget/raw.jsx b/src/components/widgets/widget/raw.jsx deleted file mode 100644 index 44e3dddc..00000000 --- a/src/components/widgets/widget/raw.jsx +++ /dev/null @@ -1,7 +0,0 @@ -export default function Raw({ children }) { - if (children.type === Raw) { - return [children]; - } - - return children; -} diff --git a/src/components/widgets/widget/resource.jsx b/src/components/widgets/widget/resource.jsx deleted file mode 100644 index e77bcb5a..00000000 --- a/src/components/widgets/widget/resource.jsx +++ /dev/null @@ -1,22 +0,0 @@ -import UsageBar from "../resources/usage-bar"; - -export default function Resource({ children, icon, value, label, expandedValue, expandedLabel, percentage, key, expanded = false }) { - const Icon = icon; - - return
    - -
    -
    -
    {value}
    -
    {label}
    -
    - { expanded &&
    -
    {expandedValue}
    -
    {expandedLabel}
    -
    - } - { percentage && } - { children } -
    -
    ; -} diff --git a/src/components/widgets/widget/resources.jsx b/src/components/widgets/widget/resources.jsx deleted file mode 100644 index 19fb021d..00000000 --- a/src/components/widgets/widget/resources.jsx +++ /dev/null @@ -1,15 +0,0 @@ -import ContainerLink from "./container_link"; -import Resource from "./resource"; -import Raw from "./raw"; -import WidgetLabel from "./widget_label"; - -export default function Resources({ options, children, target }) { - return - -
    - { children.filter(child => child && child.type === Resource) } -
    - { children.filter(child => child && child.type === WidgetLabel) } -
    -
    ; -} diff --git a/src/components/widgets/widget/secondary_text.jsx b/src/components/widgets/widget/secondary_text.jsx deleted file mode 100644 index 363d1bd0..00000000 --- a/src/components/widgets/widget/secondary_text.jsx +++ /dev/null @@ -1,5 +0,0 @@ -export default function SecondaryText({ children }) { - return ( - {children} - ); -} diff --git a/src/components/widgets/widget/widget_icon.jsx b/src/components/widgets/widget/widget_icon.jsx deleted file mode 100644 index 9766a879..00000000 --- a/src/components/widgets/widget/widget_icon.jsx +++ /dev/null @@ -1,18 +0,0 @@ -export default function WidgetIcon({ icon, size = "s", pulse = false, weatherInfo = {} }) { - const Icon = icon; - const { condition, timeOfDay } = weatherInfo; - let additionalClasses = "text-theme-800 dark:text-theme-200 "; - - switch (size) { - case "m": additionalClasses += "w-6 h-6 "; break; - case "l": additionalClasses += "w-8 h-8 "; break; - case "xl": additionalClasses += "w-10 h-10 "; break; - default: additionalClasses += "w-5 h-5 "; - } - - if (pulse) { - additionalClasses += "animate-pulse "; - } - - return ; -} diff --git a/src/components/widgets/widget/widget_label.jsx b/src/components/widgets/widget/widget_label.jsx deleted file mode 100644 index dcb9b9e9..00000000 --- a/src/components/widgets/widget/widget_label.jsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function WidgetLabel({ label = "" }) { - return
    {label}
    -} diff --git a/src/pages/api/widgets/longhorn.js b/src/pages/api/widgets/longhorn.js index d23a7f61..a6b6781c 100644 --- a/src/pages/api/widgets/longhorn.js +++ b/src/pages/api/widgets/longhorn.js @@ -46,7 +46,7 @@ function parseLonghornData(data) { export default async function handler(req, res) { const settings = getSettings(); - const longhornSettings = settings?.providers?.longhorn || {}; + const longhornSettings = settings?.providers?.longhorn; const {url, username, password} = longhornSettings; if (!url) { diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 006456f9..e170d4e1 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -160,7 +160,6 @@ const headerStyles = { "m-4 mb-0 sm:m-8 sm:mb-0 rounded-md shadow-md shadow-theme-900/10 dark:shadow-theme-900/20 bg-theme-100/20 dark:bg-white/5 p-3", underlined: "m-4 mb-0 sm:m-8 sm:mb-1 border-b-2 pb-4 border-theme-800 dark:border-theme-200/50", clean: "m-4 mb-0 sm:m-8 sm:mb-0", - boxedWidgets: "m-4 mb-0 sm:m-8 sm:mb-0 sm:mt-1", }; function Home({ initialSettings }) { @@ -209,7 +208,6 @@ function Home({ initialSettings }) { searchProvider = searchProviders[searchWidget.options?.provider]; } } - const headerStyle = initialSettings?.headerStyle || "underlined"; useEffect(() => { function handleKeyDown(e) { @@ -258,7 +256,7 @@ function Home({ initialSettings }) {
    !rightAlignedWidgets.includes(widget.type)) .map((widget, i) => ( - + ))} -
    +
    {widgets .filter((widget) => rightAlignedWidgets.includes(widget.type)) .map((widget, i) => ( - + ))}
    From 1d809556490d31c753114aae09d2470bb6c20caf Mon Sep 17 00:00:00 2001 From: gallegonovato Date: Sat, 10 Jun 2023 11:28:47 +0000 Subject: [PATCH 54/59] Translated using Weblate (Spanish) Currently translated at 100.0% (465 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/es/ --- public/locales/es/common.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/locales/es/common.json b/public/locales/es/common.json index 1782bb92..32fa7e6e 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -177,7 +177,7 @@ "lidarr": { "queued": "En cola", "wanted": "Buscando", - "artists": "Artists" + "artists": "Artistas" }, "adguard": { "queries": "Consultas", From 7af36eb106e14d32d20cad4616cad638a76109a5 Mon Sep 17 00:00:00 2001 From: Nonoss117 Date: Fri, 9 Jun 2023 14:10:07 +0000 Subject: [PATCH 55/59] Translated using Weblate (French) Currently translated at 100.0% (465 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/fr/ --- public/locales/fr/common.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/locales/fr/common.json b/public/locales/fr/common.json index 4cc6dce6..985f3747 100644 --- a/public/locales/fr/common.json +++ b/public/locales/fr/common.json @@ -177,7 +177,7 @@ "lidarr": { "wanted": "Demandé", "queued": "En queue", - "artists": "Artists" + "artists": "Artistes" }, "adguard": { "queries": "Requêtes", @@ -401,7 +401,7 @@ "queue": "À traiter", "processed": "Traité", "errored": "En erreur", - "saved": "Gagné" + "saved": "Libéré" }, "miniflux": { "read": "Lu", From 0d6ccb036ee0241e9027881130a9c16799189322 Mon Sep 17 00:00:00 2001 From: Dan Date: Sat, 10 Jun 2023 14:32:27 +0000 Subject: [PATCH 56/59] Translated using Weblate (Ukrainian) Currently translated at 100.0% (465 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/uk/ --- public/locales/uk/common.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/locales/uk/common.json b/public/locales/uk/common.json index 6b112e8f..1e1ac9b4 100644 --- a/public/locales/uk/common.json +++ b/public/locales/uk/common.json @@ -247,7 +247,7 @@ "lidarr": { "wanted": "Розшукується", "queued": "У черзі", - "artists": "Artists" + "artists": "Виконавці" }, "traefik": { "middleware": "Проміжне програмне забезпечення", From 1fb7be7457188013b4afa5150b4ea8591e561c93 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sun, 11 Jun 2023 09:50:41 -0700 Subject: [PATCH 57/59] Retrieve ping url from config rather than as query parameter --- src/components/services/group.jsx | 4 ++-- src/components/services/item.jsx | 4 ++-- src/components/services/list.jsx | 4 ++-- src/components/services/ping.jsx | 6 +++--- src/pages/api/ping.js | 12 +++++++++++- src/pages/index.jsx | 2 +- src/utils/config/service-helpers.js | 27 ++++++++++++++------------- 7 files changed, 35 insertions(+), 24 deletions(-) diff --git a/src/components/services/group.jsx b/src/components/services/group.jsx index 5f1c5446..94557064 100644 --- a/src/components/services/group.jsx +++ b/src/components/services/group.jsx @@ -3,7 +3,7 @@ import classNames from "classnames"; import List from "components/services/list"; import ResolvedIcon from "components/resolvedicon"; -export default function ServicesGroup({ services, layout, fiveColumns }) { +export default function ServicesGroup({ group, services, layout, fiveColumns }) { return (
    {services.name}
    - +
    ); } diff --git a/src/components/services/item.jsx b/src/components/services/item.jsx index 08b8d1f4..36e454ce 100644 --- a/src/components/services/item.jsx +++ b/src/components/services/item.jsx @@ -11,7 +11,7 @@ import Kubernetes from "widgets/kubernetes/component"; import { SettingsContext } from "utils/contexts/settings"; import ResolvedIcon from "components/resolvedicon"; -export default function Item({ service }) { +export default function Item({ service, group }) { const hasLink = service.href && service.href !== "#"; const { settings } = useContext(SettingsContext); const showStats = (service.showStats === false) ? false : settings.showStats; @@ -77,7 +77,7 @@ export default function Item({ service }) {
    {service.ping && (
    - + Ping status
    )} diff --git a/src/components/services/list.jsx b/src/components/services/list.jsx index c8028df5..85083af3 100644 --- a/src/components/services/list.jsx +++ b/src/components/services/list.jsx @@ -14,7 +14,7 @@ const columnMap = [ "grid-cols-1 md:grid-cols-2 lg:grid-cols-8", ]; -export default function List({ services, layout }) { +export default function List({ group, services, layout }) { return (
      {services.map((service) => ( - + ))}
    ); diff --git a/src/components/services/ping.jsx b/src/components/services/ping.jsx index a54b1b55..291bc9e0 100644 --- a/src/components/services/ping.jsx +++ b/src/components/services/ping.jsx @@ -1,9 +1,9 @@ import { useTranslation } from "react-i18next"; import useSWR from "swr"; -export default function Ping({ service }) { +export default function Ping({ group, service }) { const { t } = useTranslation(); - const { data, error } = useSWR(`/api/ping?${new URLSearchParams({ping: service.ping}).toString()}`, { + const { data, error } = useSWR(`/api/ping?${new URLSearchParams({ group, service }).toString()}`, { refreshInterval: 30000 }); @@ -23,7 +23,7 @@ export default function Ping({ service }) { ); } - const statusText = `${service.ping}: HTTP status ${data.status}`; + const statusText = `${service}: HTTP status ${data.status}`; if (data.status > 403) { return ( diff --git a/src/pages/api/ping.js b/src/pages/api/ping.js index 96c1b12c..cfc2aafa 100644 --- a/src/pages/api/ping.js +++ b/src/pages/api/ping.js @@ -1,12 +1,22 @@ import { performance } from "perf_hooks"; +import { getServiceItem } from "utils/config/service-helpers"; import createLogger from "utils/logger"; import { httpProxy } from "utils/proxy/http"; const logger = createLogger("ping"); export default async function handler(req, res) { - const { ping: pingURL } = req.query; + const { group, service } = req.query; + const serviceItem = await getServiceItem(group, service); + if (!serviceItem) { + logger.debug(`No service item found for group ${group} named ${service}`); + return res.status(400).send({ + error: "Unable to find service, see log for details.", + }); + } + + const { ping: pingURL } = serviceItem; if (!pingURL) { logger.debug("No ping URL specified"); diff --git a/src/pages/index.jsx b/src/pages/index.jsx index e170d4e1..6180ff51 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -289,7 +289,7 @@ function Home({ initialSettings }) { {services?.length > 0 && (
    {services.map((group) => ( - + ))}
    )} diff --git a/src/utils/config/service-helpers.js b/src/utils/config/service-helpers.js index c63fa8f2..d4f7bc4e 100644 --- a/src/utils/config/service-helpers.js +++ b/src/utils/config/service-helpers.js @@ -328,16 +328,13 @@ export function cleanServiceGroups(groups) { })); } -export default async function getServiceWidget(group, service) { +export async function getServiceItem(group, service) { const configuredServices = await servicesFromConfig(); const serviceGroup = configuredServices.find((g) => g.name === group); if (serviceGroup) { const serviceEntry = serviceGroup.services.find((s) => s.name === service); - if (serviceEntry) { - const { widget } = serviceEntry; - return widget; - } + if (serviceEntry) return serviceEntry; } const discoveredServices = await servicesFromDocker(); @@ -345,20 +342,24 @@ export default async function getServiceWidget(group, service) { const dockerServiceGroup = discoveredServices.find((g) => g.name === group); if (dockerServiceGroup) { const dockerServiceEntry = dockerServiceGroup.services.find((s) => s.name === service); - if (dockerServiceEntry) { - const { widget } = dockerServiceEntry; - return widget; - } + if (dockerServiceEntry) return dockerServiceEntry; } const kubernetesServices = await servicesFromKubernetes(); const kubernetesServiceGroup = kubernetesServices.find((g) => g.name === group); if (kubernetesServiceGroup) { const kubernetesServiceEntry = kubernetesServiceGroup.services.find((s) => s.name === service); - if (kubernetesServiceEntry) { - const { widget } = kubernetesServiceEntry; - return widget; - } + if (kubernetesServiceEntry) return kubernetesServiceEntry; + } + + return false; +} + +export default async function getServiceWidget(group, service) { + const serviceItem = await getServiceItem(group, service); + if (serviceItem) { + const { widget } = serviceItem; + return widget; } return false; From 7c8638467eec7c9b8785a9ded0d218a5d7501c2e Mon Sep 17 00:00:00 2001 From: Danilo Date: Sun, 11 Jun 2023 20:24:53 +0000 Subject: [PATCH 58/59] Translated using Weblate (Portuguese) Currently translated at 89.2% (415 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/pt/ --- public/locales/pt/common.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/public/locales/pt/common.json b/public/locales/pt/common.json index cc6dfe46..ab38ab2f 100644 --- a/public/locales/pt/common.json +++ b/public/locales/pt/common.json @@ -590,12 +590,12 @@ "switches_on": "Interruptores Ligados" }, "freshrss": { - "subscriptions": "Subscriptions", - "unread": "Unread" + "subscriptions": "Assinaturas", + "unread": "Não lida" }, "channelsdvrserver": { "shows": "Shows", - "recordings": "Recordings", + "recordings": "Gravações", "scheduled": "Scheduled", "passes": "Passes" }, @@ -637,16 +637,16 @@ }, "caddy": { "upstreams": "Upstreams", - "requests": "Current requests", - "requests_failed": "Failed requests" + "requests": "Solicitações atuais", + "requests_failed": "Solicitações com falha" }, "evcc": { - "pv_power": "Production", - "battery_soc": "Battery", - "grid_power": "Grid", - "home_power": "Consumption", - "charge_power": "Charger", - "watt_hour": "Wh" + "pv_power": "Produção", + "battery_soc": "Bateria", + "grid_power": "Grade", + "home_power": "Consumo", + "charge_power": "Carregador", + "watt_hour": "Kw" }, "pialert": { "total": "Total", From dcb3dccdc845b810463e71e72cdb0650c217fda8 Mon Sep 17 00:00:00 2001 From: Ado Nishimura Date: Mon, 12 Jun 2023 11:36:26 +0000 Subject: [PATCH 59/59] Translated using Weblate (Japanese) Currently translated at 82.5% (384 of 465 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ja/ --- public/locales/ja/common.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/public/locales/ja/common.json b/public/locales/ja/common.json index ec9b82a9..72d7d8ae 100644 --- a/public/locales/ja/common.json +++ b/public/locales/ja/common.json @@ -63,7 +63,7 @@ "resources": { "cpu": "CPU", "total": "合計", - "free": "フリー", + "free": "Free", "used": "使用", "load": "ロード", "mem": "MEM", @@ -609,11 +609,11 @@ "ago": "{{value}} 前" }, "qnap": { - "cpuUsage": "CPU Usage", - "memUsage": "MEM Usage", - "systemTempC": "System Temp", - "poolUsage": "Pool Usage", - "volumeUsage": "Volume Usage", + "cpuUsage": "CPU使用量", + "memUsage": "MEM使用量", + "systemTempC": "システム温度", + "poolUsage": "プール使用量", + "volumeUsage": "ボリューム使用量", "invalid": "Invalid" }, "pfsense": { @@ -633,11 +633,11 @@ }, "evcc": { "watt_hour": "Wh", - "pv_power": "Production", - "battery_soc": "Battery", - "grid_power": "Grid", - "home_power": "Consumption", - "charge_power": "Charger" + "pv_power": "発電量", + "battery_soc": "バッテリー", + "grid_power": "グリッド", + "home_power": "消費", + "charge_power": "チャージャー" }, "pialert": { "total": "Total",