Compare commits

...

12 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
19 changed files with 385 additions and 171 deletions

View File

@@ -9,7 +9,7 @@
- Images built for AMD64 (x86_64), ARM64, ARMv7 and ARMv6 - Images built for AMD64 (x86_64), ARM64, ARMv7 and ARMv6
- Supports all Raspberry Pi's, most SBCs & Apple Silicon - Supports all Raspberry Pi's, most SBCs & Apple Silicon
- Full i18n support with automatic language detection - 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/) - Want to help translate? [Join the Weblate project](https://hosted.weblate.org/engage/homepage/)
- Service & Web Bookmarks - Service & Web Bookmarks
- Docker Integration - Docker Integration
@@ -139,3 +139,5 @@ Huge thanks to the all the contributors who have helped make this project what i
- [SuperDOS](https://github.com/benphelps/homepage/commits?author=SuperDOS) - Swedish Translation - [SuperDOS](https://github.com/benphelps/homepage/commits?author=SuperDOS) - Swedish Translation
- [xicopitz](https://github.com/benphelps/homepage/commits?author=xicopitz) - Gotify & Prowlarr Integration - [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 - [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": { "pihole": {
"queries": "Consultes", "queries": "Consultes",
"blocked": "Bloquejat", "blocked": "Bloquejat",
"gravity": "Gravetat" "gravity": "Gravity"
}, },
"portainer": { "portainer": {
"running": "Executant", "running": "Executant",
@@ -147,14 +147,14 @@
"albums": "Àlbums" "albums": "Àlbums"
}, },
"adguard": { "adguard": {
"queries": "Queries", "queries": "Consultes",
"blocked": "Blocked", "blocked": "Bloquejat",
"filtered": "Filtered", "filtered": "Filtrat",
"latency": "Latency" "latency": "Latència"
}, },
"qbittorrent": { "qbittorrent": {
"download": "Download", "download": "Descàrrega",
"upload": "Upload", "upload": "Càrrega",
"leech": "Leech", "leech": "Leech",
"seed": "Seed" "seed": "Seed"
} }

View File

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

View File

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

View File

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

View File

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

View File

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

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) { if (!apiKey && provider) {
const settings = await getSettings(); const settings = getSettings();
apiKey = settings?.providers?.openweathermap; apiKey = settings?.providers?.openweathermap;
} }

View File

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

View File

@@ -4,6 +4,7 @@ import Head from "next/head";
import dynamic from "next/dynamic"; import dynamic from "next/dynamic";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useEffect, useContext } from "react"; import { useEffect, useContext } from "react";
import { BiError } from "react-icons/bi";
import ServicesGroup from "components/services/group"; import ServicesGroup from "components/services/group";
import BookmarksGroup from "components/bookmarks/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"]; const rightAlignedWidgets = ["weatherapi", "openweathermap", "weather", "search", "datetime"];
export async function getStaticProps() { export function getStaticProps() {
const settings = await getSettings(); try {
const settings = getSettings();
return { return {
props: { props: {
settings, 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 { i18n } = useTranslation();
const { theme, setTheme } = useContext(ThemeContext); const { theme, setTheme } = useContext(ThemeContext);
const { color, setColor } = useContext(ColorContext); const { color, setColor } = useContext(ColorContext);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
/* eslint-disable no-console */ /* eslint-disable no-console */
import { join } from "path"; import { join } from "path";
import { existsSync, copyFile, promises as fs } from "fs"; import { existsSync, copyFile, readFileSync } from "fs";
import yaml from "js-yaml"; import yaml from "js-yaml";
@@ -15,13 +15,22 @@ export default function checkAndCopyConfig(config) {
} }
console.info("%s was copied to the config folder", 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"); checkAndCopyConfig("settings.yaml");
const settingsYaml = join(process.cwd(), "config", "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); return yaml.load(fileContents);
} }