diff --git a/public/locales/ar/common.json b/public/locales/ar/common.json index cecfb771..7f118dc1 100644 --- a/public/locales/ar/common.json +++ b/public/locales/ar/common.json @@ -194,7 +194,7 @@ "lidarr": { "wanted": "مطلوب", "queued": "في الإنتظار", - "albums": "ألبومات" + "artists": "Artists" }, "readarr": { "wanted": "مطلوب", diff --git a/public/locales/bg/common.json b/public/locales/bg/common.json index e567de17..bb6bacbb 100644 --- a/public/locales/bg/common.json +++ b/public/locales/bg/common.json @@ -132,7 +132,7 @@ "lidarr": { "wanted": "Wanted", "queued": "Queued", - "albums": "Albums" + "artists": "Artists" }, "readarr": { "wanted": "Wanted", diff --git a/public/locales/ca/common.json b/public/locales/ca/common.json index b133c24f..41391cd5 100644 --- a/public/locales/ca/common.json +++ b/public/locales/ca/common.json @@ -177,7 +177,7 @@ "lidarr": { "wanted": "Volgut", "queued": "En cua", - "albums": "Àlbums" + "artists": "Artists" }, "adguard": { "queries": "Consultes", diff --git a/public/locales/cs/common.json b/public/locales/cs/common.json index e4699e86..940ec67e 100644 --- a/public/locales/cs/common.json +++ b/public/locales/cs/common.json @@ -148,7 +148,7 @@ "lidarr": { "wanted": "Hledané", "queued": "Ve frontě", - "albums": "Alba" + "artists": "Artists" }, "readarr": { "wanted": "Hledané", diff --git a/public/locales/da/common.json b/public/locales/da/common.json index ccaa5d52..d1c41aaa 100644 --- a/public/locales/da/common.json +++ b/public/locales/da/common.json @@ -16,7 +16,7 @@ "lidarr": { "wanted": "Ønsket", "queued": "I Kø", - "albums": "Albums" + "artists": "Artists" }, "jellyseerr": { "available": "Tilgængelig", diff --git a/public/locales/de/common.json b/public/locales/de/common.json index 0d664d99..dc06f5d3 100644 --- a/public/locales/de/common.json +++ b/public/locales/de/common.json @@ -177,7 +177,7 @@ "lidarr": { "wanted": "Gesucht", "queued": "In Warteschlange", - "albums": "Alben" + "artists": "Artists" }, "adguard": { "queries": "Anfragen", diff --git a/public/locales/el/common.json b/public/locales/el/common.json index 19f4a0ae..3492bdd1 100644 --- a/public/locales/el/common.json +++ b/public/locales/el/common.json @@ -227,7 +227,7 @@ "lidarr": { "wanted": "Θέλετε", "queued": "Στη σειρά", - "albums": "Δίσκοι" + "artists": "Artists" }, "readarr": { "wanted": "Θέλετε", diff --git a/public/locales/en/common.json b/public/locales/en/common.json index d1b3ce33..8def29ec 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/public/locales/eo/common.json b/public/locales/eo/common.json index 8aa16f14..4ed593be 100644 --- a/public/locales/eo/common.json +++ b/public/locales/eo/common.json @@ -146,7 +146,7 @@ "lidarr": { "wanted": "Wanted", "queued": "Queued", - "albums": "Albumoj" + "artists": "Artists" }, "readarr": { "wanted": "Wanted", diff --git a/public/locales/es/common.json b/public/locales/es/common.json index 5d528e64..32fa7e6e 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", @@ -177,7 +177,7 @@ "lidarr": { "queued": "En cola", "wanted": "Buscando", - "albums": "Álbumes" + "artists": "Artistas" }, "adguard": { "queries": "Consultas", diff --git a/public/locales/fi/common.json b/public/locales/fi/common.json index 07dbb8e5..f403b6d4 100644 --- a/public/locales/fi/common.json +++ b/public/locales/fi/common.json @@ -109,7 +109,7 @@ "lidarr": { "wanted": "Haluttu", "queued": "Jonossa", - "albums": "Albumeja" + "artists": "Artists" }, "readarr": { "wanted": "Haluttu", diff --git a/public/locales/fr/common.json b/public/locales/fr/common.json index 12f2098c..985f3747 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", @@ -177,7 +177,7 @@ "lidarr": { "wanted": "Demandé", "queued": "En queue", - "albums": "Albums" + "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", diff --git a/public/locales/he/common.json b/public/locales/he/common.json index 9e682c20..dfe2cb84 100644 --- a/public/locales/he/common.json +++ b/public/locales/he/common.json @@ -109,7 +109,7 @@ "lidarr": { "wanted": "מבוקש", "queued": "בתור", - "albums": "אלבומים" + "artists": "Artists" }, "readarr": { "wanted": "מבוקש", diff --git a/public/locales/hi/common.json b/public/locales/hi/common.json index 4efc87e0..623775c2 100644 --- a/public/locales/hi/common.json +++ b/public/locales/hi/common.json @@ -170,7 +170,7 @@ "lidarr": { "wanted": "Wanted", "queued": "Queued", - "albums": "Albums" + "artists": "Artists" }, "overseerr": { "pending": "Pending", diff --git a/public/locales/hr/common.json b/public/locales/hr/common.json index fce370ce..9a05a55c 100644 --- a/public/locales/hr/common.json +++ b/public/locales/hr/common.json @@ -140,7 +140,7 @@ "lidarr": { "wanted": "Zatraženo", "queued": "U redu čekanja", - "albums": "Albumi" + "artists": "Artists" }, "readarr": { "wanted": "Zatraženo", diff --git a/public/locales/hu/common.json b/public/locales/hu/common.json index 98687d9f..a8218e73 100644 --- a/public/locales/hu/common.json +++ b/public/locales/hu/common.json @@ -31,9 +31,9 @@ "healthy": "Healthy" }, "lidarr": { - "albums": "Albumok", "wanted": "Keresett", - "queued": "Sorban áll" + "queued": "Sorban áll", + "artists": "Artists" }, "readarr": { "wanted": "Keresett", diff --git a/public/locales/id/common.json b/public/locales/id/common.json index c36ae790..d54218c4 100644 --- a/public/locales/id/common.json +++ b/public/locales/id/common.json @@ -70,7 +70,7 @@ "lidarr": { "wanted": "Wanted", "queued": "Queued", - "albums": "Albums" + "artists": "Artists" }, "readarr": { "wanted": "Wanted", diff --git a/public/locales/it/common.json b/public/locales/it/common.json index 5eed8b41..2e666af4 100644 --- a/public/locales/it/common.json +++ b/public/locales/it/common.json @@ -177,7 +177,7 @@ "lidarr": { "wanted": "Mancanti", "queued": "In coda", - "albums": "Album" + "artists": "Artists" }, "adguard": { "queries": "Interrogazioni", diff --git a/public/locales/ja/common.json b/public/locales/ja/common.json index 1a96786b..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", @@ -208,7 +208,7 @@ "lidarr": { "wanted": "募集中", "queued": "キュー", - "albums": "アルバム" + "artists": "Artists" }, "readarr": { "wanted": "募集中", @@ -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", diff --git a/public/locales/ko/common.json b/public/locales/ko/common.json index 56e8dd77..6a58072f 100644 --- a/public/locales/ko/common.json +++ b/public/locales/ko/common.json @@ -178,7 +178,7 @@ "lidarr": { "wanted": "요청", "queued": "대기 중", - "albums": "앨범" + "artists": "Artists" }, "readarr": { "wanted": "요청", diff --git a/public/locales/lv/common.json b/public/locales/lv/common.json index 3e4c9173..d8d63388 100644 --- a/public/locales/lv/common.json +++ b/public/locales/lv/common.json @@ -169,7 +169,7 @@ "lidarr": { "wanted": "Wanted", "queued": "Queued", - "albums": "Albumi" + "artists": "Artists" }, "readarr": { "wanted": "Wanted", diff --git a/public/locales/ms/common.json b/public/locales/ms/common.json index 716049ef..e249cf43 100644 --- a/public/locales/ms/common.json +++ b/public/locales/ms/common.json @@ -33,8 +33,8 @@ }, "lidarr": { "queued": "Dibaris Gilir", - "albums": "Album", - "wanted": "Mahu" + "wanted": "Mahu", + "artists": "Artists" }, "readarr": { "wanted": "Mahu", diff --git a/public/locales/nb-NO/common.json b/public/locales/nb-NO/common.json index 5761e333..cdcda4a8 100644 --- a/public/locales/nb-NO/common.json +++ b/public/locales/nb-NO/common.json @@ -177,7 +177,7 @@ "lidarr": { "wanted": "Wanted", "queued": "Queued", - "albums": "Albums" + "artists": "Artists" }, "adguard": { "queries": "Queries", diff --git a/public/locales/nl/common.json b/public/locales/nl/common.json index fad081f6..2afed425 100644 --- a/public/locales/nl/common.json +++ b/public/locales/nl/common.json @@ -177,7 +177,7 @@ "lidarr": { "wanted": "Gezocht", "queued": "In de wachtrij", - "albums": "Albums" + "artists": "Artists" }, "adguard": { "queries": "Queries", diff --git a/public/locales/pl/common.json b/public/locales/pl/common.json index 18a57078..d43f9859 100644 --- a/public/locales/pl/common.json +++ b/public/locales/pl/common.json @@ -125,7 +125,7 @@ "lidarr": { "wanted": "Poszukiwane", "queued": "W kolejce", - "albums": "Albumy" + "artists": "Artists" }, "readarr": { "wanted": "Poszukiwane", diff --git a/public/locales/pt-BR/common.json b/public/locales/pt-BR/common.json index d4392e18..716ac875 100644 --- a/public/locales/pt-BR/common.json +++ b/public/locales/pt-BR/common.json @@ -127,7 +127,7 @@ "lidarr": { "wanted": "Desejado", "queued": "Na fila", - "albums": "Álbuns" + "artists": "Artists" }, "readarr": { "wanted": "Desejado", diff --git a/public/locales/pt/common.json b/public/locales/pt/common.json index ef5f7cd8..ab38ab2f 100644 --- a/public/locales/pt/common.json +++ b/public/locales/pt/common.json @@ -190,7 +190,7 @@ "lidarr": { "queued": "Enfileirado", "wanted": "Desejado", - "albums": "Álbuns" + "artists": "Artists" }, "adguard": { "queries": "Consultas", @@ -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", diff --git a/public/locales/ro/common.json b/public/locales/ro/common.json index 535ecb7d..3ca5004e 100644 --- a/public/locales/ro/common.json +++ b/public/locales/ro/common.json @@ -149,7 +149,7 @@ "lidarr": { "wanted": "Dorite", "queued": "În coadă", - "albums": "Albume" + "artists": "Artists" }, "readarr": { "wanted": "Dorite", diff --git a/public/locales/ru/common.json b/public/locales/ru/common.json index 5e16f154..f89313db 100644 --- a/public/locales/ru/common.json +++ b/public/locales/ru/common.json @@ -177,7 +177,7 @@ "lidarr": { "wanted": "Хотел", "queued": "В очереди", - "albums": "Альбомы" + "artists": "Artists" }, "adguard": { "queries": "Запросы", diff --git a/public/locales/sk/common.json b/public/locales/sk/common.json index 70c699f8..ee08f212 100644 --- a/public/locales/sk/common.json +++ b/public/locales/sk/common.json @@ -288,7 +288,7 @@ "lidarr": { "wanted": "Wanted", "queued": "Queued", - "albums": "Albums" + "artists": "Artists" }, "readarr": { "wanted": "Wanted", diff --git a/public/locales/sl/common.json b/public/locales/sl/common.json index 7632e2aa..fe5fe631 100644 --- a/public/locales/sl/common.json +++ b/public/locales/sl/common.json @@ -250,7 +250,7 @@ "lidarr": { "wanted": "Iskano", "queued": "V vrsti", - "albums": "Albumi" + "artists": "Artists" }, "readarr": { "wanted": "Iskano", diff --git a/public/locales/sr/common.json b/public/locales/sr/common.json index 5c6e0b2e..8ce72d5c 100644 --- a/public/locales/sr/common.json +++ b/public/locales/sr/common.json @@ -132,7 +132,7 @@ "lidarr": { "wanted": "Wanted", "queued": "Queued", - "albums": "Albums" + "artists": "Artists" }, "readarr": { "wanted": "Wanted", diff --git a/public/locales/sv/common.json b/public/locales/sv/common.json index 0da6efb3..962a57be 100644 --- a/public/locales/sv/common.json +++ b/public/locales/sv/common.json @@ -103,7 +103,7 @@ "lidarr": { "wanted": "Eftersöker", "queued": "I kö", - "albums": "Album" + "artists": "Artists" }, "readarr": { "wanted": "Eftersökt", diff --git a/public/locales/te/common.json b/public/locales/te/common.json index 867baeae..3d0deb15 100644 --- a/public/locales/te/common.json +++ b/public/locales/te/common.json @@ -126,7 +126,7 @@ "lidarr": { "wanted": "కావలెను", "queued": "క్యూయూఎడ్", - "albums": "ఆల్బములు" + "artists": "Artists" }, "bazarr": { "missingEpisodes": "ఎపిసోడ్‌లు లేవు", diff --git a/public/locales/th/common.json b/public/locales/th/common.json index 660744b7..3981f0f8 100644 --- a/public/locales/th/common.json +++ b/public/locales/th/common.json @@ -225,7 +225,7 @@ "lidarr": { "wanted": "Wanted", "queued": "Queued", - "albums": "Albums" + "artists": "Artists" }, "ombi": { "pending": "Pending", diff --git a/public/locales/tr/common.json b/public/locales/tr/common.json index d2f9667d..09639f67 100644 --- a/public/locales/tr/common.json +++ b/public/locales/tr/common.json @@ -132,7 +132,7 @@ "lidarr": { "wanted": "Aranan", "queued": "Kuyrukta", - "albums": "Albümler" + "artists": "Artists" }, "readarr": { "wanted": "Aranan", diff --git a/public/locales/uk/common.json b/public/locales/uk/common.json index 2561f4a8..1e1ac9b4 100644 --- a/public/locales/uk/common.json +++ b/public/locales/uk/common.json @@ -233,21 +233,21 @@ "wanted": "Розшукується", "queued": "У черзі", "series": "Серії", - "queue": "Queue", - "unknown": "Unknown" + "queue": "Черга", + "unknown": "Невідомо" }, "radarr": { "wanted": "Розшукується", "missing": "Відсутній", "queued": "У черзі", "movies": "Фільми", - "queue": "Queue", - "unknown": "Unknown" + "queue": "Черга", + "unknown": "Невідомо" }, "lidarr": { "wanted": "Розшукується", "queued": "У черзі", - "albums": "Альбоми" + "artists": "Виконавці" }, "traefik": { "middleware": "Проміжне програмне забезпечення", diff --git a/public/locales/vi/common.json b/public/locales/vi/common.json index 2b551546..ef39cd2d 100644 --- a/public/locales/vi/common.json +++ b/public/locales/vi/common.json @@ -177,7 +177,7 @@ "lidarr": { "wanted": "Wanted", "queued": "Queued", - "albums": "Albums" + "artists": "Artists" }, "adguard": { "queries": "Queries", diff --git a/public/locales/yue/common.json b/public/locales/yue/common.json index ce9af7e4..73e5998b 100644 --- a/public/locales/yue/common.json +++ b/public/locales/yue/common.json @@ -109,7 +109,7 @@ "lidarr": { "wanted": "想睇", "queued": "排緊隊", - "albums": "專輯" + "artists": "Artists" }, "readarr": { "wanted": "想睇", diff --git a/public/locales/zh-CN/common.json b/public/locales/zh-CN/common.json index 1b6a7ea2..50e36395 100644 --- a/public/locales/zh-CN/common.json +++ b/public/locales/zh-CN/common.json @@ -177,7 +177,7 @@ "lidarr": { "wanted": "订阅", "queued": "队列", - "albums": "相册" + "artists": "Artists" }, "adguard": { "queries": "查询", diff --git a/public/locales/zh-Hant/common.json b/public/locales/zh-Hant/common.json index 7ea7c835..75aff10e 100644 --- a/public/locales/zh-Hant/common.json +++ b/public/locales/zh-Hant/common.json @@ -177,7 +177,7 @@ "lidarr": { "wanted": "關注中", "queued": "已加入佇列", - "albums": "專輯" + "artists": "Artists" }, "adguard": { "queries": "查詢", 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/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/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 06e55010..6180ff51 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -252,7 +252,7 @@ function Home({ initialSettings }) { /> -
+
0 && (
{services.map((group) => ( - + ))}
)} @@ -302,14 +302,16 @@ function Home({ initialSettings }) {
)} -
- {!initialSettings?.color && } - - {!initialSettings?.theme && } -
+
+
+ {!initialSettings?.color && } + + {!initialSettings?.theme && } +
-
- {!initialSettings?.hideVersion && } +
+ {!initialSettings?.hideVersion && } +
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; 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/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..2f036726 100644 --- a/src/widgets/lidarr/widget.js +++ b/src/widgets/lidarr/widget.js @@ -1,16 +1,12 @@ import genericProxyHandler from "utils/proxy/handlers/generic"; -import { jsonArrayFilter } from "utils/proxy/api-helpers"; const widget = { api: "{url}/api/v1/{endpoint}?apikey={key}", 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", diff --git a/src/widgets/portainer/component.jsx b/src/widgets/portainer/component.jsx index aab9eba1..53a6fd26 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 || containersData.message) { + // containersData can be itself an error object e.g. if environment fails + return ; } const running = containersData.filter((c) => c.State === "running").length;