From bd1c2b1881a11458deb977c46244d47331cf921b Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Sun, 30 Apr 2023 19:09:37 -0400 Subject: [PATCH] Add setting to hide widgets on failure --- src/components/services/widget/container.jsx | 12 +++++++++++- src/components/services/widget/error.jsx | 6 ++---- src/utils/config/service-helpers.js | 4 +++- src/widgets/adguard/component.jsx | 2 +- src/widgets/audiobookshelf/component.jsx | 2 +- src/widgets/authentik/component.jsx | 2 +- src/widgets/autobrr/component.jsx | 2 +- src/widgets/bazarr/component.jsx | 2 +- src/widgets/changedetectionio/component.jsx | 2 +- src/widgets/channelsdvrserver/component.jsx | 2 +- src/widgets/cloudflared/component.jsx | 4 ++-- src/widgets/coinmarketcap/component.jsx | 2 +- src/widgets/deluge/component.jsx | 2 +- src/widgets/diskstation/component.jsx | 2 +- src/widgets/docker/component.jsx | 2 +- src/widgets/downloadstation/component.jsx | 2 +- src/widgets/emby/component.jsx | 2 +- src/widgets/fileflows/component.jsx | 2 +- src/widgets/flood/component.jsx | 2 +- src/widgets/freshrss/component.jsx | 2 +- src/widgets/ghostfolio/component.jsx | 2 +- src/widgets/gluetun/component.jsx | 2 +- src/widgets/gotify/component.jsx | 2 +- src/widgets/grafana/component.jsx | 2 +- src/widgets/hdhomerun/component.jsx | 2 +- src/widgets/healthchecks/component.jsx | 2 +- src/widgets/homeassistant/component.jsx | 2 +- src/widgets/homebridge/component.jsx | 2 +- src/widgets/immich/component.jsx | 2 +- src/widgets/jackett/component.jsx | 2 +- src/widgets/jellyseerr/component.jsx | 2 +- src/widgets/komga/component.jsx | 4 ++-- src/widgets/kopia/component.jsx | 4 ++-- src/widgets/kubernetes/component.jsx | 2 +- src/widgets/lidarr/component.jsx | 2 +- src/widgets/mastodon/component.jsx | 2 +- src/widgets/medusa/component.jsx | 2 +- src/widgets/mikrotik/component.jsx | 2 +- src/widgets/minecraft/component.jsx | 2 +- src/widgets/miniflux/component.jsx | 2 +- src/widgets/moonraker/component.jsx | 2 +- src/widgets/mylar/component.jsx | 4 ++-- src/widgets/navidrome/component.jsx | 2 +- src/widgets/nextcloud/component.jsx | 2 +- src/widgets/nextdns/component.jsx | 2 +- src/widgets/npm/component.jsx | 2 +- src/widgets/nzbget/component.jsx | 2 +- src/widgets/octoprint/component.jsx | 4 ++-- src/widgets/omada/component.jsx | 2 +- src/widgets/ombi/component.jsx | 2 +- src/widgets/opnsense/component.jsx | 2 +- src/widgets/overseerr/component.jsx | 2 +- src/widgets/paperlessngx/component.jsx | 2 +- src/widgets/photoprism/component.jsx | 2 +- src/widgets/pihole/component.jsx | 2 +- src/widgets/plex/component.jsx | 2 +- src/widgets/portainer/component.jsx | 4 ++-- src/widgets/prometheus/component.jsx | 2 +- src/widgets/prowlarr/component.jsx | 2 +- src/widgets/proxmox/component.jsx | 2 +- src/widgets/proxmoxbackupserver/component.jsx | 2 +- src/widgets/pterodactyl/component.jsx | 2 +- src/widgets/pyload/component.jsx | 2 +- src/widgets/qbittorrent/component.jsx | 2 +- src/widgets/radarr/component.jsx | 2 +- src/widgets/readarr/component.jsx | 2 +- src/widgets/rutorrent/component.jsx | 2 +- src/widgets/sabnzbd/component.jsx | 2 +- src/widgets/scrutiny/component.jsx | 2 +- src/widgets/sonarr/component.jsx | 2 +- src/widgets/speedtest/component.jsx | 2 +- src/widgets/strelaysrv/component.jsx | 2 +- src/widgets/tautulli/component.jsx | 2 +- src/widgets/tdarr/component.jsx | 2 +- src/widgets/traefik/component.jsx | 2 +- src/widgets/transmission/component.jsx | 2 +- src/widgets/truenas/component.jsx | 2 +- src/widgets/tubearchivist/component.jsx | 2 +- src/widgets/unifi/component.jsx | 2 +- src/widgets/unmanic/component.jsx | 2 +- src/widgets/uptimekuma/component.jsx | 2 +- src/widgets/watchtower/component.jsx | 2 +- src/widgets/whatsupdocker/component.jsx | 2 +- src/widgets/xteve/component.jsx | 2 +- 84 files changed, 103 insertions(+), 93 deletions(-) diff --git a/src/components/services/widget/container.jsx b/src/components/services/widget/container.jsx index c2249f56f..f4d8c13ee 100644 --- a/src/components/services/widget/container.jsx +++ b/src/components/services/widget/container.jsx @@ -1,8 +1,18 @@ +import { useContext } from "react"; + import Error from "./error"; +import { SettingsContext } from "utils/contexts/settings"; + export default function Container({ error = false, children, service }) { + const { settings } = useContext(SettingsContext); + if (error) { - return + if (settings.hideErrors || service.widget.hide_errors) { + return null; + } + + return } let visibleChildren = children; diff --git a/src/components/services/widget/error.jsx b/src/components/services/widget/error.jsx index cf5e13661..587c572fc 100644 --- a/src/components/services/widget/error.jsx +++ b/src/components/services/widget/error.jsx @@ -9,12 +9,10 @@ function displayData(data) { return (data.type === 'Buffer') ? Buffer.from(data).toString() : JSON.stringify(data, 4); } -export default function Error({ error }) { +export default function Error({ error: err }) { const { t } = useTranslation(); - if (error?.data?.error) { - error = error.data.error; // eslint-disable-line no-param-reassign - } + const { error } = err?.data ?? { error: err }; return (
diff --git a/src/utils/config/service-helpers.js b/src/utils/config/service-helpers.js index d4d48a13f..c38fe47c0 100644 --- a/src/utils/config/service-helpers.js +++ b/src/utils/config/service-helpers.js @@ -257,6 +257,7 @@ export function cleanServiceGroups(groups) { const { type, // all widgets fields, + hideErrors, server, // docker widget container, currency, // coinmarketcap widget @@ -269,7 +270,7 @@ export function cleanServiceGroups(groups) { wan, // opnsense widget, enableBlocks, // emby/jellyfin enableNowPlaying, - volume // diskstation widget + volume, // diskstation widget } = cleanedService.widget; const fieldsList = typeof fields === 'string' ? JSON.parse(fields) : fields; @@ -277,6 +278,7 @@ export function cleanServiceGroups(groups) { cleanedService.widget = { type, fields: fieldsList || null, + hide_errors: hideErrors || false, service_name: service.name, service_group: serviceGroup.name, }; diff --git a/src/widgets/adguard/component.jsx b/src/widgets/adguard/component.jsx index bab969ad3..0c58ba69d 100644 --- a/src/widgets/adguard/component.jsx +++ b/src/widgets/adguard/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: adguardData, error: adguardError } = useWidgetAPI(widget, "stats"); if (adguardError) { - return ; + return ; } if (!adguardData) { diff --git a/src/widgets/audiobookshelf/component.jsx b/src/widgets/audiobookshelf/component.jsx index 2ac38be0d..0991cb6dd 100755 --- a/src/widgets/audiobookshelf/component.jsx +++ b/src/widgets/audiobookshelf/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { if (librariesError) { - return ; + return ; } if (!librariesData) { diff --git a/src/widgets/authentik/component.jsx b/src/widgets/authentik/component.jsx index 84498db48..99449e407 100644 --- a/src/widgets/authentik/component.jsx +++ b/src/widgets/authentik/component.jsx @@ -15,7 +15,7 @@ export default function Component({ service }) { if (usersError || loginsError || failedLoginsError) { const finalError = usersError ?? loginsError ?? failedLoginsError; - return ; + return ; } if (!usersData || !loginsData || !failedLoginsData) { diff --git a/src/widgets/autobrr/component.jsx b/src/widgets/autobrr/component.jsx index 3c1702436..f983789b1 100644 --- a/src/widgets/autobrr/component.jsx +++ b/src/widgets/autobrr/component.jsx @@ -15,7 +15,7 @@ export default function Component({ service }) { if (statsError || filtersError || indexersError) { const finalError = statsError ?? filtersError ?? indexersError; - return ; + return ; } if (!statsData || !filtersData || !indexersData) { diff --git a/src/widgets/bazarr/component.jsx b/src/widgets/bazarr/component.jsx index 0537c180d..082e368ae 100644 --- a/src/widgets/bazarr/component.jsx +++ b/src/widgets/bazarr/component.jsx @@ -14,7 +14,7 @@ export default function Component({ service }) { if (moviesError || episodesError) { const finalError = moviesError ?? episodesError; - return ; + return ; } if (!episodesData || !moviesData) { diff --git a/src/widgets/changedetectionio/component.jsx b/src/widgets/changedetectionio/component.jsx index 6f98df6b5..e8e5106bd 100644 --- a/src/widgets/changedetectionio/component.jsx +++ b/src/widgets/changedetectionio/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data, error } = useWidgetAPI(widget, "info"); if (error) { - return ; + return ; } if (!data) { diff --git a/src/widgets/channelsdvrserver/component.jsx b/src/widgets/channelsdvrserver/component.jsx index d989c9a80..52e94c293 100644 --- a/src/widgets/channelsdvrserver/component.jsx +++ b/src/widgets/channelsdvrserver/component.jsx @@ -11,7 +11,7 @@ export default function Component({ service }) { const { data: channelsData, error: channelsError } = useWidgetAPI(widget, "status"); if (channelsError) { - return ; + return ; } if (!channelsData) { diff --git a/src/widgets/cloudflared/component.jsx b/src/widgets/cloudflared/component.jsx index 2cbcd45b8..733650ffb 100644 --- a/src/widgets/cloudflared/component.jsx +++ b/src/widgets/cloudflared/component.jsx @@ -8,7 +8,7 @@ export default function Component({ service }) { const { data: statsData, error: statsError } = useWidgetAPI(widget, "cfd_tunnel"); if (statsError) { - return ; + return ; } if (!statsData) { @@ -28,4 +28,4 @@ export default function Component({ service }) { ); -} \ No newline at end of file +} diff --git a/src/widgets/coinmarketcap/component.jsx b/src/widgets/coinmarketcap/component.jsx index 180ffe220..554bb044f 100644 --- a/src/widgets/coinmarketcap/component.jsx +++ b/src/widgets/coinmarketcap/component.jsx @@ -38,7 +38,7 @@ export default function Component({ service }) { } if (statsError) { - return ; + return ; } if (!statsData || !dateRange) { diff --git a/src/widgets/deluge/component.jsx b/src/widgets/deluge/component.jsx index f3761b8f6..0d7190d47 100644 --- a/src/widgets/deluge/component.jsx +++ b/src/widgets/deluge/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: torrentData, error: torrentError } = useWidgetAPI(widget); if (torrentError) { - return ; + return ; } if (!torrentData) { diff --git a/src/widgets/diskstation/component.jsx b/src/widgets/diskstation/component.jsx index afc41ae45..3ece19d16 100644 --- a/src/widgets/diskstation/component.jsx +++ b/src/widgets/diskstation/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: utilizationData, error: utilizationError } = useWidgetAPI(widget, "utilization"); if (storageError || infoError || utilizationError) { - return ; + return ; } if (!storageData || !infoData || !utilizationData) { diff --git a/src/widgets/docker/component.jsx b/src/widgets/docker/component.jsx index 88b47add0..df3416854 100644 --- a/src/widgets/docker/component.jsx +++ b/src/widgets/docker/component.jsx @@ -19,7 +19,7 @@ export default function Component({ service }) { if (statsError || statsData?.error || statusError || statusData?.error) { const finalError = statsError ?? statsData?.error ?? statusError ?? statusData?.error; - return ; + return ; } if (statusData && !(statusData.status.includes("running") || statusData.status.includes("partial"))) { diff --git a/src/widgets/downloadstation/component.jsx b/src/widgets/downloadstation/component.jsx index a91d1891c..9e47c5f47 100644 --- a/src/widgets/downloadstation/component.jsx +++ b/src/widgets/downloadstation/component.jsx @@ -10,7 +10,7 @@ export default function Component({ service }) { const { data: listData, error: listError } = useWidgetAPI(widget, "list"); if (listError) { - return ; + return ; } const tasks = listData?.data?.tasks; diff --git a/src/widgets/emby/component.jsx b/src/widgets/emby/component.jsx index 0e0351ea1..a78ad51f2 100644 --- a/src/widgets/emby/component.jsx +++ b/src/widgets/emby/component.jsx @@ -206,7 +206,7 @@ export default function Component({ service }) { } if (sessionsError || countError) { - return ; + return ; } const enableBlocks = service.widget?.enableBlocks diff --git a/src/widgets/fileflows/component.jsx b/src/widgets/fileflows/component.jsx index 274ed76dc..39a7160a4 100755 --- a/src/widgets/fileflows/component.jsx +++ b/src/widgets/fileflows/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: fileflowsData, error: fileflowsError } = useWidgetAPI(widget, "status"); if (fileflowsError) { - return ; + return ; } if (!fileflowsData) { diff --git a/src/widgets/flood/component.jsx b/src/widgets/flood/component.jsx index 57e43943b..3aca12feb 100644 --- a/src/widgets/flood/component.jsx +++ b/src/widgets/flood/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: torrentData, error: torrentError } = useWidgetAPI(widget, "torrents"); if (torrentError || !torrentData?.torrents) { - return ; + return ; } if (!torrentData || !torrentData.torrents) { diff --git a/src/widgets/freshrss/component.jsx b/src/widgets/freshrss/component.jsx index 9381beb1f..788f1f6f3 100644 --- a/src/widgets/freshrss/component.jsx +++ b/src/widgets/freshrss/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: freshrssData, error: freshrssError } = useWidgetAPI(widget, "info"); if (freshrssError) { - return ; + return ; } if (!freshrssData) { diff --git a/src/widgets/ghostfolio/component.jsx b/src/widgets/ghostfolio/component.jsx index 7a56ae0bb..c197c3897 100644 --- a/src/widgets/ghostfolio/component.jsx +++ b/src/widgets/ghostfolio/component.jsx @@ -18,7 +18,7 @@ export default function Component({ service }) { if (ghostfolioErrorToday || ghostfolioErrorYear || ghostfolioErrorMax) { const finalError = ghostfolioErrorToday ?? ghostfolioErrorYear ?? ghostfolioErrorMax - return ; + return ; } if (!performanceToday || !performanceYear || !performanceMax) { diff --git a/src/widgets/gluetun/component.jsx b/src/widgets/gluetun/component.jsx index 59e490ce7..c4ec14fb3 100644 --- a/src/widgets/gluetun/component.jsx +++ b/src/widgets/gluetun/component.jsx @@ -8,7 +8,7 @@ export default function Component({ service }) { const { data: gluetunData, error: gluetunError } = useWidgetAPI(widget, "ip"); if (gluetunError) { - return ; + return ; } if (!gluetunData) { diff --git a/src/widgets/gotify/component.jsx b/src/widgets/gotify/component.jsx index 7cd5c1358..705704118 100644 --- a/src/widgets/gotify/component.jsx +++ b/src/widgets/gotify/component.jsx @@ -11,7 +11,7 @@ export default function Component({ service }) { if (appsError || messagesError || clientsError) { const finalError = appsError ?? messagesError ?? clientsError; - return ; + return ; } diff --git a/src/widgets/grafana/component.jsx b/src/widgets/grafana/component.jsx index 98d4c42be..5c8a7fc58 100755 --- a/src/widgets/grafana/component.jsx +++ b/src/widgets/grafana/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: alertsData, error: alertsError } = useWidgetAPI(widget, "alerts"); if (statsError || alertsError) { - return ; + return ; } if (!statsData || !alertsData) { diff --git a/src/widgets/hdhomerun/component.jsx b/src/widgets/hdhomerun/component.jsx index 79160dc3b..eda138a8b 100644 --- a/src/widgets/hdhomerun/component.jsx +++ b/src/widgets/hdhomerun/component.jsx @@ -8,7 +8,7 @@ export default function Component({ service }) { const { data: channelsData, error: channelsError } = useWidgetAPI(widget, "lineup"); if (channelsError) { - return ; + return ; } if (!channelsData) { diff --git a/src/widgets/healthchecks/component.jsx b/src/widgets/healthchecks/component.jsx index 37e0f853f..27d714c2e 100644 --- a/src/widgets/healthchecks/component.jsx +++ b/src/widgets/healthchecks/component.jsx @@ -30,7 +30,7 @@ export default function Component({ service }) { const { data, error } = useWidgetAPI(widget, "checks"); if (error) { - return ; + return ; } if (!data) { diff --git a/src/widgets/homeassistant/component.jsx b/src/widgets/homeassistant/component.jsx index 48fa61ffe..72e101493 100644 --- a/src/widgets/homeassistant/component.jsx +++ b/src/widgets/homeassistant/component.jsx @@ -7,7 +7,7 @@ export default function Component({ service }) { const { data, error } = useWidgetAPI(widget, null, { refreshInterval: 60000 }); if (error) { - return ; + return ; } return diff --git a/src/widgets/homebridge/component.jsx b/src/widgets/homebridge/component.jsx index c4f1624aa..2be20a361 100644 --- a/src/widgets/homebridge/component.jsx +++ b/src/widgets/homebridge/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: homebridgeData, error: homebridgeError } = useWidgetAPI(widget, "info"); if (homebridgeError) { - return ; + return ; } if (!homebridgeData) { diff --git a/src/widgets/immich/component.jsx b/src/widgets/immich/component.jsx index b90bda8d1..125a67ac0 100644 --- a/src/widgets/immich/component.jsx +++ b/src/widgets/immich/component.jsx @@ -11,7 +11,7 @@ export default function Component({ service }) { const { data: immichData, error: immichError } = useWidgetAPI(widget); if (immichError || immichData?.statusCode === 401) { - return ; + return ; } if (!immichData) { diff --git a/src/widgets/jackett/component.jsx b/src/widgets/jackett/component.jsx index b70cbd954..122e50127 100644 --- a/src/widgets/jackett/component.jsx +++ b/src/widgets/jackett/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: indexersData, error: indexersError } = useWidgetAPI(widget, "indexers"); if (indexersError) { - return ; + return ; } if (!indexersData) { diff --git a/src/widgets/jellyseerr/component.jsx b/src/widgets/jellyseerr/component.jsx index a129909eb..7fb3971ef 100644 --- a/src/widgets/jellyseerr/component.jsx +++ b/src/widgets/jellyseerr/component.jsx @@ -8,7 +8,7 @@ export default function Component({ service }) { const { data: statsData, error: statsError } = useWidgetAPI(widget, "request/count"); if (statsError) { - return ; + return ; } if (!statsData) { diff --git a/src/widgets/komga/component.jsx b/src/widgets/komga/component.jsx index 9d6c406f7..3cf51bd83 100644 --- a/src/widgets/komga/component.jsx +++ b/src/widgets/komga/component.jsx @@ -14,7 +14,7 @@ export default function Component({ service }) { if (libraryError || seriesError || bookError) { const finalError = libraryError ?? seriesError ?? bookError; - return ; + return ; } if (!libraryData || !seriesData || !bookData) { @@ -34,4 +34,4 @@ export default function Component({ service }) { ); -} \ No newline at end of file +} diff --git a/src/widgets/kopia/component.jsx b/src/widgets/kopia/component.jsx index dcc763e6d..46690990b 100755 --- a/src/widgets/kopia/component.jsx +++ b/src/widgets/kopia/component.jsx @@ -38,7 +38,7 @@ export default function Component({ service }) { const { data: statusData, error: statusError } = useWidgetAPI(widget, "status"); if (statusError) { - return ; + return ; } const source = statusData?.sources[0]; @@ -65,4 +65,4 @@ export default function Component({ service }) { {nextTime && } ); -} \ No newline at end of file +} diff --git a/src/widgets/kubernetes/component.jsx b/src/widgets/kubernetes/component.jsx index 1615ebd5a..c4d67553e 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 b612ae32e..a6aa82c7f 100644 --- a/src/widgets/lidarr/component.jsx +++ b/src/widgets/lidarr/component.jsx @@ -15,7 +15,7 @@ export default function Component({ service }) { if (albumsError || wantedError || queueError) { const finalError = albumsError ?? wantedError ?? queueError; - return ; + return ; } if (!albumsData || !wantedData || !queueData) { diff --git a/src/widgets/mastodon/component.jsx b/src/widgets/mastodon/component.jsx index fd4f0ece6..154c9d17b 100644 --- a/src/widgets/mastodon/component.jsx +++ b/src/widgets/mastodon/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: statsData, error: statsError } = useWidgetAPI(widget, "instance"); if (statsError) { - return ; + return ; } if (!statsData) { diff --git a/src/widgets/medusa/component.jsx b/src/widgets/medusa/component.jsx index 47bad7d4d..d7cc3f39c 100644 --- a/src/widgets/medusa/component.jsx +++ b/src/widgets/medusa/component.jsx @@ -13,7 +13,7 @@ export default function Component({ service }) { if (statsError || futureError) { const finalError = statsError ?? futureError; - return ; + return ; } if (!statsData || !futureData) { diff --git a/src/widgets/mikrotik/component.jsx b/src/widgets/mikrotik/component.jsx index 37a8f7064..97c477e3c 100644 --- a/src/widgets/mikrotik/component.jsx +++ b/src/widgets/mikrotik/component.jsx @@ -14,7 +14,7 @@ export default function Component({ service }) { if (statsError || leasesError) { const finalError = statsError ?? leasesError; - return ; + return ; } if (!statsData || !leasesData) { diff --git a/src/widgets/minecraft/component.jsx b/src/widgets/minecraft/component.jsx index 013d7606a..e1f0589bf 100644 --- a/src/widgets/minecraft/component.jsx +++ b/src/widgets/minecraft/component.jsx @@ -10,7 +10,7 @@ export default function Component({ service }) { const { t } = useTranslation(); if(serverError){ - return ; + return ; } if (!serverData) { return ( diff --git a/src/widgets/miniflux/component.jsx b/src/widgets/miniflux/component.jsx index dbfd60483..aa4699ad2 100644 --- a/src/widgets/miniflux/component.jsx +++ b/src/widgets/miniflux/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: minifluxData, error: minifluxError } = useWidgetAPI(widget, "counters"); if (minifluxError) { - return ; + return ; } if (!minifluxData) { diff --git a/src/widgets/moonraker/component.jsx b/src/widgets/moonraker/component.jsx index 81bf8b908..3e788f888 100644 --- a/src/widgets/moonraker/component.jsx +++ b/src/widgets/moonraker/component.jsx @@ -15,7 +15,7 @@ export default function Component({ service }) { if (printStatsError || displayStatsError || webHooksError) { const finalError = printStatsError ?? displayStatsError ?? webHooksError; - return ; + return ; } if (!printStats || !displayStatus || !webHooks) { diff --git a/src/widgets/mylar/component.jsx b/src/widgets/mylar/component.jsx index e284c93fa..c9f401710 100644 --- a/src/widgets/mylar/component.jsx +++ b/src/widgets/mylar/component.jsx @@ -15,7 +15,7 @@ export default function Component({ service }) { if (seriesError || issuesError || wantedError) { const finalError = seriesError ?? issuesError ?? wantedError; - return ; + return ; } if (!seriesData || !issuesData || !wantedData) { @@ -37,4 +37,4 @@ export default function Component({ service }) { ); -} \ No newline at end of file +} diff --git a/src/widgets/navidrome/component.jsx b/src/widgets/navidrome/component.jsx index e45ac6555..8d5ef532b 100644 --- a/src/widgets/navidrome/component.jsx +++ b/src/widgets/navidrome/component.jsx @@ -27,7 +27,7 @@ export default function Component({ service }) { const { data: navidromeData, error: navidromeError } = useWidgetAPI(widget, "getNowPlaying"); if (navidromeError || navidromeData?.["subsonic-response"]?.error) { - return ; + return ; } if (!navidromeData) { diff --git a/src/widgets/nextcloud/component.jsx b/src/widgets/nextcloud/component.jsx index 1dc9fbff6..393e2671c 100755 --- a/src/widgets/nextcloud/component.jsx +++ b/src/widgets/nextcloud/component.jsx @@ -11,7 +11,7 @@ export default function Component({ service }) { const { data: nextcloudData, error: nextcloudError } = useWidgetAPI(widget, "serverinfo"); if (nextcloudError) { - return ; + return ; } if (!nextcloudData) { diff --git a/src/widgets/nextdns/component.jsx b/src/widgets/nextdns/component.jsx index ae2397701..3e90a0b2a 100644 --- a/src/widgets/nextdns/component.jsx +++ b/src/widgets/nextdns/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: nextdnsData, error: nextdnsError } = useWidgetAPI(widget, "analytics/status"); if (nextdnsError) { - return ; + return ; } if (!nextdnsData) { diff --git a/src/widgets/npm/component.jsx b/src/widgets/npm/component.jsx index b6d42ad98..377122664 100644 --- a/src/widgets/npm/component.jsx +++ b/src/widgets/npm/component.jsx @@ -8,7 +8,7 @@ export default function Component({ service }) { const { data: infoData, error: infoError } = useWidgetAPI(widget, "nginx/proxy-hosts"); if (infoError) { - return ; + return ; } if (!infoData) { diff --git a/src/widgets/nzbget/component.jsx b/src/widgets/nzbget/component.jsx index c016d6c5c..25a3ddb6f 100644 --- a/src/widgets/nzbget/component.jsx +++ b/src/widgets/nzbget/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: statusData, error: statusError } = useWidgetAPI(widget, "status"); if (statusError) { - return ; + return ; } if (!statusData) { diff --git a/src/widgets/octoprint/component.jsx b/src/widgets/octoprint/component.jsx index 6935fe596..7d3d5a1d7 100644 --- a/src/widgets/octoprint/component.jsx +++ b/src/widgets/octoprint/component.jsx @@ -9,11 +9,11 @@ export default function Component({ service }) { const { data: jobStats, error: jobStatsError } = useWidgetAPI(widget, "job_stats"); if (printerStatsError) { - return ; + return ; } if (jobStatsError) { - return ; + return ; } const state = printerStats?.state?.text; diff --git a/src/widgets/omada/component.jsx b/src/widgets/omada/component.jsx index 2aa6df7e0..ade36f2bd 100644 --- a/src/widgets/omada/component.jsx +++ b/src/widgets/omada/component.jsx @@ -14,7 +14,7 @@ export default function Component({ service }) { }); if (omadaAPIError) { - return ; + return ; } if (!omadaData) { diff --git a/src/widgets/ombi/component.jsx b/src/widgets/ombi/component.jsx index 722d5c457..0d31081af 100644 --- a/src/widgets/ombi/component.jsx +++ b/src/widgets/ombi/component.jsx @@ -8,7 +8,7 @@ export default function Component({ service }) { const { data: statsData, error: statsError } = useWidgetAPI(widget, "Request/count"); if (statsError) { - return ; + return ; } if (!statsData) { diff --git a/src/widgets/opnsense/component.jsx b/src/widgets/opnsense/component.jsx index 61753b472..b41e0c91e 100644 --- a/src/widgets/opnsense/component.jsx +++ b/src/widgets/opnsense/component.jsx @@ -14,7 +14,7 @@ export default function Component({ service }) { if (activityError || interfaceError) { const finalError = activityError ?? interfaceError; - return ; + return ; } if (!activityData || !interfaceData) { diff --git a/src/widgets/overseerr/component.jsx b/src/widgets/overseerr/component.jsx index dcb5237cc..336bc6fce 100644 --- a/src/widgets/overseerr/component.jsx +++ b/src/widgets/overseerr/component.jsx @@ -11,7 +11,7 @@ export default function Component({ service }) { const { data: statsData, error: statsError } = useWidgetAPI(widget, "request/count"); if (statsError) { - return ; + return ; } if (!statsData) { diff --git a/src/widgets/paperlessngx/component.jsx b/src/widgets/paperlessngx/component.jsx index d0c2e12f3..340db9f07 100644 --- a/src/widgets/paperlessngx/component.jsx +++ b/src/widgets/paperlessngx/component.jsx @@ -8,7 +8,7 @@ export default function Component({ service }) { const { data: statisticsData, error: statisticsError } = useWidgetAPI(widget, "statistics"); if (statisticsError) { - return ; + return ; } if (!statisticsData) { diff --git a/src/widgets/photoprism/component.jsx b/src/widgets/photoprism/component.jsx index ee489d353..e5033eda5 100644 --- a/src/widgets/photoprism/component.jsx +++ b/src/widgets/photoprism/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: photoprismData, error: photoprismError } = useWidgetAPI(widget); if (photoprismError) { - return ; + return ; } if (!photoprismData) { diff --git a/src/widgets/pihole/component.jsx b/src/widgets/pihole/component.jsx index c39250d23..16cfa43f7 100644 --- a/src/widgets/pihole/component.jsx +++ b/src/widgets/pihole/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: piholeData, error: piholeError } = useWidgetAPI(widget, "summaryRaw"); if (piholeError) { - return ; + return ; } if (!piholeData) { diff --git a/src/widgets/plex/component.jsx b/src/widgets/plex/component.jsx index bd01230f0..86ba5503b 100644 --- a/src/widgets/plex/component.jsx +++ b/src/widgets/plex/component.jsx @@ -14,7 +14,7 @@ export default function Component({ service }) { }); if (plexAPIError) { - return ; + return ; } if (!plexData) { diff --git a/src/widgets/portainer/component.jsx b/src/widgets/portainer/component.jsx index ccc26b7f6..aab9eba11 100644 --- a/src/widgets/portainer/component.jsx +++ b/src/widgets/portainer/component.jsx @@ -14,7 +14,7 @@ export default function Component({ service }) { }); if (containersError) { - return ; + return ; } if (!containersData) { @@ -28,7 +28,7 @@ export default function Component({ service }) { } if (containersData.error) { - return ; + return ; } const running = containersData.filter((c) => c.State === "running").length; diff --git a/src/widgets/prometheus/component.jsx b/src/widgets/prometheus/component.jsx index f8cea560c..80e314266 100644 --- a/src/widgets/prometheus/component.jsx +++ b/src/widgets/prometheus/component.jsx @@ -11,7 +11,7 @@ export default function Component({ service }) { const { data: targetsData, error: targetsError } = useWidgetAPI(widget, "targets"); if (targetsError) { - return ; + return ; } if (!targetsData) { diff --git a/src/widgets/prowlarr/component.jsx b/src/widgets/prowlarr/component.jsx index ca658f4ee..6f7211f05 100644 --- a/src/widgets/prowlarr/component.jsx +++ b/src/widgets/prowlarr/component.jsx @@ -11,7 +11,7 @@ export default function Component({ service }) { const { data: grabsData, error: grabsError } = useWidgetAPI(widget, "indexerstats"); if (grabsError) { - return ; + return ; } if (!grabsData) { diff --git a/src/widgets/proxmox/component.jsx b/src/widgets/proxmox/component.jsx index 34fa7ff97..e022be6e8 100644 --- a/src/widgets/proxmox/component.jsx +++ b/src/widgets/proxmox/component.jsx @@ -16,7 +16,7 @@ export default function Component({ service }) { const { data: clusterData, error: clusterError } = useWidgetAPI(widget, "cluster/resources"); if (clusterError) { - return ; + return ; } if (!clusterData || !clusterData.data) { diff --git a/src/widgets/proxmoxbackupserver/component.jsx b/src/widgets/proxmoxbackupserver/component.jsx index 7302390f7..ff4360779 100644 --- a/src/widgets/proxmoxbackupserver/component.jsx +++ b/src/widgets/proxmoxbackupserver/component.jsx @@ -15,7 +15,7 @@ export default function Component({ service }) { if (datastoreError || tasksError || hostError) { const finalError = tasksError ?? datastoreError ?? hostError; - return ; + return ; } if (!datastoreData || !tasksData || !hostData) { diff --git a/src/widgets/pterodactyl/component.jsx b/src/widgets/pterodactyl/component.jsx index 346ce2349..83ace637c 100644 --- a/src/widgets/pterodactyl/component.jsx +++ b/src/widgets/pterodactyl/component.jsx @@ -10,7 +10,7 @@ export default function Component({ service }) { const {data: nodesData, error: nodesError} = useWidgetAPI(widget, "nodes"); if (nodesError) { - return ; + return ; } if (!nodesData) { diff --git a/src/widgets/pyload/component.jsx b/src/widgets/pyload/component.jsx index 8c41148e8..557ad8ec9 100644 --- a/src/widgets/pyload/component.jsx +++ b/src/widgets/pyload/component.jsx @@ -10,7 +10,7 @@ export default function Component({ service }) { const { data: pyloadData, error: pyloadError } = useWidgetAPI(widget, "status"); if (pyloadError) { - return ; + return ; } if (!pyloadData) { diff --git a/src/widgets/qbittorrent/component.jsx b/src/widgets/qbittorrent/component.jsx index d3836a6ba..615709ea6 100644 --- a/src/widgets/qbittorrent/component.jsx +++ b/src/widgets/qbittorrent/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: torrentData, error: torrentError } = useWidgetAPI(widget, "torrents/info"); if (torrentError) { - return ; + return ; } if (!torrentData) { diff --git a/src/widgets/radarr/component.jsx b/src/widgets/radarr/component.jsx index 4d8eeee85..f8a932eaf 100644 --- a/src/widgets/radarr/component.jsx +++ b/src/widgets/radarr/component.jsx @@ -13,7 +13,7 @@ export default function Component({ service }) { if (moviesError || queuedError) { const finalError = moviesError ?? queuedError; - return ; + return ; } if (!moviesData || !queuedData) { diff --git a/src/widgets/readarr/component.jsx b/src/widgets/readarr/component.jsx index 4eee11f4f..bde9715a3 100644 --- a/src/widgets/readarr/component.jsx +++ b/src/widgets/readarr/component.jsx @@ -15,7 +15,7 @@ export default function Component({ service }) { if (booksError || wantedError || queueError) { const finalError = booksError ?? wantedError ?? queueError; - return ; + return ; } if (!booksData || !wantedData || !queueData) { diff --git a/src/widgets/rutorrent/component.jsx b/src/widgets/rutorrent/component.jsx index 300a15bda..e7dc26e79 100644 --- a/src/widgets/rutorrent/component.jsx +++ b/src/widgets/rutorrent/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: statusData, error: statusError } = useWidgetAPI(widget); if (statusError) { - return ; + return ; } if (!statusData) { diff --git a/src/widgets/sabnzbd/component.jsx b/src/widgets/sabnzbd/component.jsx index b0cdb9518..d7fde7346 100644 --- a/src/widgets/sabnzbd/component.jsx +++ b/src/widgets/sabnzbd/component.jsx @@ -22,7 +22,7 @@ export default function Component({ service }) { const { data: queueData, error: queueError } = useWidgetAPI(widget, "queue"); if (queueError) { - return ; + return ; } if (!queueData) { diff --git a/src/widgets/scrutiny/component.jsx b/src/widgets/scrutiny/component.jsx index 0f769d9fd..50cbd3951 100644 --- a/src/widgets/scrutiny/component.jsx +++ b/src/widgets/scrutiny/component.jsx @@ -29,7 +29,7 @@ export default function Component({ service }) { if (scrutinyError || scrutinySettingsError) { const finalError = scrutinyError ?? scrutinySettingsError; - return ; + return ; } if (!scrutinyData || !scrutinySettings) { diff --git a/src/widgets/sonarr/component.jsx b/src/widgets/sonarr/component.jsx index fd6ba9dc2..adbb8c305 100644 --- a/src/widgets/sonarr/component.jsx +++ b/src/widgets/sonarr/component.jsx @@ -14,7 +14,7 @@ export default function Component({ service }) { if (wantedError || queuedError || seriesError) { const finalError = wantedError ?? queuedError ?? seriesError; - return ; + return ; } if (!wantedData || !queuedData || !seriesData) { diff --git a/src/widgets/speedtest/component.jsx b/src/widgets/speedtest/component.jsx index 7d722fafe..58c72ef50 100644 --- a/src/widgets/speedtest/component.jsx +++ b/src/widgets/speedtest/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: speedtestData, error: speedtestError } = useWidgetAPI(widget, "speedtest/latest"); if (speedtestError) { - return ; + return ; } if (!speedtestData) { diff --git a/src/widgets/strelaysrv/component.jsx b/src/widgets/strelaysrv/component.jsx index f58f8830a..ff3039a1b 100644 --- a/src/widgets/strelaysrv/component.jsx +++ b/src/widgets/strelaysrv/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: statsData, error: statsError } = useWidgetAPI(widget, "status"); if (statsError) { - return ; + return ; } if (!statsData) { diff --git a/src/widgets/tautulli/component.jsx b/src/widgets/tautulli/component.jsx index 44b1eb6db..a0328383a 100644 --- a/src/widgets/tautulli/component.jsx +++ b/src/widgets/tautulli/component.jsx @@ -123,7 +123,7 @@ export default function Component({ service }) { }); if (activityError) { - return ; + return ; } if (!activityData) { diff --git a/src/widgets/tdarr/component.jsx b/src/widgets/tdarr/component.jsx index 5e96bf486..7bf67b462 100644 --- a/src/widgets/tdarr/component.jsx +++ b/src/widgets/tdarr/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: tdarrData, error: tdarrError } = useWidgetAPI(widget); if (tdarrError) { - return ; + return ; } if (!tdarrData) { diff --git a/src/widgets/traefik/component.jsx b/src/widgets/traefik/component.jsx index 7739e62a1..42d261e37 100644 --- a/src/widgets/traefik/component.jsx +++ b/src/widgets/traefik/component.jsx @@ -8,7 +8,7 @@ export default function Component({ service }) { const { data: traefikData, error: traefikError } = useWidgetAPI(widget, "overview"); if (traefikError) { - return ; + return ; } if (!traefikData) { diff --git a/src/widgets/transmission/component.jsx b/src/widgets/transmission/component.jsx index 63c3fd98b..98b269a51 100644 --- a/src/widgets/transmission/component.jsx +++ b/src/widgets/transmission/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: torrentData, error: torrentError } = useWidgetAPI(widget); if (torrentError) { - return ; + return ; } if (!torrentData) { diff --git a/src/widgets/truenas/component.jsx b/src/widgets/truenas/component.jsx index 70f917ab4..eb0a0195d 100644 --- a/src/widgets/truenas/component.jsx +++ b/src/widgets/truenas/component.jsx @@ -43,7 +43,7 @@ export default function Component({ service }) { if (alertError || statusError) { const finalError = alertError ?? statusError; - return ; + return ; } if (!alertData || !statusData) { diff --git a/src/widgets/tubearchivist/component.jsx b/src/widgets/tubearchivist/component.jsx index b1b310d77..407919278 100644 --- a/src/widgets/tubearchivist/component.jsx +++ b/src/widgets/tubearchivist/component.jsx @@ -16,7 +16,7 @@ export default function Component({ service }) { if (downloadsError || videosError || channelsError || playlistsError) { const finalError = downloadsError ?? videosError ?? channelsError ?? playlistsError; - return ; + return ; } if (!downloadsData || !videosData || !channelsData || !playlistsData) { diff --git a/src/widgets/unifi/component.jsx b/src/widgets/unifi/component.jsx index ff3185169..54856f318 100644 --- a/src/widgets/unifi/component.jsx +++ b/src/widgets/unifi/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: statsData, error: statsError } = useWidgetAPI(widget, "stat/sites"); if (statsError) { - return ; + return ; } const defaultSite = widget.site ? statsData?.data.find(s => s.desc === widget.site) : statsData?.data?.find(s => s.name === "default"); diff --git a/src/widgets/unmanic/component.jsx b/src/widgets/unmanic/component.jsx index 1d68e7650..03447068e 100644 --- a/src/widgets/unmanic/component.jsx +++ b/src/widgets/unmanic/component.jsx @@ -10,7 +10,7 @@ export default function Component({ service }) { if (workersError || pendingError) { const finalError = workersError ?? pendingError; - return ; + return ; } if (!workersData || !pendingData) { diff --git a/src/widgets/uptimekuma/component.jsx b/src/widgets/uptimekuma/component.jsx index d71f9a63a..ee43f07fe 100644 --- a/src/widgets/uptimekuma/component.jsx +++ b/src/widgets/uptimekuma/component.jsx @@ -13,7 +13,7 @@ export default function Component({ service }) { const { data: heartbeatData, error: heartbeatError } = useWidgetAPI(widget, "heartbeat"); if (statusError || heartbeatError) { - return ; + return ; } if (!statusData || !heartbeatData) { diff --git a/src/widgets/watchtower/component.jsx b/src/widgets/watchtower/component.jsx index 3550e3f43..dc004533f 100644 --- a/src/widgets/watchtower/component.jsx +++ b/src/widgets/watchtower/component.jsx @@ -13,7 +13,7 @@ export default function Component({ service }) { const { data: watchData, error: watchError } = useWidgetAPI(widget, "watchtower"); if (watchError) { - return ; + return ; } if (!watchData) { diff --git a/src/widgets/whatsupdocker/component.jsx b/src/widgets/whatsupdocker/component.jsx index 26b38dee6..096bc8d4d 100644 --- a/src/widgets/whatsupdocker/component.jsx +++ b/src/widgets/whatsupdocker/component.jsx @@ -8,7 +8,7 @@ export default function Component({ service }) { const { data: containersData, error: containersError } = useWidgetAPI(widget, "containers"); if (containersError) { - return ; + return ; } if (!containersData) { diff --git a/src/widgets/xteve/component.jsx b/src/widgets/xteve/component.jsx index 9d22e8a18..75629909a 100644 --- a/src/widgets/xteve/component.jsx +++ b/src/widgets/xteve/component.jsx @@ -12,7 +12,7 @@ export default function Component({ service }) { const { data: xteveData, error: xteveError } = useWidgetAPI(widget, "api"); if (xteveError) { - return ; + return ; } if (!xteveData) {