Compare commits

...

11 Commits

Author SHA1 Message Date
Ben Phelps
330575bab3 fix links 2022-09-18 18:49:50 +03:00
Ben Phelps
30ec4aed28 Translated using Weblate (Dutch)
Currently translated at 58.3% (63 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/nl/
2022-09-18 16:53:21 +02:00
Ben Phelps
ee456fd8e5 Translated using Weblate (Italian)
Currently translated at 71.2% (77 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/it/
2022-09-18 16:53:21 +02:00
Ben Phelps
ed25c8a84b 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 16:53:21 +02:00
Ben Phelps
b0a45fe09c Translated using Weblate (Russian)
Currently translated at 21.2% (23 of 108 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ru/
2022-09-18 16:53:20 +02:00
Nonoss117
50f0f46ad9 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 16:53:20 +02:00
Ben Phelps
bd61d459ad 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 16:53:20 +02:00
Ben Phelps
4f73c60d37 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 16:53:20 +02:00
Ben Phelps
7c536f0cb0 update attribution sorting 2022-09-18 17:05:31 +03:00
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
19 changed files with 115 additions and 56 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
@@ -120,8 +120,10 @@ Huge thanks to the all the contributors who have helped make this project what i
- [aidenpwnz](https://github.com/benphelps/homepage/commits?author=aidenpwnz) - Nginx Proxy Manager, Search Bar Widget
- [AlexFullmoon](https://github.com/benphelps/homepage/commits?author=AlexFullmoon) - OpenWeatherMap Widget
- [AmadeusGraves](https://github.com/benphelps/homepage/commits?author=AmadeusGraves) - Spanish Translation
- [andrii-kryvoviaz](https://github.com/benphelps/homepage/commits?author=andrii-kryvoviaz) - Background opacity option
- [boerniee](https://github.com/benphelps/homepage/commits?author=boerniee) - German Translation
- [comradekingu](https://github.com/benphelps/homepage/commits?author=comradekingu) - Norwegian Bokmål Translation
- [Daniel Varga] - German & Hungarian Translation
- [deffcolony](https://github.com/benphelps/homepage/commits?author=deffcolony) - Dutch Translation
- [desolaris](https://github.com/benphelps/homepage/commits?author=desolaris) - Russian Translation
- [ilusi0n](https://github.com/benphelps/homepage/commits?author=ilusi0n) - Jellyseerr Integration
@@ -136,6 +138,6 @@ Huge thanks to the all the contributors who have helped make this project what i
- [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
- [ShlomiPorush](https://github.com/benphelps/homepage/commits?author=ShlomiPorush) - Hebrew Translation
- [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

View File

@@ -24,7 +24,7 @@
"playing": "Spielen",
"transcoding": "Transcodierung",
"bitrate": "Bitrate",
"no_active": "Keine aktiven streamen"
"no_active": "Keine aktive Streams"
},
"tautulli": {
"playing": "Spielen",

View File

@@ -88,8 +88,8 @@
"total": "Total"
},
"weather": {
"current": "Ubicación actual",
"allow": "Haga clic para permitir",
"current": "Localización Actual",
"allow": "Clic para permitir",
"updating": "Actualizando",
"wait": "Espere, por favor"
},

View File

@@ -69,7 +69,7 @@
},
"speedtest": {
"upload": "Envoi",
"download": "Récept.",
"download": "Récep.",
"ping": "Ping"
},
"portainer": {
@@ -164,7 +164,7 @@
"latency": "Latence"
},
"qbittorrent": {
"download": "Réception",
"download": "Récep.",
"upload": "Envoi",
"leech": "Leech",
"seed": "Seed"

View File

@@ -99,14 +99,14 @@
"available": "Disponibili"
},
"sabnzbd": {
"rate": "Rate",
"queue": "Queue",
"timeleft": "Time Left"
"rate": "Rapporto",
"queue": "Coda",
"timeleft": "Tempo Rimanente"
},
"nzbget": {
"rate": "Rate",
"remaining": "Remaining",
"downloaded": "Downloaded"
"rate": "Rapporto",
"remaining": "Rimanente",
"downloaded": "Scaricato"
},
"coinmarketcap": {
"configure": "Configure one or more crypto currencies to track",
@@ -116,9 +116,9 @@
"30days": "30 Days"
},
"gotify": {
"apps": "Applications",
"apps": "Applicazioni",
"clients": "Clients",
"messages": "Messages"
"messages": "Messaggi"
},
"prowlarr": {
"enableIndexers": "Indexers",

View File

@@ -40,7 +40,7 @@
"playing": "Afspelen",
"transcoding": "Transcodering",
"bitrate": "Bitsnelheid",
"no_active": "No Active Streams"
"no_active": "Geen Actieve Steams"
},
"tautulli": {
"playing": "Afspelen",

View File

@@ -113,7 +113,7 @@
"1hour": "1 Hour",
"1day": "1 Day",
"7days": "7 Days",
"30days": "30 Days"
"30days": "30 Дней"
},
"gotify": {
"apps": "Applications",

View File

@@ -21,13 +21,13 @@
"offline": "离线"
},
"emby": {
"playing": "正在播放",
"playing": "播放",
"transcoding": "转码",
"bitrate": "比特率",
"no_active": "暂无播放"
},
"tautulli": {
"playing": "正在播放",
"playing": "播放",
"transcoding": "转码",
"bitrate": "比特率",
"no_active": "暂无播放"
@@ -38,12 +38,12 @@
"download": "下载"
},
"sonarr": {
"wanted": "通缉",
"wanted": "想看",
"queued": "排队",
"series": "系列"
},
"radarr": {
"wanted": "订阅",
"wanted": "想看",
"queued": "队列",
"movies": "电影"
},
@@ -74,7 +74,7 @@
},
"portainer": {
"running": "运行中",
"stopped": "停止",
"stopped": "停止",
"total": "总计"
},
"traefik": {
@@ -91,7 +91,7 @@
"current": "当前定位",
"allow": "点击并允许",
"updating": "更新中",
"wait": "请等待"
"wait": "请稍后"
},
"overseerr": {
"pending": "待办",

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,14 @@ export default function Item({ service }) {
<div className="flex select-none">
{service.icon &&
(hasLink ? (
<button
type="button"
onClick={handleOnClick}
<a
href={service.href}
target="_blank"
rel="noreferrer"
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" />
@@ -55,16 +50,17 @@ export default function Item({ service }) {
))}
{hasLink ? (
<button
type="button"
onClick={handleOnClick}
<a
href={service.href}
target="_blank"
rel="noreferrer"
className="flex-1 flex items-center justify-between rounded-r-md "
>
<div className="flex-1 px-2 py-2 text-sm text-left">
{service.name}
<p className="text-theme-500 dark:text-theme-400 text-xs font-extralight">{service.description}</p>
</div>
</button>
</a>
) : (
<div 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

@@ -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);
}