Compare commits

..

68 Commits

Author SHA1 Message Date
Ben Phelps
8a226ca473 Merge pull request #198 from JazzFisch/fix-incorrect-widget-values
Fix issues with incorrect values in widgets
2022-09-17 19:21:26 +03:00
Jason Fischer
33e6d54fd2 Fix issues with incorrect values in widgets
associated: #180
associated: #194
2022-09-17 09:17:03 -07:00
Ben Phelps
d36f37a4ed remove as it’s causing troubles 2022-09-17 17:23:45 +03:00
Ben Phelps
f3ebbb6547 pass errors 2022-09-17 16:55:18 +03:00
Ben Phelps
28b2f79e5b use aggregate mapped data
to reduce the size of the API responses
2022-09-17 13:05:44 +03:00
Anonymous
9a77115a30 Translated using Weblate (Hungarian)
Currently translated at 100.0% (0 of 0 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/hu/
2022-09-17 09:25:24 +02:00
Daniel Varga
2d899e364d Added translation using Weblate (Hungarian) 2022-09-17 09:25:17 +02:00
Anonymous
32b881891c Translated using Weblate (Croatian)
Currently translated at 8.3% (9 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/hr/
2022-09-17 09:06:55 +02:00
Anonymous
9eefc07c7c Translated using Weblate (Swedish)
Currently translated at 88.8% (96 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/sv/
2022-09-17 09:06:55 +02:00
Anonymous
792accffb6 Translated using Weblate (Polish)
Currently translated at 82.4% (89 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/pl/
2022-09-17 09:06:54 +02:00
Anonymous
03af88aba5 Translated using Weblate (Catalan)
Currently translated at 92.5% (100 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ca/
2022-09-17 09:06:54 +02:00
Anonymous
f56b6b4ad0 Translated using Weblate (Chinese (Traditional))
Currently translated at 8.3% (9 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/zh_Hant/
2022-09-17 09:06:54 +02:00
Anonymous
4ce1681e79 Translated using Weblate (Dutch)
Currently translated at 57.4% (62 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/nl/
2022-09-17 09:06:54 +02:00
Anonymous
7570fa71f0 Translated using Weblate (Vietnamese)
Currently translated at 40.7% (44 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/vi/
2022-09-17 09:06:53 +02:00
Anonymous
8a61c76cd9 Translated using Weblate (Norwegian Bokmål)
Currently translated at 73.1% (79 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/nb_NO/
2022-09-17 09:06:53 +02:00
Anonymous
fbf5381699 Translated using Weblate (Italian)
Currently translated at 63.8% (69 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/it/
2022-09-17 09:06:53 +02:00
Anonymous
ff77f0db4f Translated using Weblate (Chinese (Simplified))
Currently translated at 76.8% (83 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/zh_Hans/
2022-09-17 09:06:52 +02:00
Anonymous
2e30abedc9 Translated using Weblate (Russian)
Currently translated at 19.4% (21 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ru/
2022-09-17 09:06:52 +02:00
Anonymous
c4cb4f7475 Translated using Weblate (Portuguese)
Currently translated at 81.4% (88 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/pt/
2022-09-17 09:06:52 +02:00
Anonymous
7432bb813e Translated using Weblate (French)
Currently translated at 96.2% (104 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/fr/
2022-09-17 09:06:52 +02:00
Anonymous
572a104779 Translated using Weblate (Spanish)
Currently translated at 96.2% (104 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/es/
2022-09-17 09:06:51 +02:00
Anonymous
f77dc23d92 Translated using Weblate (German)
Currently translated at 59.2% (64 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/de/
2022-09-17 09:06:51 +02:00
nicedc
e92fc74dd3 Translated using Weblate (Chinese (Simplified))
Currently translated at 79.8% (83 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/zh_Hans/
2022-09-17 09:06:42 +02:00
Nonoss117
9479c3d5c3 Translated using Weblate (French)
Currently translated at 100.0% (104 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/fr/
2022-09-17 09:06:42 +02:00
Ángel Fernández Sánchez
cfc37a64e1 Translated using Weblate (Spanish)
Currently translated at 100.0% (104 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/es/
2022-09-17 09:06:42 +02:00
Ben Phelps
2d5294804c Merge pull request #192 from JazzFisch/add-qbittorrent
Add qBittorrent Widget
2022-09-17 10:06:38 +03:00
Jason Fischer
6c01a85077 Merge branch 'main' into add-qbittorrent 2022-09-16 23:19:24 -07:00
Ben Phelps
cf41e988eb fix error with no map 2022-09-17 08:38:53 +03:00
Ben Phelps
d7a161c088 remove map for now 2022-09-17 08:34:32 +03:00
Ben Phelps
379c4040fe Merge branch 'JazzFisch-proxy-with-mapping' 2022-09-17 08:32:48 +03:00
Ben Phelps
3f17618ad5 allow endpoint specific maps 2022-09-17 08:32:40 +03:00
Andy
d7be64c3d9 add backgroundOpacity option 2022-09-17 08:24:12 +03:00
Juan Manuel Bennàssar Carretero
ef7737e9be Translated using Weblate (Spanish)
Currently translated at 100.0% (104 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/es/
2022-09-17 08:24:12 +03:00
Ben Phelps
51ad3184b6 Merge pull request #183 from andrii-kryvoviaz/add-background-image-opacity
Add backgroundOpacity option
2022-09-17 07:33:35 +03:00
Jason Fischer
efc8fd878a Merge branch 'main' into add-qbittorrent 2022-09-16 19:12:41 -07:00
Jason Fischer
6da1e98c83 Add qBittorrent Widget
- extract cookie jar functionality into its own file
- use i18n for more strings in existing widgets

completes: #152
associated: #123
2022-09-16 19:11:57 -07:00
Juan Manuel Bennàssar Carretero
513a06740c Translated using Weblate (Spanish)
Currently translated at 100.0% (104 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/es/
2022-09-16 21:23:35 +02:00
Jason Fischer
743a070724 Proposal to add ability to map data in a proxy 2022-09-16 11:33:11 -07:00
Andy
5fb0e76669 add backgroundOpacity option 2022-09-16 15:31:13 +03:00
Anonymous
bedeab686e Translated using Weblate (Croatian)
Currently translated at 100.0% (0 of 0 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/hr/
2022-09-16 14:31:03 +02:00
Nonoss117
9d9fa352ce Translated using Weblate (French)
Currently translated at 100.0% (104 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/fr/
2022-09-16 14:31:02 +02:00
sheep
1bfa6ce862 Added translation using Weblate (Croatian) 2022-09-16 14:30:39 +02:00
Ben Phelps
755b29c859 update readme 2022-09-16 14:18:27 +03:00
Anonymous
aab5b0247a Translated using Weblate (Swedish)
Currently translated at 92.3% (96 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/sv/
2022-09-16 13:06:38 +02:00
Anonymous
d7e4b0bd17 Translated using Weblate (Polish)
Currently translated at 85.5% (89 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/pl/
2022-09-16 13:06:38 +02:00
Anonymous
3bacdadb80 Translated using Weblate (Catalan)
Currently translated at 96.1% (100 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ca/
2022-09-16 13:06:38 +02:00
Anonymous
1d75ee44ed Translated using Weblate (Chinese (Traditional))
Currently translated at 8.6% (9 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/zh_Hant/
2022-09-16 13:06:37 +02:00
Anonymous
230cc343af Translated using Weblate (Dutch)
Currently translated at 59.6% (62 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/nl/
2022-09-16 13:06:37 +02:00
Anonymous
b318ee165c Translated using Weblate (Vietnamese)
Currently translated at 42.3% (44 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/vi/
2022-09-16 13:06:37 +02:00
Anonymous
f677646365 Translated using Weblate (Norwegian Bokmål)
Currently translated at 75.9% (79 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/nb_NO/
2022-09-16 13:06:36 +02:00
Anonymous
8db7d820d7 Translated using Weblate (Italian)
Currently translated at 66.3% (69 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/it/
2022-09-16 13:06:36 +02:00
Anonymous
adb0632566 Translated using Weblate (Chinese (Simplified))
Currently translated at 79.8% (83 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/zh_Hans/
2022-09-16 13:06:36 +02:00
Anonymous
4d5c8db333 Translated using Weblate (Russian)
Currently translated at 20.1% (21 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ru/
2022-09-16 13:06:35 +02:00
Anonymous
01d6a3d5f8 Translated using Weblate (Portuguese)
Currently translated at 84.6% (88 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/pt/
2022-09-16 13:06:35 +02:00
Anonymous
fbeadbc32f Translated using Weblate (French)
Currently translated at 96.1% (100 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/fr/
2022-09-16 13:06:35 +02:00
Anonymous
1289be888f Translated using Weblate (Spanish)
Currently translated at 96.1% (100 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/es/
2022-09-16 13:06:35 +02:00
Anonymous
aa7e3a955c Translated using Weblate (German)
Currently translated at 61.5% (64 of 104 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/de/
2022-09-16 13:06:34 +02:00
SuperDOS
2823f3b921 Translated using Weblate (Swedish)
Currently translated at 96.0% (96 of 100 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/sv/
2022-09-16 13:06:26 +02:00
Ben Phelps
ddb2a74540 add AdGuard widget 2022-09-16 14:05:56 +03:00
Ben Phelps
37d8d7a2f8 fix indentation 2022-09-16 14:05:43 +03:00
Ben Phelps
578b715a1f allow HTTP basic auth on generic proxy 2022-09-16 14:05:27 +03:00
Anonymous
f14a811ce9 Translated using Weblate (Swedish)
Currently translated at 100.0% (0 of 0 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/sv/
2022-09-16 11:02:49 +02:00
SuperDOS
06dd6d2213 Added translation using Weblate (Swedish) 2022-09-16 11:02:42 +02:00
Pacux
72471c47f4 Translated using Weblate (Catalan)
Currently translated at 100.0% (100 of 100 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ca/
2022-09-16 10:56:30 +02:00
Nonoss117
aec5f7173c Translated using Weblate (French)
Currently translated at 100.0% (100 of 100 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/fr/
2022-09-16 10:56:29 +02:00
Ángel Fernández Sánchez
f7b68789ac Translated using Weblate (Spanish)
Currently translated at 100.0% (100 of 100 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/es/
2022-09-16 10:56:29 +02:00
Ángel Fernández Sánchez
0672da621e Translated using Weblate (Spanish)
Currently translated at 100.0% (100 of 100 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/es/
2022-09-16 10:40:37 +02:00
Juan Manuel Bennàssar Carretero
a7f9b78533 Translated using Weblate (Spanish)
Currently translated at 100.0% (100 of 100 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/es/
2022-09-16 10:40:36 +02:00
38 changed files with 1037 additions and 96 deletions

19
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,19 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug full stack",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/next",
"serverReadyAction": {
"pattern": "started server on .+, url: (https?://.+)",
"uriFormat": "%s",
"action": "debugWithChrome"
}
}
]
}

View File

@@ -9,7 +9,7 @@
- Images built for AMD64 (x86_64), ARM64, ARMv7 and ARMv6
- Supports all Raspberry Pi's, most SBCs & Apple Silicon
- Full i18n support with automatic language detection
- Translations for Chinese, Dutch, French, German, Norwegian Bokmål, Polish, Portuguese, Russian and Spanish
- Translations for Chinese, Dutch, French, German, Norwegian Bokmål, Polish, Portuguese, Russian, Spanish and Swedish
- Want to help translate? [Join the Weblate project](https://hosted.weblate.org/engage/homepage/)
- Service & Web Bookmarks
- Docker Integration
@@ -18,7 +18,7 @@
- Service Integration
- Sonarr, Radarr, Readarr, Prowlarr, Bazarr, Lidarr, Emby, Jellyfin, Tautulli (Plex)
- Ombi, Overseerr, Jellyseerr, Jackett, NZBGet, SABnzbd, ruTorrent, Transmission
- Portainer, Traefik, Speedtest Tracker, PiHole, Nginx Proxy Manager, Gotify
- Portainer, Traefik, Speedtest Tracker, PiHole, AdGuard Home, Nginx Proxy Manager, Gotify
- Information Providers
- Coin Market Cap
- Information & Utility Widgets
@@ -50,11 +50,10 @@ services:
homepage:
image: ghcr.io/benphelps/homepage:latest
container_name: homepage
user: 1000:1000 # Optional, change to your user and group IDs for permissions
ports:
- 3000:3000
volumes:
- /path/to/config:/app/config # Make sure your local config directory is exists
- /path/to/config:/app/config # Make sure your local config directory exists
- /var/run/docker.sock:/var/run/docker.sock # (optional) For docker integrations
```
@@ -129,10 +128,13 @@ Huge thanks to the all the contributors who have helped make this project what i
- [ItsJustMeChris](https://github.com/benphelps/homepage/commits?author=ItsJustMeChris) - Coin Market Cap Widget
- [jackblk](https://github.com/benphelps/homepage/commits?author=jackblk) - Vietnamese Translation
- [JazzFisch](https://github.com/benphelps/homepage/commits?author=JazzFisch) - Readarr, Bazarr, Lidarr, SABnzbd & Transmission Integrations
- [juanmanuelbc](https://github.com/benphelps/homepage/commits?author=juanmanuelbc) - Spanish and Catalan Translations
- [modem7](https://github.com/benphelps/homepage/commits?author=modem7) - Impvoed Docker Image
- [nicedc](https://github.com/benphelps/homepage/commits?author=nicedc) - Chinese Translation
- [Nonoss117](https://github.com/benphelps/homepage/commits?author=Nonoss117) - French Translation
- [pacoculebras](https://github.com/benphelps/homepage/commits?author=pacoculebras) - Catalan Translation
- [psychodracon](https://github.com/benphelps/homepage/commits?author=psychodracon) - Polish Translation
- [quod](https://github.com/benphelps/homepage/commits?author=quod) - Fixed Typos
- [schklom](https://github.com/benphelps/homepage/commits?author=schklom) - ARM64, ARMv7 and ARMv6
- [SuperDOS](https://github.com/benphelps/homepage/commits?author=SuperDOS) - Swedish Translation
- [xicopitz](https://github.com/benphelps/homepage/commits?author=xicopitz) - Gotify & Prowlarr Integration

View File

@@ -134,16 +134,28 @@
"numberOfFailQueries": "Consultes fallides"
},
"jackett": {
"configured": "Configured",
"errored": "Errored"
"configured": "Configurat",
"errored": "Amb errors"
},
"bazarr": {
"missingEpisodes": "Missing Episodes",
"missingMovies": "Missing Movies"
"missingEpisodes": "Episodis que falten",
"missingMovies": "Pel·lícules que falten"
},
"lidarr": {
"wanted": "Wanted",
"queued": "Queued",
"albums": "Albums"
"wanted": "Volgut",
"queued": "En cua",
"albums": "Àlbums"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
}
}

View File

@@ -145,5 +145,17 @@
"wanted": "Wanted",
"queued": "Queued",
"albums": "Albums"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
}
}

View File

@@ -70,6 +70,12 @@
"leech": "Leech",
"seed": "Seed"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
},
"sonarr": {
"wanted": "Wanted",
"queued": "Queued",
@@ -108,12 +114,18 @@
"pending": "Pending",
"approved": "Approved",
"available": "Available"
},
},
"pihole": {
"queries": "Queries",
"blocked": "Blocked",
"gravity": "Gravity"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
},
"speedtest": {
"upload": "Upload",
"download": "Download",

View File

@@ -14,10 +14,10 @@
"load": "Carga"
},
"docker": {
"rx": "RX",
"tx": "TX",
"mem": "MEM",
"cpu": "CPU",
"rx": "Recibido",
"tx": "Transmitido",
"mem": "Memoria",
"cpu": "Procesador",
"offline": "Desconectado"
},
"emby": {
@@ -34,22 +34,22 @@
},
"rutorrent": {
"active": "Activo",
"upload": "Carga",
"upload": "Subida",
"download": "Descarga"
},
"sonarr": {
"wanted": "Querido",
"wanted": "Más deseado",
"queued": "En cola",
"series": "Series"
},
"radarr": {
"wanted": "Querido",
"wanted": "Más deseado",
"queued": "En cola",
"movies": "Películas"
},
"readarr": {
"wanted": "Más deseado",
"queued": "Puesto en cola",
"queued": "En cola",
"books": "Libros"
},
"ombi": {
@@ -68,7 +68,7 @@
"gravity": "Gravedad"
},
"speedtest": {
"upload": "Subir",
"upload": "Subida",
"download": "Descarga",
"ping": "Ping"
},
@@ -100,7 +100,7 @@
},
"sabnzbd": {
"rate": "Tasa",
"queue": "Cola",
"queue": "En cola",
"timeleft": "Tiempo restante"
},
"nzbget": {
@@ -109,11 +109,11 @@
"downloaded": "Descargado"
},
"coinmarketcap": {
"configure": "Configurar una o varias criptomonedas para su seguimiento",
"configure": "Configurar una o s criptomonedas para rastrear",
"1hour": "1 Hora",
"1day": "1 Día",
"7days": "7 Dias",
"30days": "30 Dias"
"7days": "7 Días",
"30days": "30 Días"
},
"gotify": {
"apps": "Aplicaciones",
@@ -124,26 +124,38 @@
"enableIndexers": "Indexadores",
"numberOfGrabs": "Capturas",
"numberOfQueries": "Consultas",
"numberOfFailGrabs": "Capturas Fallidas",
"numberOfFailQueries": "Consultas Fallidas"
"numberOfFailGrabs": "Capturas fallidas",
"numberOfFailQueries": "Consultas fallidas"
},
"transmission": {
"download": "Descarga",
"upload": "Carga",
"upload": "Subida",
"leech": "Compañeros",
"seed": "Semillas"
},
"jackett": {
"configured": "Configurado",
"errored": "Errores"
"errored": "Con errores"
},
"bazarr": {
"missingEpisodes": "Episodios perdidos",
"missingMovies": "Películas perdidas"
},
"lidarr": {
"queued": "Puesto en cola",
"queued": "En cola",
"wanted": "Más deseado",
"albums": "Álbumes"
},
"adguard": {
"queries": "Consultas",
"blocked": "Bloqueado",
"filtered": "Filtrado",
"latency": "Latencia"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
}
}

View File

@@ -106,7 +106,7 @@
},
"overseerr": {
"pending": "En attente",
"approved": "Validé",
"approved": "Demande",
"available": "Disponible"
},
"sabnzbd": {
@@ -127,9 +127,9 @@
"30days": "30 Jours"
},
"gotify": {
"apps": "Applications",
"apps": "Applis",
"clients": "Clients",
"messages": "Messages"
"messages": "Msg"
},
"prowlarr": {
"enableIndexers": "Indexeurs",
@@ -156,5 +156,17 @@
"wanted": "Demandé",
"queued": "En queue",
"albums": "Albums"
},
"adguard": {
"queries": "Requêtes",
"blocked": "Bloquées",
"filtered": "Filtrées",
"latency": "Latence"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
}
}

View File

@@ -0,0 +1,161 @@
{
"weather": {
"current": "Current Location",
"allow": "Click to allow",
"updating": "Updating",
"wait": "Please wait"
},
"search": {
"placeholder": "Search…"
},
"resources": {
"total": "Total",
"free": "Free",
"used": "Used",
"load": "Load"
},
"sabnzbd": {
"rate": "Rate",
"queue": "Queue",
"timeleft": "Time Left"
},
"overseerr": {
"available": "Available",
"pending": "Pending",
"approved": "Approved"
},
"pihole": {
"queries": "Queries",
"blocked": "Blocked",
"gravity": "Gravity"
},
"adguard": {
"latency": "Latency",
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered"
},
"npm": {
"total": "Total",
"enabled": "Enabled",
"disabled": "Disabled"
},
"coinmarketcap": {
"configure": "Configure one or more crypto currencies to track",
"1hour": "1 Hour",
"1day": "1 Day",
"7days": "7 Days",
"30days": "30 Days"
},
"prowlarr": {
"enableIndexers": "Indexers",
"numberOfGrabs": "Grabs",
"numberOfQueries": "Queries",
"numberOfFailGrabs": "Fail Grabs",
"numberOfFailQueries": "Fail Queries"
},
"widget": {
"missing_type": "Missing Widget Type: {{type}}",
"api_error": "API Error",
"status": "Status"
},
"docker": {
"rx": "RX",
"tx": "TX",
"mem": "MEM",
"cpu": "CPU",
"offline": "Offline"
},
"emby": {
"playing": "Playing",
"transcoding": "Transcoding",
"bitrate": "Bitrate",
"no_active": "No Active Streams"
},
"tautulli": {
"playing": "Playing",
"transcoding": "Transcoding",
"bitrate": "Bitrate",
"no_active": "No Active Streams"
},
"nzbget": {
"rate": "Rate",
"remaining": "Remaining",
"downloaded": "Downloaded"
},
"rutorrent": {
"upload": "Upload",
"download": "Download",
"active": "Active"
},
"transmission": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
},
"sonarr": {
"wanted": "Wanted",
"queued": "Queued",
"series": "Series"
},
"radarr": {
"wanted": "Wanted",
"queued": "Queued",
"movies": "Movies"
},
"lidarr": {
"wanted": "Wanted",
"queued": "Queued",
"albums": "Albums"
},
"readarr": {
"wanted": "Wanted",
"queued": "Queued",
"books": "Books"
},
"bazarr": {
"missingEpisodes": "Missing Episodes",
"missingMovies": "Missing Movies"
},
"ombi": {
"pending": "Pending",
"approved": "Approved",
"available": "Available"
},
"jellyseerr": {
"pending": "Pending",
"approved": "Approved",
"available": "Available"
},
"speedtest": {
"upload": "Upload",
"download": "Download",
"ping": "Ping"
},
"portainer": {
"running": "Running",
"stopped": "Stopped",
"total": "Total"
},
"traefik": {
"routers": "Routers",
"services": "Services",
"middleware": "Middleware"
},
"gotify": {
"clients": "Clients",
"messages": "Messages",
"apps": "Applications"
},
"jackett": {
"configured": "Configured",
"errored": "Errored"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
}
}

View File

@@ -0,0 +1,161 @@
{
"resources": {
"total": "Total",
"free": "Free",
"used": "Used",
"load": "Load"
},
"docker": {
"rx": "RX",
"tx": "TX",
"mem": "MEM",
"cpu": "CPU",
"offline": "Offline"
},
"lidarr": {
"albums": "Albums",
"wanted": "Wanted",
"queued": "Queued"
},
"readarr": {
"wanted": "Wanted",
"queued": "Queued",
"books": "Books"
},
"bazarr": {
"missingEpisodes": "Missing Episodes",
"missingMovies": "Missing Movies"
},
"widget": {
"missing_type": "Missing Widget Type: {{type}}",
"api_error": "API Error",
"status": "Status"
},
"weather": {
"current": "Current Location",
"allow": "Click to allow",
"updating": "Updating",
"wait": "Please wait"
},
"search": {
"placeholder": "Search…"
},
"emby": {
"playing": "Playing",
"transcoding": "Transcoding",
"bitrate": "Bitrate",
"no_active": "No Active Streams"
},
"tautulli": {
"playing": "Playing",
"transcoding": "Transcoding",
"bitrate": "Bitrate",
"no_active": "No Active Streams"
},
"nzbget": {
"rate": "Rate",
"remaining": "Remaining",
"downloaded": "Downloaded"
},
"sabnzbd": {
"rate": "Rate",
"queue": "Queue",
"timeleft": "Time Left"
},
"rutorrent": {
"active": "Active",
"upload": "Upload",
"download": "Download"
},
"transmission": {
"leech": "Leech",
"seed": "Seed",
"download": "Download",
"upload": "Upload"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
},
"sonarr": {
"wanted": "Wanted",
"queued": "Queued",
"series": "Series"
},
"radarr": {
"wanted": "Wanted",
"queued": "Queued",
"movies": "Movies"
},
"ombi": {
"pending": "Pending",
"approved": "Approved",
"available": "Available"
},
"jellyseerr": {
"pending": "Pending",
"approved": "Approved",
"available": "Available"
},
"overseerr": {
"pending": "Pending",
"approved": "Approved",
"available": "Available"
},
"pihole": {
"queries": "Queries",
"blocked": "Blocked",
"gravity": "Gravity"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
},
"speedtest": {
"upload": "Upload",
"download": "Download",
"ping": "Ping"
},
"portainer": {
"running": "Running",
"stopped": "Stopped",
"total": "Total"
},
"traefik": {
"routers": "Routers",
"services": "Services",
"middleware": "Middleware"
},
"npm": {
"enabled": "Enabled",
"disabled": "Disabled",
"total": "Total"
},
"coinmarketcap": {
"configure": "Configure one or more crypto currencies to track",
"1hour": "1 Hour",
"1day": "1 Day",
"7days": "7 Days",
"30days": "30 Days"
},
"gotify": {
"apps": "Applications",
"clients": "Clients",
"messages": "Messages"
},
"prowlarr": {
"enableIndexers": "Indexers",
"numberOfGrabs": "Grabs",
"numberOfFailGrabs": "Fail Grabs",
"numberOfQueries": "Queries",
"numberOfFailQueries": "Fail Queries"
},
"jackett": {
"configured": "Configured",
"errored": "Errored"
}
}

View File

@@ -145,5 +145,17 @@
"wanted": "Wanted",
"queued": "Queued",
"albums": "Albums"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
},
"qbittorrent": {
"download": "Download",
"leech": "Leech",
"upload": "Upload",
"seed": "Seed"
}
}

View File

@@ -145,5 +145,17 @@
"wanted": "Wanted",
"queued": "Queued",
"albums": "Albums"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
}
}

View File

@@ -145,5 +145,17 @@
"wanted": "Wanted",
"queued": "Queued",
"albums": "Albums"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
}
}

View File

@@ -145,5 +145,17 @@
"jackett": {
"configured": "Skonfigurowane",
"errored": "Błędne"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
}
}

View File

@@ -156,5 +156,17 @@
"queued": "Queued",
"wanted": "Wanted",
"albums": "Albums"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
}
}

View File

@@ -145,5 +145,17 @@
"wanted": "Wanted",
"queued": "Queued",
"albums": "Albums"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
}
}

View File

@@ -0,0 +1,161 @@
{
"widget": {
"missing_type": "Saknar Widget-typ: {{type}}",
"api_error": "API-fel",
"status": "Status"
},
"weather": {
"current": "Nuvarande plats",
"allow": "Klicka för att tillåta",
"updating": "Uppdaterar",
"wait": "Vänligen vänta"
},
"resources": {
"load": "Laddar",
"total": "Total",
"free": "Ledigt",
"used": "Använt"
},
"docker": {
"rx": "RX",
"tx": "TX",
"mem": "MEM",
"cpu": "CPU",
"offline": "Offline"
},
"search": {
"placeholder": "Sök…"
},
"emby": {
"playing": "Spelar",
"transcoding": "Omkodning",
"bitrate": "Bitrate",
"no_active": "Inga aktiva strömmar"
},
"tautulli": {
"playing": "Spelar",
"transcoding": "Omkodning",
"bitrate": "Bitrate",
"no_active": "Inga aktiva strömmar"
},
"nzbget": {
"rate": "Hastighet",
"remaining": "Återstående",
"downloaded": "Nedladdat"
},
"sabnzbd": {
"rate": "Hastighet",
"queue": "Kö",
"timeleft": "Tid kvar"
},
"rutorrent": {
"active": "Aktiva",
"upload": "Uppladdning",
"download": "Nedladdning"
},
"transmission": {
"download": "Nedladdning",
"upload": "Uppladdning",
"leech": "Leech",
"seed": "Seed"
},
"sonarr": {
"wanted": "Eftersöker",
"queued": "I kö",
"series": "Serier"
},
"radarr": {
"wanted": "Eftersöker",
"queued": "I kö",
"movies": "Filmer"
},
"lidarr": {
"wanted": "Eftersöker",
"queued": "I kö",
"albums": "Album"
},
"readarr": {
"wanted": "Eftersökt",
"queued": "I kö",
"books": "Böcker"
},
"bazarr": {
"missingEpisodes": "Saknade program",
"missingMovies": "Saknade filmer"
},
"ombi": {
"pending": "Avvaktar",
"approved": "Godkända",
"available": "Tillgänglig"
},
"jellyseerr": {
"pending": "Avvaktar",
"approved": "Godkända",
"available": "Tillgänglig"
},
"overseerr": {
"pending": "Avvaktar",
"approved": "Godkända",
"available": "Tillgänglig"
},
"pihole": {
"blocked": "Blockerad",
"queries": "Förfrågningar",
"gravity": "Gravity"
},
"speedtest": {
"upload": "Uppladdning",
"download": "Nedladdning",
"ping": "Svarstid"
},
"portainer": {
"running": "Körs",
"stopped": "Stoppade",
"total": "Totalt"
},
"traefik": {
"routers": "Routers",
"services": "Tjänster",
"middleware": "Middleware"
},
"npm": {
"enabled": "Aktiverad",
"disabled": "Inaktiverad",
"total": "Totalt"
},
"coinmarketcap": {
"configure": "Konfigurera en eller flera kryptovalutor att följa",
"1hour": "1 timme",
"1day": "1 dag",
"7days": "7 dagar",
"30days": "30 dagar"
},
"gotify": {
"apps": "Program",
"clients": "Klienter",
"messages": "Meddelande"
},
"prowlarr": {
"enableIndexers": "Indexerare",
"numberOfGrabs": "Hämtningar",
"numberOfQueries": "Queries",
"numberOfFailGrabs": "Misslyckade hämtningar",
"numberOfFailQueries": "Fail Queries"
},
"jackett": {
"configured": "Konfigurerade",
"errored": "Felaktiga"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
}
}

View File

@@ -145,5 +145,17 @@
"wanted": "Wanted",
"queued": "Queued",
"albums": "Albums"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
}
}

View File

@@ -2,7 +2,7 @@
"widget": {
"missing_type": "缺少小部件类型:{{type}}",
"api_error": "API错误",
"status": "地位"
"status": "状态"
},
"search": {
"placeholder": "搜索…"
@@ -88,7 +88,7 @@
"total": "全部的"
},
"weather": {
"current": "当前位",
"current": "当前位",
"allow": "点击并允许",
"updating": "更新中",
"wait": "请等待"
@@ -145,5 +145,17 @@
"wanted": "Wanted",
"queued": "Queued",
"albums": "Albums"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
}
}

View File

@@ -145,5 +145,17 @@
"wanted": "Wanted",
"queued": "Queued",
"albums": "Albums"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
}
}

View File

@@ -11,6 +11,7 @@ import Emby from "./widgets/service/emby";
import Nzbget from "./widgets/service/nzbget";
import SABnzbd from "./widgets/service/sabnzbd";
import Transmission from "./widgets/service/transmission";
import QBittorrent from "./widgets/service/qbittorrent";
import Docker from "./widgets/service/docker";
import Pihole from "./widgets/service/pihole";
import Rutorrent from "./widgets/service/rutorrent";
@@ -25,6 +26,7 @@ import CoinMarketCap from "./widgets/service/coinmarketcap";
import Gotify from "./widgets/service/gotify";
import Prowlarr from "./widgets/service/prowlarr";
import Jackett from "./widgets/service/jackett";
import AdGuard from "./widgets/service/adguard";
const widgetMappings = {
docker: Docker,
@@ -40,6 +42,7 @@ const widgetMappings = {
nzbget: Nzbget,
sabnzbd: SABnzbd,
transmission: Transmission,
qbittorrent: QBittorrent,
pihole: Pihole,
rutorrent: Rutorrent,
speedtest: Speedtest,
@@ -52,6 +55,7 @@ const widgetMappings = {
gotify: Gotify,
prowlarr: Prowlarr,
jackett: Jackett,
adguard: AdGuard,
};
export default function Widget({ service }) {

View File

@@ -0,0 +1,45 @@
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 AdGuard({ service }) {
const { t } = useTranslation();
const config = service.widget;
const { data: adguardData, error: adguardError } = useSWR(formatApiUrl(config, "stats"));
if (adguardError) {
return <Widget error={t("widget.api_error")} />;
}
if (!adguardData) {
return (
<Widget>
<Block label={t("adguard.queries")} />
<Block label={t("adguard.blocked")} />
<Block label={t("adguard.filtered")} />
<Block label={t("adguard.latency")} />
</Widget>
);
}
const filtered =
adguardData.num_replaced_safebrowsing + adguardData.num_replaced_safesearch + adguardData.num_replaced_parental;
return (
<Widget>
<Block label={t("adguard.queries")} value={t("common.number", { value: adguardData.num_dns_queries })} />
<Block label={t("adguard.blocked")} value={t("common.number", { value: adguardData.num_blocked_filtering })} />
<Block label={t("adguard.filtered")} value={t("common.number", { value: filtered })} />
<Block
label={t("adguard.latency")}
value={t("common.ms", { value: adguardData.avg_processing_time * 1000, style: "unit", unit: "millisecond" })}
/>
</Widget>
);
}

View File

@@ -29,8 +29,8 @@ export default function Bazarr({ service }) {
return (
<Widget>
<Block label={t("bazarr.missingEpisodes")} value={episodesData.total} />
<Block label={t("bazarr.missingMovies")} value={moviesData.total} />
<Block label={t("bazarr.missingEpisodes")} value={t("common.number", { value: episodesData.total })} />
<Block label={t("bazarr.missingMovies")} value={t("common.number", { value: moviesData.total })} />
</Widget>
);
}

View File

@@ -30,8 +30,8 @@ export default function Jackett({ service }) {
return (
<Widget>
<Block label={t("jackett.configured")} value={indexersData.length} />
<Block label={t("jackett.errored")} value={errored.length} />
<Block label={t("jackett.configured")} value={t("common.number", { value: indexersData.length })} />
<Block label={t("jackett.errored")} value={t("common.number", { value: errored.length })} />
</Widget>
);
}

View File

@@ -29,13 +29,11 @@ export default function Lidarr({ service }) {
);
}
const have = albumsData.filter((album) => album.statistics.percentOfTracks === 100);
return (
<Widget>
<Block label={t("lidarr.wanted")} value={wantedData.totalRecords} />
<Block label={t("lidarr.queued")} value={queueData.totalCount} />
<Block label={t("lidarr.albums")} value={have.length} />
<Block label={t("lidarr.wanted")} value={t("common.number", { value: wantedData.totalRecords })} />
<Block label={t("lidarr.queued")} value={t("common.number", { value: queueData.totalCount })} />
<Block label={t("lidarr.albums")} value={t("common.number", { value: albumsData.have })} />
</Widget>
);
}

View File

@@ -0,0 +1,69 @@
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 QBittorrent ({ service }) {
const { t } = useTranslation();
const config = service.widget;
const { data: torrentData, error: torrentError } = useSWR(formatApiUrl(config, "torrents/info"));
if (torrentError) {
return <Widget error={t("widget.api_error")} />;
}
if (!torrentData) {
return (
<Widget>
<Block label={t("qbittorrent.leech")} />
<Block label={t("qbittorrent.download")} />
<Block label={t("qbittorrent.seed")} />
<Block label={t("qbittorrent.upload")} />
</Widget>
);
}
let rateDl = 0;
let rateUl = 0;
let completed = 0;
for (let i = 0; i < torrentData.length; i += 1) {
const torrent = torrentData[i];
rateDl += torrent.dlspeed;
rateUl += torrent.upspeed;
if (torrent.progress === 1) {
completed += 1;
}
}
const leech = torrentData.length - completed;
let unitsDl = "KB/s";
let unitsUl = "KB/s";
rateDl /= 1024;
rateUl /= 1024;
if (rateDl > 1024) {
rateDl /= 1024;
unitsDl = "MB/s";
}
if (rateUl > 1024) {
rateUl /= 1024;
unitsUl = "MB/s";
}
return (
<Widget>
<Block label={t("qbittorrent.leech")} value={t("common.number", { value: leech })} />
<Block label={t("qbittorrent.download")} value={`${rateDl.toFixed(2)} ${unitsDl}`} />
<Block label={t("qbittorrent.seed")} value={t("common.number", { value: completed })} />
<Block label={t("qbittorrent.upload")} value={`${rateUl.toFixed(2)} ${unitsUl}`} />
</Widget>
);
}

View File

@@ -28,14 +28,11 @@ export default function Radarr({ service }) {
);
}
const wanted = moviesData.filter((movie) => movie.isAvailable === false);
const have = moviesData.filter((movie) => movie.isAvailable === true);
return (
<Widget>
<Block label={t("radarr.wanted")} value={wanted.length} />
<Block label={t("radarr.wanted")} value={moviesData.wanted} />
<Block label={t("radarr.queued")} value={queuedData.totalCount} />
<Block label={t("radarr.movies")} value={have.length} />
<Block label={t("radarr.movies")} value={moviesData.have} />
</Widget>
);
}

View File

@@ -29,13 +29,11 @@ export default function Readarr({ service }) {
);
}
const have = booksData.filter((book) => book.statistics.bookFileCount > 0);
return (
<Widget>
<Block label={t("readarr.wanted")} value={wantedData.totalRecords} />
<Block label={t("readarr.queued")} value={queueData.totalCount} />
<Block label={t("readarr.books")} value={have.length} />
<Block label={t("readarr.wanted")} value={t("common.number", { value: wantedData.totalRecords })} />
<Block label={t("readarr.queued")} value={t("common.number", { value: queueData.totalCount })} />
<Block label={t("readarr.books")} value={t("common.number", { value: booksData.have })} />
</Widget>
);
}

View File

@@ -30,7 +30,7 @@ export default function SABnzbd({ service }) {
return (
<Widget>
<Block label={t("sabnzbd.rate")} value={`${queueData.queue.speed}B/s`} />
<Block label={t("sabnzbd.queue")} value={queueData.queue.noofslots} />
<Block label={t("sabnzbd.queue")} value={t("common.number", { value: queueData.queue.noofslots })} />
<Block label={t("sabnzbd.timeleft")} value={queueData.queue.timeleft} />
</Widget>
);

View File

@@ -33,7 +33,7 @@ export default function Sonarr({ service }) {
<Widget>
<Block label={t("sonarr.wanted")} value={wantedData.totalRecords} />
<Block label={t("sonarr.queued")} value={queuedData.totalRecords} />
<Block label={t("sonarr.series")} value={seriesData.length} />
<Block label={t("sonarr.series")} value={seriesData.total} />
</Widget>
);
}

View File

@@ -61,9 +61,9 @@ export default function Transmission({ service }) {
return (
<Widget>
<Block label={t("transmission.leech")} value={leech} />
<Block label={t("transmission.leech")} value={t("common.number", { value: leech })} />
<Block label={t("transmission.download")} value={`${rateDl.toFixed(2)} ${unitsDl}`} />
<Block label={t("transmission.seed")} value={completed} />
<Block label={t("transmission.seed")} value={t("common.number", { value: completed })} />
<Block label={t("transmission.upload")} value={`${rateUl.toFixed(2)} ${unitsUl}`} />
</Widget>
);

View File

@@ -7,15 +7,17 @@ export default async function handler(req, res) {
try {
discoveredServices = cleanServiceGroups(await servicesFromDocker());
} catch {
console.error("Failed to discover services, please check docker.yaml for errors");
} catch (e) {
console.error("Failed to discover services, please check docker.yaml for errors or remove example entries.");
console.error(e);
discoveredServices = [];
}
try {
configuredServices = cleanServiceGroups(await servicesFromConfig());
} catch {
} catch (e) {
console.error("Failed to load services.yaml, please check for errors");
console.error(e);
configuredServices = [];
}

View File

@@ -4,22 +4,83 @@ import rutorrentProxyHandler from "utils/proxies/rutorrent";
import nzbgetProxyHandler from "utils/proxies/nzbget";
import npmProxyHandler from "utils/proxies/npm";
import transmissionProxyHandler from "utils/proxies/transmission";
import qbittorrentProxyHandler from "utils/proxies/qbittorrent";
function asJson(data) {
if (data?.length > 0) {
const json = JSON.parse(data.toString());
return json;
}
return data;
}
function jsonArrayTransform(data, transform) {
const json = asJson(data);
if (json instanceof Array) {
return transform(json);
}
return json;
}
function jsonArrayFilter(data, filter) {
return jsonArrayTransform(data, items => items.filter(filter));
}
const serviceProxyHandlers = {
// uses query param auth
emby: genericProxyHandler,
jellyfin: genericProxyHandler,
pihole: genericProxyHandler,
radarr: genericProxyHandler,
sonarr: genericProxyHandler,
lidarr: genericProxyHandler,
readarr: genericProxyHandler,
bazarr: genericProxyHandler,
radarr: {
proxy: genericProxyHandler,
maps: {
movie: (data) => ({
wanted: jsonArrayFilter(data, (item) => item.isAvailable === false).length,
have: jsonArrayFilter(data, (item) => item.isAvailable === true).length
})
},
},
sonarr: {
proxy: genericProxyHandler,
maps: {
series: (data) => ({
total: asJson(data).length,
}),
},
},
lidarr: {
proxy: genericProxyHandler,
maps: {
album: (data) => ({
have: jsonArrayFilter(data, (item) => item.statistics.percentOfTracks === 100).length,
}),
},
},
readarr: {
proxy: genericProxyHandler,
maps: {
book: (data) => ({
have: jsonArrayFilter(data, (item) => item.statistics.bookFileCount > 0).length,
}),
},
},
bazarr: {
proxy: genericProxyHandler,
maps: {
movies: (data) => ({
total: asJson(data).total,
}),
episodes: (data) => ({
total: asJson(data).total,
}),
},
},
speedtest: genericProxyHandler,
tautulli: genericProxyHandler,
traefik: genericProxyHandler,
sabnzbd: genericProxyHandler,
jackett: genericProxyHandler,
adguard: genericProxyHandler,
// uses X-API-Key (or similar) header auth
gotify: credentialedProxyHandler,
portainer: credentialedProxyHandler,
@@ -33,6 +94,7 @@ const serviceProxyHandlers = {
nzbget: nzbgetProxyHandler,
npm: npmProxyHandler,
transmission: transmissionProxyHandler,
qbittorrent: qbittorrentProxyHandler,
};
export default async function handler(req, res) {
@@ -41,7 +103,14 @@ export default async function handler(req, res) {
const serviceProxyHandler = serviceProxyHandlers[type];
if (serviceProxyHandler) {
return serviceProxyHandler(req, res);
if (serviceProxyHandler instanceof Function) {
return serviceProxyHandler(req, res);
}
const { proxy, maps } = serviceProxyHandler;
if (proxy) {
return proxy(req, res, maps);
}
}
return res.status(403).json({ error: "Unkown proxy service type" });

View File

@@ -46,6 +46,7 @@ export default function Home({ settings }) {
if (settings.background) {
wrappedStyle.backgroundImage = `url(${settings.background})`;
wrappedStyle.backgroundSize = "cover";
wrappedStyle.opacity = settings.backgroundOpacity ?? 1;
}
useEffect(() => {

View File

@@ -10,6 +10,7 @@ const formats = {
portainer: `{url}/api/endpoints/{env}/{endpoint}`,
rutorrent: `{url}/plugins/httprpc/action.php`,
transmission: `{url}/transmission/rpc`,
qbittorrent: `{url}/api/v2/{endpoint}`,
jellyseerr: `{url}/api/v1/{endpoint}`,
overseerr: `{url}/api/v1/{endpoint}`,
ombi: `{url}/api/v1/{endpoint}`,
@@ -21,7 +22,8 @@ const formats = {
coinmarketcap: `https://pro-api.coinmarketcap.com/{endpoint}`,
gotify: `{url}/{endpoint}`,
prowlarr: `{url}/api/v1/{endpoint}`,
jackett: `{url}/api/v2.0/{endpoint}?apikey={key}&configured=true`
jackett: `{url}/api/v2.0/{endpoint}?apikey={key}&configured=true`,
adguard: `{url}/control/{endpoint}`,
};
export function formatApiCall(api, args) {

34
src/utils/cookie-jar.js Normal file
View File

@@ -0,0 +1,34 @@
/* eslint-disable no-param-reassign */
import { Cookie, CookieJar } from 'tough-cookie';
const cookieJar = new CookieJar();
export function setCookieHeader(url, params) {
// add cookie header, if we have one in the jar
const existingCookie = cookieJar.getCookieStringSync(url.toString());
if (existingCookie) {
params.headers = params.headers ?? {};
params.headers.Cookie = existingCookie;
}
}
export function addCookieToJar(url, headers) {
let cookieHeader = headers['set-cookie'];
if (headers instanceof Headers) {
cookieHeader = headers.get('set-cookie');
}
if (!cookieHeader || cookieHeader.length === 0) return;
let cookies = null;
if (cookieHeader instanceof Array) {
cookies = cookieHeader.map(Cookie.parse);
}
else {
cookies = [Cookie.parse(cookieHeader)];
}
for (let i = 0; i < cookies.length; i += 1) {
cookieJar.setCookieSync(cookies[i], url.toString());
}
}

View File

@@ -1,39 +1,15 @@
/* eslint-disable prefer-promise-reject-errors */
/* eslint-disable no-param-reassign */
import { http, https } from "follow-redirects";
import { Cookie, CookieJar } from 'tough-cookie';
const cookieJar = new CookieJar();
function setCookieHeader(url, params) {
// add cookie header, if we have one in the jar
const existingCookie = cookieJar.getCookieStringSync(url.toString());
if (existingCookie) {
params.headers = params.headers ?? {};
params.headers.Cookie = existingCookie;
}
}
import { addCookieToJar, setCookieHeader } from "utils/cookie-jar";
function addCookieHandler(url, params) {
setCookieHeader(url, params);
// handle cookies during redirects
params.beforeRedirect = (options, responseInfo) => {
const cookieHeader = responseInfo.headers['set-cookie'];
if (!cookieHeader || cookieHeader.length === 0) return;
let cookies = null;
if (cookieHeader instanceof Array) {
cookies = cookieHeader.map(Cookie.parse);
}
else {
cookies = [Cookie.parse(cookieHeader)];
}
for (let i = 0; i < cookies.length; i += 1) {
cookieJar.setCookieSync(cookies[i], options.href);
}
addCookieToJar(options.href, responseInfo.headers);
setCookieHeader(options.href, options);
};
}
@@ -49,6 +25,7 @@ export function httpsRequest(url, params) {
});
response.on("end", () => {
addCookieToJar(url, response.headers);
resolve([response.statusCode, response.headers["content-type"], Buffer.concat(data), response.headers]);
});
});
@@ -76,6 +53,7 @@ export function httpRequest(url, params) {
});
response.on("end", () => {
addCookieToJar(url, response.headers);
resolve([response.statusCode, response.headers["content-type"], Buffer.concat(data), response.headers]);
});
});

View File

@@ -2,7 +2,7 @@ import getServiceWidget from "utils/service-helpers";
import { formatApiCall } from "utils/api-helpers";
import { httpProxy } from "utils/http";
export default async function genericProxyHandler(req, res) {
export default async function genericProxyHandler(req, res, maps) {
const { group, service, endpoint } = req.query;
if (group && service) {
@@ -10,17 +10,31 @@ export default async function genericProxyHandler(req, res) {
if (widget) {
const url = new URL(formatApiCall(widget.type, { endpoint, ...widget }));
let headers;
if (widget.username && widget.password) {
headers = {
Authorization: `Basic ${Buffer.from(`${widget.username}:${widget.password}`).toString("base64")}`,
};
}
const [status, contentType, data] = await httpProxy(url, {
method: req.method,
headers,
});
let resultData = data;
if (maps?.[endpoint]) {
resultData = maps[endpoint](data);
}
if (contentType) res.setHeader("Content-Type", contentType);
if (status === 204 || status === 304) {
return res.status(status).end();
}
return res.status(status).send(data);
return res.status(status).send(resultData);
}
}

View File

@@ -0,0 +1,58 @@
import { formatApiCall } from "utils/api-helpers";
import { addCookieToJar, setCookieHeader } from "utils/cookie-jar";
import { httpProxy } from "utils/http";
import getServiceWidget from "utils/service-helpers";
async function login(widget, params) {
const loginUrl = new URL(`${widget.url}/api/v2/auth/login`);
const loginBody = `username=${encodeURI(widget.username)}&password=${encodeURI(widget.password)}`;
// using fetch intentionally, for login only, as the httpProxy method causes qBittorrent to
// complain about header encoding
return fetch(loginUrl, {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: loginBody
})
.then(async response => {
addCookieToJar(loginUrl, response.headers);
setCookieHeader(loginUrl, params);
const data = await response.text();
return ([response.status, data]);
})
.catch(err => ([500, err]));
}
export default async function qbittorrentProxyHandler(req, res) {
const { group, service, endpoint } = req.query;
if (!group || !service) {
return res.status(400).json({ error: "Invalid proxy service type" });
}
const widget = await getServiceWidget(group, service);
if (!widget) {
return res.status(400).json({ error: "Invalid proxy service type" });
}
const url = new URL(formatApiCall(widget.type, { endpoint, ...widget }));
const params = { method: "GET", headers: {} };
setCookieHeader(url, params);
if (!params.headers.Cookie) {
const [status, data] = await login(widget, params);
if (status !== 200) {
return res.status(status).end(data);
}
if (data.toString() !== 'Ok.') {
return res.status(401).end(data);
}
}
const [status, contentType, data] = await httpProxy(url, params);
if (contentType) res.setHeader("Content-Type", contentType);
return res.status(status).send(data);
}