Merge branch 'benphelps:main' into main

This commit is contained in:
Benoit SERRA 2022-12-08 15:38:20 +01:00 committed by GitHub
commit 775b5111e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 250 additions and 38 deletions

View file

@ -47,12 +47,12 @@
- Service Integration - Service Integration
- Sonarr, Radarr, Readarr, Prowlarr, Bazarr, Lidarr, Emby, Jellyfin, Tautulli (Plex) - Sonarr, Radarr, Readarr, Prowlarr, Bazarr, Lidarr, Emby, Jellyfin, Tautulli (Plex)
- Ombi, Overseerr, Jellyseerr, Jackett, NZBGet, SABnzbd, ruTorrent, Transmission, qBittorrent - Ombi, Overseerr, Jellyseerr, Jackett, NZBGet, SABnzbd, ruTorrent, Transmission, qBittorrent
- Portainer, Traefik, Speedtest Tracker, PiHole, AdGuard Home, Nginx Proxy Manager, Gotify, Syncthing Relay Server, Authentic, Proxmox - Portainer, Traefik, Speedtest Tracker, PiHole, AdGuard Home, Nginx Proxy Manager, Gotify, Syncthing Relay Server, Authentik, Proxmox
- Information Providers - Information Providers
- Coin Market Cap, Mastodon - Coin Market Cap, Mastodon
- Information & Utility Widgets - Information & Utility Widgets
- System Stats (Disk, CPU, Memory) - System Stats (Disk, CPU, Memory)
- Weather via WeatherAPI.com or OpenWeatherMap - Weather via [OpenWeatherMap](https://openweathermap.org/) or [Open-Meteo](https://open-meteo.com/)
- Search Bar - Search Bar
- Customizable - Customizable
- 21 theme colors with light and dark mode support - 21 theme colors with light and dark mode support

View file

@ -24,7 +24,7 @@
"available": "Dostupno", "available": "Dostupno",
"pending": "Predstoji", "pending": "Predstoji",
"approved": "Odobreno", "approved": "Odobreno",
"processing": "Processing" "processing": "Obrada"
}, },
"pihole": { "pihole": {
"queries": "Upiti", "queries": "Upiti",
@ -345,20 +345,20 @@
"total": "Ukupno" "total": "Ukupno"
}, },
"deluge": { "deluge": {
"download": "Download", "download": "Preuzimanje",
"upload": "Upload", "upload": "Prijenos",
"leech": "Leech", "leech": "Leech",
"seed": "Seed" "seed": "Seed"
}, },
"diskstation": { "diskstation": {
"download": "Download", "download": "Preuzimanje",
"upload": "Upload", "upload": "Prijenos",
"leech": "Leech", "leech": "Leech",
"seed": "Seed" "seed": "Seed"
}, },
"flood": { "flood": {
"download": "Download", "download": "Preuzimanje",
"upload": "Upload", "upload": "Prijenos",
"leech": "Leech", "leech": "Leech",
"seed": "Seed" "seed": "Seed"
} }

View file

@ -3,10 +3,10 @@
"missing_type": "Widget ausente: {{type}}", "missing_type": "Widget ausente: {{type}}",
"api_error": "Erro da API", "api_error": "Erro da API",
"status": "Status", "status": "Status",
"information": "Information", "information": "Informação",
"url": "URL", "url": "Endereço URL",
"raw_error": "Raw Error", "raw_error": "Raw Error",
"response_data": "Response Data" "response_data": "Dados da Resposta"
}, },
"search": { "search": {
"placeholder": "Pesquisar…" "placeholder": "Pesquisar…"
@ -24,8 +24,8 @@
"mem": "Mem", "mem": "Mem",
"cpu": "CPU", "cpu": "CPU",
"offline": "Desligado", "offline": "Desligado",
"error": "Error", "error": "Erro",
"unknown": "Unknown" "unknown": "Desconhecido"
}, },
"emby": { "emby": {
"playing": "A reproduzir", "playing": "A reproduzir",
@ -150,7 +150,7 @@
"transmission": { "transmission": {
"download": "Baixando", "download": "Baixando",
"upload": "Enviando", "upload": "Enviando",
"leech": "Sanguessugas", "leech": "Leech",
"seed": "Semeadores" "seed": "Semeadores"
}, },
"jackett": { "jackett": {
@ -201,25 +201,25 @@
"vms": "VMs" "vms": "VMs"
}, },
"unifi": { "unifi": {
"users": "Users", "users": "Utilizadores",
"uptime": "System Uptime", "uptime": "Tempo de Atividade do Sistema",
"days": "Days", "days": "Dias",
"wan": "WAN", "wan": "WAN",
"lan_users": "LAN Users", "lan_users": "Utilizadores LAN",
"wlan_users": "WLAN Users", "wlan_users": "Utilizadores WLAN",
"up": "UP", "up": "UP",
"down": "DOWN", "down": "DOWN",
"wait": "Please wait", "wait": "Por favor aguarde",
"lan": "LAN", "lan": "LAN",
"wlan": "WLAN", "wlan": "WLAN",
"devices": "Devices", "devices": "Dispositivos",
"lan_devices": "LAN Devices", "lan_devices": "Dispositivos LAN",
"wlan_devices": "WLAN Devices" "wlan_devices": "Dispositivos WLAN"
}, },
"plex": { "plex": {
"streams": "Active Streams", "streams": "Streams Ativas",
"movies": "Movies", "movies": "Filmes",
"tv": "TV Shows" "tv": "Series de TV"
}, },
"glances": { "glances": {
"cpu": "CPU", "cpu": "CPU",
@ -227,8 +227,8 @@
"wait": "Please wait" "wait": "Please wait"
}, },
"changedetectionio": { "changedetectionio": {
"totalObserved": "Total Observed", "totalObserved": "Total Observado",
"diffsDetected": "Diffs Detected" "diffsDetected": "Diferenças Detetadas"
}, },
"wmo": { "wmo": {
"0-day": "Sunny", "0-day": "Sunny",
@ -343,7 +343,7 @@
"hd": "HD" "hd": "HD"
}, },
"ping": { "ping": {
"error": "Error", "error": "Erro",
"ping": "Ping" "ping": "Ping"
}, },
"scrutiny": { "scrutiny": {
@ -368,8 +368,8 @@
"seed": "Seed" "seed": "Seed"
}, },
"flood": { "flood": {
"download": "Download", "download": "Descarregar",
"upload": "Upload", "upload": "Carregar",
"leech": "Leech", "leech": "Leech",
"seed": "Seed" "seed": "Seed"
} }

View file

@ -1,4 +1,4 @@
import mapIcon from "utils/weather/owm-condition-map"; import mapIcon from "utils/weather/openmeteo-condition-map";
export default function Icon({ condition, timeOfDay }) { export default function Icon({ condition, timeOfDay }) {
const IconComponent = mapIcon(condition, timeOfDay); const IconComponent = mapIcon(condition, timeOfDay);

View file

@ -1,8 +1,9 @@
import cachedFetch from "utils/proxy/cached-fetch"; import cachedFetch from "utils/proxy/cached-fetch";
export default async function handler(req, res) { export default async function handler(req, res) {
const { latitude, longitude, units, cache } = req.query; const { latitude, longitude, units, cache, timezone } = req.query;
const degrees = units === "imperial" ? "fahrenheit" : "celsius"; const degrees = units === "imperial" ? "fahrenheit" : "celsius";
const apiUrl = `https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&daily=sunrise,sunset&current_weather=true&temperature_unit=${degrees}&timezone=auto`; const timezeone = timezone ?? 'auto'
const apiUrl = `https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&daily=sunrise,sunset&current_weather=true&temperature_unit=${degrees}&timezone=${timezeone}`;
return res.send(await cachedFetch(apiUrl, cache)); return res.send(await cachedFetch(apiUrl, cache));
} }

View file

@ -0,0 +1,211 @@
import * as Icons from "react-icons/wi";
// see https://open-meteo.com/en/docs
const conditions = [
{
code: 1,
icon: {
day: Icons.WiDayCloudy,
night: Icons.WiNightAltCloudy,
},
},
{
code: 2,
icon: {
day: Icons.WiDayCloudy,
night: Icons.WiNightAltCloudy,
},
},
{
code: 3,
icon: {
day: Icons.WiDayCloudy,
night: Icons.WiNightAltCloudy,
},
},
{
code: 45,
icon: {
day: Icons.WiDayFog,
night: Icons.WiNightFog,
},
},
{
code: 48,
icon: {
day: Icons.WiDayFog,
night: Icons.WiNightFog,
},
},
{
code: 51,
icon: {
day: Icons.WiDaySprinkle,
night: Icons.WiNightAltSprinkle,
},
},
{
code: 53,
icon: {
day: Icons.WiDaySprinkle,
night: Icons.WiNightAltSprinkle,
},
},
{
code: 55,
icon: {
day: Icons.WiDaySprinkle,
night: Icons.WiNightAltSprinkle,
},
},
{
code: 56,
icon: {
day: Icons.WiDaySleet,
night: Icons.WiNightAltSleet,
},
},
{
code: 57,
icon: {
day: Icons.WiDaySleet,
night: Icons.WiNightAltSleet,
},
},
{
code: 61,
icon: {
day: Icons.WiDayShowers,
night: Icons.WiNightAltShowers,
},
},
{
code: 63,
icon: {
day: Icons.WiDayShowers,
night: Icons.WiNightAltShowers,
},
},
{
code: 65,
icon: {
day: Icons.WiDayShowers,
night: Icons.WiNightAltShowers,
},
},
{
code: 66,
icon: {
day: Icons.WiDaySleet,
night: Icons.WiNightAltSleet,
},
},
{
code: 67,
icon: {
day: Icons.WiDaySleet,
night: Icons.WiNightAltSleet,
},
},
{
code: 71,
icon: {
day: Icons.WiDaySnow,
night: Icons.WiNightAltSnow,
},
},
{
code: 73,
icon: {
day: Icons.WiDaySnow,
night: Icons.WiNightAltSnow,
},
},
{
code: 75,
icon: {
day: Icons.WiDaySnow,
night: Icons.WiNightAltSnow,
},
},
{
code: 77,
icon: {
day: Icons.WiDaySnow,
night: Icons.WiNightAltSnow,
},
},
{
code: 80,
icon: {
day: Icons.WiDaySnow,
night: Icons.WiNightAltSnow,
},
},
{
code: 81,
icon: {
day: Icons.WiDaySnow,
night: Icons.WiNightAltSnow,
},
},
{
code: 82,
icon: {
day: Icons.WiDaySnow,
night: Icons.WiNightAltSnow,
},
},
{
code: 85,
icon: {
day: Icons.WiDaySnow,
night: Icons.WiNightAltSnow,
},
},
{
code: 86,
icon: {
day: Icons.WiDaySnow,
night: Icons.WiNightAltSnow,
},
},
{
code: 95,
icon: {
day: Icons.WiDayThunderstorm,
night: Icons.WiNightAltThunderstorm,
},
},
{
code: 96,
icon: {
day: Icons.WiDayThunderstorm,
night: Icons.WiNightAltThunderstorm,
},
},
{
code: 99,
icon: {
day: Icons.WiDayThunderstorm,
night: Icons.WiNightAltThunderstorm,
},
},
];
export default function mapIcon(weatherStatusCode, timeOfDay) {
const mapping = conditions.find((condition) => condition.code === weatherStatusCode);
if (mapping) {
if (timeOfDay === "day") {
return mapping.icon.day;
}
if (timeOfDay === "night") {
return mapping.icon.night;
}
}
return Icons.WiDaySunny;
}

View file

@ -11,11 +11,11 @@ export default function Component({ service }) {
const { data: torrentData, error: torrentError } = useWidgetAPI(widget, "torrents"); const { data: torrentData, error: torrentError } = useWidgetAPI(widget, "torrents");
if (torrentError) { if (torrentError || !torrentData?.torrents) {
return <Container error={torrentError} />; return <Container error={torrentError ?? {message: "No torrent data returned"}} />;
} }
if (!torrentData) { if (!torrentData || !torrentData.torrents) {
return ( return (
<Container service={service}> <Container service={service}>
<Block label="flood.leech" /> <Block label="flood.leech" />