Compare commits

...

15 Commits

Author SHA1 Message Date
Ben Phelps
d5a489198a update readme 2022-09-18 17:00:40 +03:00
Ben Phelps
17f54da524 yaml validation 2022-09-18 16:41:01 +03:00
ShlomiPorush
b5065673ab Translated using Weblate (Hebrew)
Currently translated at 93.5% (101 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/he/
2022-09-18 15:13:10 +02:00
Pacux
610b0f63e0 Translated using Weblate (Catalan)
Currently translated at 100.0% (108 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ca/
2022-09-18 15:13:09 +02:00
yahoo~~
73317bda67 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (108 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/zh_Hans/
2022-09-18 15:13:09 +02:00
Nonoss117
f690f3acba Translated using Weblate (French)
Currently translated at 100.0% (108 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/fr/
2022-09-18 15:13:09 +02:00
Anonymous
eea9f1f6cb Translated using Weblate (Hebrew)
Currently translated at 100.0% (0 of 0 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/he/
2022-09-18 08:37:27 +02:00
Daniel Varga
d9089e8d1c Translated using Weblate (Hungarian)
Currently translated at 100.0% (108 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/hu/
2022-09-18 08:37:26 +02:00
Nonoss117
bed5acc9d5 Translated using Weblate (French)
Currently translated at 100.0% (108 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/fr/
2022-09-18 08:37:25 +02:00
Ángel Fernández Sánchez
f46feff445 Translated using Weblate (Spanish)
Currently translated at 100.0% (108 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/es/
2022-09-18 08:37:25 +02:00
Daniel Varga
d46a98c7d5 Translated using Weblate (German)
Currently translated at 62.0% (67 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/de/
2022-09-18 08:37:25 +02:00
ShlomiPorush
05af60df4f Added translation using Weblate (Hebrew) 2022-09-18 08:37:17 +02:00
Ben Phelps
5fc266ed81 better status icon logic for tautulli 2022-09-18 02:12:24 +03:00
Ben Phelps
38356c31b0 handle when structure differs from expectation 2022-09-18 01:38:41 +03:00
Ben Phelps
2703cfb81e update attributions and features 2022-09-17 22:03:21 +03:00
21 changed files with 412 additions and 183 deletions

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, Spanish and Swedish
- Translations for Chinese, Dutch, French, German, Hebrew, Hungarian, 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
@@ -17,7 +17,7 @@
- Automatic service discovery (via labels)
- Service Integration
- Sonarr, Radarr, Readarr, Prowlarr, Bazarr, Lidarr, Emby, Jellyfin, Tautulli (Plex)
- Ombi, Overseerr, Jellyseerr, Jackett, NZBGet, SABnzbd, ruTorrent, Transmission
- Ombi, Overseerr, Jellyseerr, Jackett, NZBGet, SABnzbd, ruTorrent, Transmission, qBittorrent
- Portainer, Traefik, Speedtest Tracker, PiHole, AdGuard Home, Nginx Proxy Manager, Gotify
- Information Providers
- Coin Market Cap
@@ -127,7 +127,7 @@ Huge thanks to the all the contributors who have helped make this project what i
- [ilusi0n](https://github.com/benphelps/homepage/commits?author=ilusi0n) - Jellyseerr Integration
- [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
- [JazzFisch](https://github.com/benphelps/homepage/commits?author=JazzFisch) - Readarr, Bazarr, Lidarr, SABnzbd, Transmission & qBittorrent 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
@@ -138,3 +138,6 @@ Huge thanks to the all the contributors who have helped make this project what i
- [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
- [andrii-kryvoviaz](https://github.com/benphelps/homepage/commits?author=andrii-kryvoviaz) - Background opacity option
- Daniel Varga - German & Hungarian Translation
- [ShlomiPorush](https://github.com/benphelps/homepage/commits?author=ShlomiPorush) - Hebrew Translation

View File

@@ -97,7 +97,7 @@
"pihole": {
"queries": "Consultes",
"blocked": "Bloquejat",
"gravity": "Gravetat"
"gravity": "Gravity"
},
"portainer": {
"running": "Executant",
@@ -147,14 +147,14 @@
"albums": "Àlbums"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
"queries": "Consultes",
"blocked": "Bloquejat",
"filtered": "Filtrat",
"latency": "Latència"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"download": "Descàrrega",
"upload": "Càrrega",
"leech": "Leech",
"seed": "Seed"
}

View File

@@ -11,7 +11,7 @@
"total": "Gesamt",
"free": "Frei",
"used": "Gebraucht",
"load": "Load"
"load": "Belastung"
},
"docker": {
"rx": "Rx",
@@ -24,13 +24,13 @@
"playing": "Spielen",
"transcoding": "Transcodierung",
"bitrate": "Bitrate",
"no_active": "No Active Streams"
"no_active": "Keine aktiven streamen"
},
"tautulli": {
"playing": "Spielen",
"transcoding": "Transcodierung",
"bitrate": "Bitrate",
"no_active": "No Active Streams"
"no_active": "Keine aktiven streamen"
},
"rutorrent": {
"active": "Aktiv",

View File

@@ -153,9 +153,9 @@
"latency": "Latencia"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
"download": "Descarga",
"upload": "Subida",
"leech": "Compañeros",
"seed": "Semillas"
}
}

View File

@@ -34,8 +34,8 @@
},
"rutorrent": {
"active": "Actif",
"upload": "Téléverser",
"download": "Télécharger"
"upload": "Envoi",
"download": "Réception"
},
"sonarr": {
"wanted": "Demandé",
@@ -68,8 +68,8 @@
"gravity": "Listes dom. bloqués"
},
"speedtest": {
"upload": "Téléversement",
"download": "Téléchargement",
"upload": "Envoi",
"download": "Récept.",
"ping": "Ping"
},
"portainer": {
@@ -164,8 +164,8 @@
"latency": "Latence"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"download": "Réception",
"upload": "Envoi",
"leech": "Leech",
"seed": "Seed"
}

View File

@@ -0,0 +1,161 @@
{
"widget": {
"missing_type": "סוג ווידג'ט חסר: {{type}}",
"api_error": "שגיאת API",
"status": "סטטוס"
},
"weather": {
"current": "מיקום נוכחי",
"allow": "יש ללחוץ כדי לאשר",
"updating": "מעדכן",
"wait": "המתן בבקשה"
},
"search": {
"placeholder": "חיפוש…"
},
"resources": {
"total": "סה\"כ",
"free": "פנוי",
"used": "בשימוש",
"load": "עומס"
},
"docker": {
"rx": "RX",
"tx": "TX",
"mem": "זיכרון",
"cpu": "מעבד",
"offline": "כבוי"
},
"emby": {
"playing": "מנגן",
"transcoding": "מקודד",
"bitrate": "סיביות",
"no_active": "אין הזרמות פעילות"
},
"tautulli": {
"playing": "מנגן",
"transcoding": "מקודד",
"bitrate": "סיביות",
"no_active": "אין הזרמות פעילות"
},
"nzbget": {
"rate": "יחס",
"remaining": "נותר",
"downloaded": "הורד"
},
"sabnzbd": {
"rate": "יחס",
"queue": "תור",
"timeleft": "זמן שנותר"
},
"rutorrent": {
"active": "פעיל",
"upload": "העלאה",
"download": "הורדה"
},
"transmission": {
"download": "הורדה",
"upload": "העלאה",
"leech": "בהורדה",
"seed": "בשיתוף"
},
"qbittorrent": {
"download": "הורדה",
"upload": "העלאה",
"leech": "בהורדה",
"seed": "בשיתוף"
},
"sonarr": {
"wanted": "מבוקש",
"queued": "בתור",
"series": "סדרות"
},
"radarr": {
"wanted": "מבוקש",
"queued": "בתור",
"movies": "סרטים"
},
"lidarr": {
"wanted": "מבוקש",
"queued": "בתור",
"albums": "אלבומים"
},
"readarr": {
"wanted": "מבוקש",
"queued": "בתור",
"books": "ספרים"
},
"bazarr": {
"missingEpisodes": "פרקים חסרים",
"missingMovies": "סרטים חסרים"
},
"ombi": {
"pending": "ממתין",
"approved": "מאושר",
"available": "זמין"
},
"jellyseerr": {
"pending": "ממתין",
"approved": "מאושר",
"available": "זמין"
},
"overseerr": {
"pending": "ממתין",
"approved": "מאושר",
"available": "זמין"
},
"pihole": {
"queries": "שאילתות",
"blocked": "נחסם",
"gravity": "Gravity"
},
"adguard": {
"queries": "שאילתות",
"blocked": "נחסם",
"filtered": "מסונן",
"latency": "השהיה"
},
"speedtest": {
"upload": "העלאה",
"download": "הורדה",
"ping": "פינג"
},
"portainer": {
"running": "פעיל",
"stopped": "נעצר",
"total": "סה\"כ"
},
"traefik": {
"routers": "ניתובים",
"services": "שירותים",
"middleware": "מתווך"
},
"npm": {
"enabled": "מופעל",
"disabled": "מבוטל",
"total": "סה\"כ"
},
"coinmarketcap": {
"configure": "קבע את התצורה של מטבע קריפטו אחד או יותר למעקב",
"1hour": "שעה אחת",
"1day": "יום 1",
"7days": "7 יום",
"30days": "30 יום"
},
"gotify": {
"apps": "אפליקציות",
"clients": "לקוחות",
"messages": "הודעות"
},
"prowlarr": {
"enableIndexers": "אינדקסים",
"numberOfGrabs": "Grabs",
"numberOfQueries": "שאילתות",
"numberOfFailGrabs": "Fail Grabs",
"numberOfFailQueries": "Fail Queries"
},
"jackett": {
"configured": "מוגדר",
"errored": "שגיאה"
}
}

View File

@@ -1,9 +1,9 @@
{
"resources": {
"total": "Total",
"free": "Free",
"used": "Used",
"load": "Load"
"total": "Összes",
"free": "Szabad",
"used": "Használt",
"load": "Terhelés"
},
"docker": {
"rx": "RX",
@@ -13,149 +13,149 @@
"offline": "Offline"
},
"lidarr": {
"albums": "Albums",
"wanted": "Wanted",
"queued": "Queued"
"albums": "Albumok",
"wanted": "Keresett",
"queued": "Sorban áll"
},
"readarr": {
"wanted": "Wanted",
"queued": "Queued",
"books": "Books"
"wanted": "Keresett",
"queued": "Sorban áll",
"books": "Könyvek"
},
"bazarr": {
"missingEpisodes": "Missing Episodes",
"missingMovies": "Missing Movies"
"missingEpisodes": "Hiányzó epizódok",
"missingMovies": "Hiányzó filmek"
},
"widget": {
"missing_type": "Missing Widget Type: {{type}}",
"api_error": "API Error",
"status": "Status"
"missing_type": "Hiányzó Widget Típus: {{type}}",
"api_error": "API Hiba",
"status": "Státusz"
},
"weather": {
"current": "Current Location",
"allow": "Click to allow",
"updating": "Updating",
"wait": "Please wait"
"current": "Aktuális hely",
"allow": "Kattints az engedélyezéshez",
"updating": "Frissítés",
"wait": "Kérlek várj"
},
"search": {
"placeholder": "Search…"
"placeholder": "Keresés…"
},
"emby": {
"playing": "Playing",
"transcoding": "Transcoding",
"bitrate": "Bitrate",
"no_active": "No Active Streams"
"playing": "Lejátszás",
"transcoding": "Átkódolás",
"bitrate": "Bitráta",
"no_active": "Nincs aktív lejátszás"
},
"tautulli": {
"playing": "Playing",
"transcoding": "Transcoding",
"bitrate": "Bitrate",
"no_active": "No Active Streams"
"playing": "Lejátszás folyamatban",
"transcoding": "Átkódolás",
"bitrate": "Bitráta",
"no_active": "Nincs aktív lejátszás"
},
"nzbget": {
"rate": "Rate",
"remaining": "Remaining",
"downloaded": "Downloaded"
"rate": "Ráta",
"remaining": "Hátralévő",
"downloaded": "Letöltött"
},
"sabnzbd": {
"rate": "Rate",
"queue": "Queue",
"timeleft": "Time Left"
"rate": "Ráta",
"queue": "Sor",
"timeleft": "Hátralévő idő"
},
"rutorrent": {
"active": "Active",
"upload": "Upload",
"download": "Download"
"active": "Aktív",
"upload": "Feltöltés",
"download": "Letöltés"
},
"transmission": {
"leech": "Leech",
"seed": "Seed",
"download": "Download",
"upload": "Upload"
"leech": "Leechelés",
"seed": "Seedelés",
"download": "Letöltés",
"upload": "Feltöltés"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
"download": "Letöltés",
"upload": "Feltöltés",
"leech": "Leechelés",
"seed": "Seedelés"
},
"sonarr": {
"wanted": "Wanted",
"queued": "Queued",
"series": "Series"
"wanted": "Keresett",
"queued": "Sorban áll",
"series": "Sorozat"
},
"radarr": {
"wanted": "Wanted",
"queued": "Queued",
"movies": "Movies"
"wanted": "Keresett",
"queued": "Sorban áll",
"movies": "Filmek"
},
"ombi": {
"pending": "Pending",
"approved": "Approved",
"available": "Available"
"pending": "Függőben",
"approved": "Engedélyezett",
"available": "Elérhető"
},
"jellyseerr": {
"pending": "Pending",
"approved": "Approved",
"available": "Available"
"pending": "Függőben",
"approved": "Engedélyezett",
"available": "Elérhető"
},
"overseerr": {
"pending": "Pending",
"approved": "Approved",
"available": "Available"
"pending": "Függőben",
"approved": "Engedélyezett",
"available": "Elérhető"
},
"pihole": {
"queries": "Queries",
"blocked": "Blocked",
"gravity": "Gravity"
"queries": "Lekérdezések",
"blocked": "Blokkolt",
"gravity": "Gravitáció"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
"queries": "Lekérdezések",
"blocked": "Blokkolt",
"filtered": "Szűrt",
"latency": "Késleltetés"
},
"speedtest": {
"upload": "Upload",
"download": "Download",
"upload": "Feltöltés",
"download": "Letöltés",
"ping": "Ping"
},
"portainer": {
"running": "Running",
"stopped": "Stopped",
"total": "Total"
"running": "Futó",
"stopped": "Megállított",
"total": "Összes"
},
"traefik": {
"routers": "Routers",
"services": "Services",
"middleware": "Middleware"
"routers": "Routerek",
"services": "Folyamatok",
"middleware": "Közvetítő"
},
"npm": {
"enabled": "Enabled",
"disabled": "Disabled",
"total": "Total"
"enabled": "Bekapcsolva",
"disabled": "Kikapcsolva",
"total": "Összes"
},
"coinmarketcap": {
"configure": "Configure one or more crypto currencies to track",
"1hour": "1 Hour",
"1day": "1 Day",
"7days": "7 Days",
"30days": "30 Days"
"configure": "Állíts be egy vagy több Cryptovalutát a követéshez",
"1hour": "1 Óra",
"1day": "1 Nap",
"7days": "7 Nap",
"30days": "30 Nap"
},
"gotify": {
"apps": "Applications",
"clients": "Clients",
"messages": "Messages"
"apps": "Applikációk",
"clients": "Kliensek",
"messages": "Üzenetek"
},
"prowlarr": {
"enableIndexers": "Indexers",
"numberOfGrabs": "Grabs",
"numberOfFailGrabs": "Fail Grabs",
"numberOfQueries": "Queries",
"numberOfFailQueries": "Fail Queries"
"enableIndexers": "Indexerek",
"numberOfGrabs": "Fogott",
"numberOfFailGrabs": "Hibás fogások",
"numberOfQueries": "Lekérdezések",
"numberOfFailQueries": "Hibás lekérdezések"
},
"jackett": {
"configured": "Configured",
"errored": "Errored"
"configured": "Beállított",
"errored": "Hibás"
}
}

View File

@@ -110,10 +110,10 @@
},
"coinmarketcap": {
"configure": "配置一个或多个需要追踪的加密",
"1hour": "1 Hour",
"1day": "1 Day",
"7days": "7 Days",
"30days": "30 Days"
"1hour": "1小时",
"1day": "1",
"7days": "7",
"30days": "30"
},
"gotify": {
"apps": "应用",
@@ -121,41 +121,41 @@
"messages": "信息"
},
"prowlarr": {
"enableIndexers": "Indexers",
"numberOfGrabs": "Grabs",
"numberOfQueries": "Queries",
"numberOfFailGrabs": "Fail Grabs",
"numberOfFailQueries": "Fail Queries"
"enableIndexers": "索引器",
"numberOfGrabs": "抓取",
"numberOfQueries": "查询",
"numberOfFailGrabs": "抓取失败",
"numberOfFailQueries": "查询失败"
},
"transmission": {
"download": "下载",
"upload": "上传",
"leech": "Leech",
"leech": "吸血",
"seed": "做种"
},
"jackett": {
"configured": "Configured",
"errored": "Errored"
"configured": "已配置",
"errored": "出错了"
},
"bazarr": {
"missingEpisodes": "Missing Episodes",
"missingMovies": "Missing Movies"
"missingEpisodes": "缺少的剧集",
"missingMovies": "缺少的电影"
},
"lidarr": {
"wanted": "Wanted",
"queued": "Queued",
"albums": "Albums"
"wanted": "订阅",
"queued": "队列",
"albums": "相册"
},
"adguard": {
"queries": "Queries",
"blocked": "Blocked",
"filtered": "Filtered",
"latency": "Latency"
"queries": "查询",
"blocked": "阻止",
"filtered": "过滤",
"latency": "延迟"
},
"qbittorrent": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
"download": "下载",
"upload": "上传",
"leech": "吸血",
"seed": "做种"
}
}

View File

@@ -22,12 +22,6 @@ function resolveIcon(icon) {
}
export default function Item({ service }) {
const handleOnClick = () => {
if (service.href && service.href !== "#") {
window.open(service.href, "_blank").focus();
}
};
const hasLink = service.href && service.href !== "#";
return (
@@ -41,13 +35,9 @@ export default function Item({ service }) {
<div className="flex select-none">
{service.icon &&
(hasLink ? (
<button
type="button"
onClick={handleOnClick}
className="flex-shrink-0 flex items-center justify-center w-12 "
>
<a type="button" href={service.href} className="flex-shrink-0 flex items-center justify-center w-12 ">
<Image src={resolveIcon(service.icon)} width={32} height={32} alt="logo" />
</button>
</a>
) : (
<div className="flex-shrink-0 flex items-center justify-center w-12 ">
<Image src={resolveIcon(service.icon)} width={32} height={32} alt="logo" />
@@ -57,7 +47,7 @@ export default function Item({ service }) {
{hasLink ? (
<button
type="button"
onClick={handleOnClick}
href={service.href}
className="flex-1 flex items-center justify-between rounded-r-md "
>
<div className="flex-1 px-2 py-2 text-sm text-left">

View File

@@ -2,7 +2,7 @@
import useSWR from "swr";
import { useTranslation } from "react-i18next";
import { BsFillPlayFill, BsPauseFill, BsCpu, BsFillCpuFill } from "react-icons/bs";
import { MdOutlineSmartDisplay } from "react-icons/md";
import { MdOutlineSmartDisplay, MdSmartDisplay } from "react-icons/md";
import Widget from "../widget";
@@ -37,9 +37,16 @@ function SingleSessionEntry({ session }) {
<div className="absolute w-full whitespace-nowrap text-ellipsis overflow-hidden">{full_title}</div>
</div>
<div className="self-center text-xs flex justify-end mr-1.5 pl-1">
{video_decision === "direct play" && audio_decision === "direct play" && (
<MdSmartDisplay className="opacity-50" />
)}
{video_decision === "copy" && audio_decision === "copy" && <MdOutlineSmartDisplay className="opacity-50" />}
{video_decision !== "copy" && audio_decision !== "copy" && <BsFillCpuFill className="opacity-50" />}
{video_decision === "copy" && audio_decision !== "copy" && <BsCpu className="opacity-50" />}
{video_decision !== "copy" &&
video_decision !== "direct play" &&
(audio_decision !== "copy" || audio_decision !== "direct play") && <BsFillCpuFill className="opacity-50" />}
{(video_decision === "copy" || video_decision === "direct play") &&
audio_decision !== "copy" &&
audio_decision !== "direct play" && <BsCpu className="opacity-50" />}
</div>
</div>
@@ -92,9 +99,16 @@ function SessionEntry({ session }) {
<div className="absolute w-full whitespace-nowrap text-ellipsis overflow-hidden">{full_title}</div>
</div>
<div className="self-center text-xs flex justify-end mr-1.5 pl-1 z-10">
{video_decision === "direct play" && audio_decision === "direct play" && (
<MdSmartDisplay className="opacity-50" />
)}
{video_decision === "copy" && audio_decision === "copy" && <MdOutlineSmartDisplay className="opacity-50" />}
{video_decision !== "copy" && audio_decision !== "copy" && <BsFillCpuFill className="opacity-50" />}
{video_decision === "copy" && audio_decision !== "copy" && <BsCpu className="opacity-50" />}
{video_decision !== "copy" &&
video_decision !== "direct play" &&
(audio_decision !== "copy" || audio_decision !== "direct play") && <BsFillCpuFill className="opacity-50" />}
{(video_decision === "copy" || video_decision === "direct play") &&
audio_decision !== "copy" &&
audio_decision !== "direct play" && <BsCpu className="opacity-50" />}
</div>
<div className="self-center text-xs flex justify-end mr-2 z-10">{millisecondsToString(view_offset)}</div>
</div>

View File

@@ -23,7 +23,7 @@ function jsonArrayTransform(data, transform) {
}
function jsonArrayFilter(data, filter) {
return jsonArrayTransform(data, items => items.filter(filter));
return jsonArrayTransform(data, (items) => items.filter(filter));
}
const serviceProxyHandlers = {
@@ -36,8 +36,8 @@ const serviceProxyHandlers = {
maps: {
movie: (data) => ({
wanted: jsonArrayFilter(data, (item) => item.isAvailable === false).length,
have: jsonArrayFilter(data, (item) => item.isAvailable === true).length
})
have: jsonArrayFilter(data, (item) => item.isAvailable === true).length,
}),
},
},
sonarr: {
@@ -52,7 +52,7 @@ const serviceProxyHandlers = {
proxy: genericProxyHandler,
maps: {
album: (data) => ({
have: jsonArrayFilter(data, (item) => item.statistics.percentOfTracks === 100).length,
have: jsonArrayFilter(data, (item) => item?.statistics?.percentOfTracks === 100).length,
}),
},
},
@@ -60,7 +60,7 @@ const serviceProxyHandlers = {
proxy: genericProxyHandler,
maps: {
book: (data) => ({
have: jsonArrayFilter(data, (item) => item.statistics.bookFileCount > 0).length,
have: jsonArrayFilter(data, (item) => item?.statistics?.bookFileCount > 0).length,
}),
},
},

View File

@@ -0,0 +1,9 @@
import checkAndCopyConfig from "utils/config";
const configs = ["docker.yaml", "settings.yaml", "services.yaml", "bookmarks.yaml"];
export default async function handler(req, res) {
const errors = configs.map((config) => checkAndCopyConfig(config)).filter((status) => status !== true);
res.send(errors);
}

View File

@@ -14,7 +14,7 @@ export default async function handler(req, res) {
}
if (!apiKey && provider) {
const settings = await getSettings();
const settings = getSettings();
apiKey = settings?.providers?.openweathermap;
}

View File

@@ -14,7 +14,7 @@ export default async function handler(req, res) {
}
if (!apiKey && provider) {
const settings = await getSettings();
const settings = getSettings();
apiKey = settings?.providers?.weatherapi;
}

View File

@@ -4,6 +4,7 @@ import Head from "next/head";
import dynamic from "next/dynamic";
import { useTranslation } from "react-i18next";
import { useEffect, useContext } from "react";
import { BiError } from "react-icons/bi";
import ServicesGroup from "components/services/group";
import BookmarksGroup from "components/bookmarks/group";
@@ -23,17 +24,54 @@ const ColorToggle = dynamic(() => import("components/color-toggle"), {
const rightAlignedWidgets = ["weatherapi", "openweathermap", "weather", "search", "datetime"];
export async function getStaticProps() {
const settings = await getSettings();
return {
props: {
settings,
},
};
export function getStaticProps() {
try {
const settings = getSettings();
return {
props: {
settings,
},
};
} catch (e) {
return {
props: {
settings: {},
},
};
}
}
export default function Home({ settings }) {
export default function Index({ settings }) {
const { data: errorsData } = useSWR("/api/validate");
if (errorsData && errorsData.length > 0) {
return (
<div className="w-full container m-auto justify-center p-10">
<div className="flex flex-col">
{errorsData.map((error, i) => (
<div
className="basis-1/2 bg-theme-500 dark:bg-theme-600 text-theme-600 dark:text-theme-300 m-2 rounded-md font-mono shadow-md border-4 border-transparent"
key={i}
>
<div className="bg-amber-200 text-amber-800 dark:text-amber-200 dark:bg-amber-800 p-2 rounded-md font-bold">
<BiError className="float-right w-6 h-6" />
{error.config}
</div>
<div className="p-2 text-theme-100 dark:text-theme-200">
<pre className="opacity-50 font-bold pb-2">{error.reason}</pre>
<pre className="text-sm">{error.mark.snippet}</pre>
</div>
</div>
))}
</div>
</div>
);
}
return <Home settings={settings} />;
}
function Home({ settings }) {
const { i18n } = useTranslation();
const { theme, setTheme } = useContext(ThemeContext);
const { color, setColor } = useContext(ColorContext);

View File

@@ -1,3 +1,4 @@
---
# For configuration options and examples, please see:
# https://github.com/benphelps/homepage/wiki/Bookmarks

View File

@@ -1,9 +1,10 @@
---
# For configuration options and examples, please see:
# https://github.com/benphelps/homepage/wiki/Docker-Integration
my-docker:
host: 127.0.0.1
port: 2375
# my-docker:
# host: 127.0.0.1
# port: 2375
other-docker:
socket: /var/run/docker.sock
# my-docker:
# socket: /var/run/docker.sock

View File

@@ -1,3 +1,4 @@
---
# For configuration options and examples, please see:
# https://github.com/benphelps/homepage/wiki/Services

View File

@@ -1,3 +1,4 @@
---
# For configuration options and examples, please see:
# https://github.com/benphelps/homepage/wiki/Settings

View File

@@ -1,3 +1,4 @@
---
# For configuration options and examples, please see:
# https://github.com/benphelps/homepage/wiki/Information-Widgets

View File

@@ -1,6 +1,6 @@
/* eslint-disable no-console */
import { join } from "path";
import { existsSync, copyFile, promises as fs } from "fs";
import { existsSync, copyFile, readFileSync } from "fs";
import yaml from "js-yaml";
@@ -15,13 +15,22 @@ export default function checkAndCopyConfig(config) {
}
console.info("%s was copied to the config folder", config);
});
return true;
}
try {
yaml.load(readFileSync(configYaml, "utf8"));
return true;
} catch (e) {
return { ...e, config };
}
}
export async function getSettings() {
export function getSettings() {
checkAndCopyConfig("settings.yaml");
const settingsYaml = join(process.cwd(), "config", "settings.yaml");
const fileContents = await fs.readFile(settingsYaml, "utf8");
const fileContents = readFileSync(settingsYaml, "utf8");
return yaml.load(fileContents);
}