diff --git a/public/locales/de/common.json b/public/locales/de/common.json index b43389f68a7b63134ab0f2cd30a5f75a5f605e92..a78403ce628bd6e8988c0a7040949a5d1c00cf8c 100644 --- a/public/locales/de/common.json +++ b/public/locales/de/common.json @@ -109,5 +109,10 @@ }, "coinmarketcap": { "configure": "Configure one or more crypto currencies to track" + }, + "gotify": { + "apps": "Applications", + "clients": "Clients", + "messages": "Messages" } } diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 938fe810a261978c12f3f8c4f6651ab8e3c3c076..7c60dbe13917a7446e49bafc6068bc6662423b6f 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -120,5 +120,10 @@ }, "coinmarketcap": { "configure": "Configure one or more crypto currencies to track" + }, + "gotify": { + "apps": "Applications", + "clients": "Clients", + "messages": "Messages" } } diff --git a/public/locales/es/common.json b/public/locales/es/common.json index 98f04c84a4b3bd788d0e589c1c957802d5d80975..ffb824ec22ffc2c54fdf220538ea95ac64f971be 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -109,5 +109,10 @@ }, "coinmarketcap": { "configure": "Configure one or more crypto currencies to track" + }, + "gotify": { + "apps": "Applications", + "clients": "Clients", + "messages": "Messages" } } diff --git a/public/locales/fr/common.json b/public/locales/fr/common.json index d1c86c7276ad859c8e6f3593f71f730c554201bd..3df79e172380d04bb5b4726c1f8265b45589c668 100644 --- a/public/locales/fr/common.json +++ b/public/locales/fr/common.json @@ -120,5 +120,10 @@ }, "coinmarketcap": { "configure": "Configure one or more crypto currencies to track" + }, + "gotify": { + "apps": "Applications", + "clients": "Clients", + "messages": "Messages" } } diff --git a/public/locales/it/common.json b/public/locales/it/common.json index 6b284a0ca307e5aa4e06ff853f593d9ddc480e32..fe00a626d0f3c4b0b7990f310e43d48717d67422 100644 --- a/public/locales/it/common.json +++ b/public/locales/it/common.json @@ -109,5 +109,10 @@ }, "coinmarketcap": { "configure": "Configure one or more crypto currencies to track" + }, + "gotify": { + "apps": "Applications", + "clients": "Clients", + "messages": "Messages" } } diff --git a/public/locales/nb-NO/common.json b/public/locales/nb-NO/common.json index 86c80f9c949a10c9b408f75527e9fa4b87bc538b..98e08cb4572c22260fc05e7621eae49b133723b7 100644 --- a/public/locales/nb-NO/common.json +++ b/public/locales/nb-NO/common.json @@ -109,5 +109,10 @@ }, "coinmarketcap": { "configure": "Configure one or more crypto currencies to track" + }, + "gotify": { + "apps": "Applications", + "clients": "Clients", + "messages": "Messages" } } diff --git a/public/locales/nl/common.json b/public/locales/nl/common.json index 20c4b8a8c104efd25faa210d0ec6a3ecb3927684..ac5d6a991d85851dd8eeb20a5dcb29cb0572ab58 100644 --- a/public/locales/nl/common.json +++ b/public/locales/nl/common.json @@ -109,5 +109,10 @@ }, "coinmarketcap": { "configure": "Configure one or more crypto currencies to track" + }, + "gotify": { + "apps": "Applications", + "clients": "Clients", + "messages": "Messages" } } diff --git a/public/locales/pt/common.json b/public/locales/pt/common.json index 6564d2d0bf2013eecc98b7549dde6e61d2fdf965..33e47880607b7d68ae8087796c2a34c8808792d8 100644 --- a/public/locales/pt/common.json +++ b/public/locales/pt/common.json @@ -120,5 +120,10 @@ }, "coinmarketcap": { "configure": "Configure one or more crypto currencies to track" + }, + "gotify": { + "apps": "Applications", + "clients": "Clients", + "messages": "Messages" } } diff --git a/public/locales/ru/common.json b/public/locales/ru/common.json index 17934885a1595a0b546adb2be0357ca72cc6da83..a7197e8e77fc25256b51defe57cfbc6dec0d899e 100644 --- a/public/locales/ru/common.json +++ b/public/locales/ru/common.json @@ -109,5 +109,10 @@ }, "coinmarketcap": { "configure": "Configure one or more crypto currencies to track" + }, + "gotify": { + "apps": "Applications", + "clients": "Clients", + "messages": "Messages" } } diff --git a/public/locales/vi/common.json b/public/locales/vi/common.json index f84d1602399a372f7ecdbdbc761ae4c2016a5b5e..fb07ee71590aec4f2392aebdfc61311226475c5e 100644 --- a/public/locales/vi/common.json +++ b/public/locales/vi/common.json @@ -109,5 +109,10 @@ }, "coinmarketcap": { "configure": "Configure one or more crypto currencies to track" + }, + "gotify": { + "apps": "Applications", + "clients": "Clients", + "messages": "Messages" } } diff --git a/public/locales/zh-CN/common.json b/public/locales/zh-CN/common.json index 7f57f488405fbec47a8c2b744c90c666f0a5a062..bf19bdb636bce6fc13dfff03f21d73154cb60c34 100644 --- a/public/locales/zh-CN/common.json +++ b/public/locales/zh-CN/common.json @@ -109,5 +109,10 @@ }, "coinmarketcap": { "configure": "Configure one or more crypto currencies to track" + }, + "gotify": { + "apps": "Aplicações", + "clients": "Clientes", + "messages": "Mensagens" } } diff --git a/src/components/services/widget.jsx b/src/components/services/widget.jsx index 361b24840d42228a85b09b792e3b7a428ce0b41d..2bebe84afe9ee12638d16892178d04351874dc4e 100644 --- a/src/components/services/widget.jsx +++ b/src/components/services/widget.jsx @@ -19,6 +19,7 @@ import Overseerr from "./widgets/service/overseerr"; import Npm from "./widgets/service/npm"; import Tautulli from "./widgets/service/tautulli"; import CoinMarketCap from "./widgets/service/coinmarketcap"; +import Gotify from "./widgets/service/gotify"; const widgetMappings = { docker: Docker, @@ -30,7 +31,6 @@ const widgetMappings = { emby: Emby, jellyfin: Jellyfin, nzbget: Nzbget, - sabnzbd: SABnzbd, pihole: Pihole, rutorrent: Rutorrent, speedtest: Speedtest, @@ -40,6 +40,8 @@ const widgetMappings = { coinmarketcap: CoinMarketCap, npm: Npm, tautulli: Tautulli, + gotify: Gotify, + sabnzbd: SABnzbd }; export default function Widget({ service }) { diff --git a/src/components/services/widgets/service/gotify.jsx b/src/components/services/widgets/service/gotify.jsx new file mode 100644 index 0000000000000000000000000000000000000000..578d31cfb273d102fd1a9c09ccb8e668f61fcbb2 --- /dev/null +++ b/src/components/services/widgets/service/gotify.jsx @@ -0,0 +1,29 @@ +import useSWR from "swr"; +import { useTranslation } from "react-i18next"; + +import Widget from "../widget"; +import Block from "../block"; + +import { formatApiUrl } from "utils/api-helpers"; + +export default function Gotify({ service }) { + const { t } = useTranslation(); + + const config = service.widget; + + const { data: appsData, error: appsError } = useSWR(formatApiUrl(config, `application`)); + const { data: messagesData, error: messagesError } = useSWR(formatApiUrl(config, `message`)); + const { data: clientsData, error: clientsError } = useSWR(formatApiUrl(config, `client`)); + + if (appsError || messagesError || clientsError) { + return ; + } + + return ( + + + + + + ); +} diff --git a/src/pages/api/services/proxy.js b/src/pages/api/services/proxy.js index fbc053daa2dc6e12b317c5ac477e677c3c184bb7..0a444029351c58e8cc8e0c2a37da3f9469c7b334 100644 --- a/src/pages/api/services/proxy.js +++ b/src/pages/api/services/proxy.js @@ -17,6 +17,7 @@ const serviceProxyHandlers = { traefik: genericProxyHandler, sabnzbd: genericProxyHandler, // uses X-API-Key (or similar) header auth + gotify: credentialedProxyHandler, portainer: credentialedProxyHandler, jellyseerr: credentialedProxyHandler, overseerr: credentialedProxyHandler, diff --git a/src/utils/api-helpers.js b/src/utils/api-helpers.js index 58147d2461898c057b383e14c6b29b86f22d587a..56aea0791ba7d7516967e01fb4d5deb8a83f98c8 100644 --- a/src/utils/api-helpers.js +++ b/src/utils/api-helpers.js @@ -16,6 +16,7 @@ const formats = { readarr: `{url}/api/v1/{endpoint}?apikey={key}`, sabnzbd: `{url}/api/?apikey={key}&output=json&mode={endpoint}`, coinmarketcap: `{url}/{endpoint}`, + gotify: `{url}/{endpoint}`, }; export function formatApiCall(api, args) { diff --git a/src/utils/proxies/credentialed.js b/src/utils/proxies/credentialed.js index 70df64726d1f7edead84982f1c06fa0fbcea2203..79a94bebdf7e7fcc55179f02ba66454eb7147660 100644 --- a/src/utils/proxies/credentialed.js +++ b/src/utils/proxies/credentialed.js @@ -17,6 +17,9 @@ export default async function credentialedProxyHandler(req, res) { if (widget.type === "coinmarketcap") { headers["X-CMC_PRO_API_KEY"] = `${widget.key}`; + } + if(widget.type === "gotify"){ + headers["X-gotify-Key"] = `${widget.key}`; } else { headers["X-API-Key"] = `${widget.key}`; }