Compare commits

..

35 Commits

Author SHA1 Message Date
Ben Phelps
79e5ff2fea fix linting 2022-09-14 09:23:21 +03:00
Ben Phelps
7f91fe59e2 allow setting base and favicon 2022-09-14 09:11:55 +03:00
Ben Phelps
b40dad3d3e remove unused package 2022-09-14 09:11:44 +03:00
Anonymous
f9f816845f Translated using Weblate (Chinese (Traditional))
Currently translated at 9.6% (9 of 93 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/zh_Hant/
2022-09-14 08:10:06 +02:00
Anonymous
193b58d0fc Translated using Weblate (Dutch)
Currently translated at 66.6% (62 of 93 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/nl/
2022-09-14 08:10:05 +02:00
Anonymous
b7f490544a Translated using Weblate (Vietnamese)
Currently translated at 35.4% (33 of 93 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/vi/
2022-09-14 08:10:05 +02:00
Anonymous
5d85e3c0e2 Translated using Weblate (Norwegian Bokmål)
Currently translated at 84.9% (79 of 93 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/nb_NO/
2022-09-14 08:10:05 +02:00
Anonymous
75214c345a Translated using Weblate (Italian)
Currently translated at 74.1% (69 of 93 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/it/
2022-09-14 08:10:04 +02:00
Anonymous
6d55e74ae4 Translated using Weblate (Chinese (Simplified))
Currently translated at 86.0% (80 of 93 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/zh_Hans/
2022-09-14 08:10:04 +02:00
Anonymous
710f979f94 Translated using Weblate (Russian)
Currently translated at 13.9% (13 of 93 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/ru/
2022-09-14 08:10:04 +02:00
Anonymous
c2a036c526 Translated using Weblate (Portuguese)
Currently translated at 94.6% (88 of 93 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/pt/
2022-09-14 08:10:04 +02:00
Anonymous
a6c52df4cb Translated using Weblate (French)
Currently translated at 95.6% (89 of 93 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/fr/
2022-09-14 08:10:03 +02:00
Anonymous
4d1ad16ea2 Translated using Weblate (Spanish)
Currently translated at 95.6% (89 of 93 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/es/
2022-09-14 08:10:03 +02:00
Anonymous
94c093ea57 Translated using Weblate (German)
Currently translated at 68.8% (64 of 93 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/de/
2022-09-14 08:10:03 +02:00
Francisco Coelho
acd421c617 Translated using Weblate (Portuguese)
Currently translated at 98.8% (88 of 89 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/pt/
2022-09-14 08:09:57 +02:00
Nonoss117
4d2004c8c9 Translated using Weblate (French)
Currently translated at 100.0% (89 of 89 strings)

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

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/es/
2022-09-14 08:09:57 +02:00
Ben Phelps
794938c525 Merge branch 'ItsJustMeChris-main' 2022-09-14 09:09:39 +03:00
Ben Phelps
62188ffdc7 cleanup 2022-09-14 09:09:11 +03:00
Chris McGravey
34f7bd4341 Merge remote-tracking branch 'origin/main' 2022-09-13 17:29:35 -05:00
Chris McGravey
6b45825472 translate 2022-09-13 17:29:02 -05:00
Ben Phelps
b81a5d1e51 Update common.json 2022-09-14 01:15:06 +03:00
Ben Phelps
5d9e90f033 Update common.json 2022-09-14 01:14:42 +03:00
Ben Phelps
55a3e6880b Update common.json 2022-09-14 01:14:20 +03:00
Ben Phelps
beee9ecd84 Update common.json 2022-09-14 01:14:00 +03:00
Ben Phelps
b94d7a4ae8 Update common.json 2022-09-14 01:13:46 +03:00
Ben Phelps
331999c1a4 Update common.json 2022-09-14 01:13:08 +03:00
Ben Phelps
e5db1ec848 Update common.json 2022-09-14 01:12:50 +03:00
Ben Phelps
17d7161374 Update common.json 2022-09-14 01:12:13 +03:00
Ben Phelps
06d4f2b9f3 Update common.json 2022-09-14 01:11:55 +03:00
Ben Phelps
4b69fdefef Update common.json 2022-09-14 01:11:30 +03:00
Ben Phelps
13db31ede0 Update common.json 2022-09-14 01:11:00 +03:00
Ben Phelps
22a073ba1a Update common.json 2022-09-14 01:10:38 +03:00
Ben Phelps
ce9c115f3d Update common.json 2022-09-14 01:10:11 +03:00
Chris McGravey
767aa9b3e1 Update CoinMarketCap widget to have time selector 2022-09-13 15:35:53 -05:00
20 changed files with 181 additions and 72 deletions

View File

@@ -12,7 +12,6 @@
"@headlessui/react": "^1.7.0",
"@tailwindcss/forms": "^0.5.3",
"classnames": "^2.3.1",
"currency-symbol-map": "^5.1.0",
"dockerode": "^3.3.4",
"i18next": "^21.9.1",
"i18next-browser-languagedetector": "^6.1.5",

6
pnpm-lock.yaml generated
View File

@@ -5,7 +5,6 @@ specifiers:
'@tailwindcss/forms': ^0.5.3
autoprefixer: ^10.4.9
classnames: ^2.3.1
currency-symbol-map: ^5.1.0
dockerode: ^3.3.4
eslint: ^8.23.1
eslint-config-airbnb: ^19.0.4
@@ -42,7 +41,6 @@ dependencies:
'@headlessui/react': 1.7.0_biqbaboplfbrettd7655fr4n2y
'@tailwindcss/forms': 0.5.3_tailwindcss@3.1.8
classnames: 2.3.1
currency-symbol-map: 5.1.0
dockerode: 3.3.4
i18next: 21.9.1
i18next-browser-languagedetector: 6.1.5
@@ -706,10 +704,6 @@ packages:
engines: {node: '>=4'}
hasBin: true
/currency-symbol-map/5.1.0:
resolution: {integrity: sha512-LO/lzYRw134LMDVnLyAf1dHE5tyO6axEFkR3TXjQIOmMkAM9YL6QsiUwuXzZAmFnuDJcs4hayOgyIYtViXFrLw==}
dev: false
/damerau-levenshtein/1.0.8:
resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==}
dev: true

View File

@@ -109,7 +109,11 @@
"downloaded": "Downloaded"
},
"coinmarketcap": {
"configure": "Configure one or more crypto currencies to track"
"configure": "Configure one or more crypto currencies to track",
"1hour": "1 Hour",
"1day": "1 Day",
"7days": "7 Days",
"30days": "30 Days"
},
"gotify": {
"apps": "Applications",

View File

@@ -126,7 +126,11 @@
"total": "Total"
},
"coinmarketcap": {
"configure": "Configure one or more crypto currencies to track"
"configure": "Configure one or more crypto currencies to track",
"1hour": "1 Hour",
"1day": "1 Day",
"7days": "7 Days",
"30days": "30 Days"
},
"gotify": {
"apps": "Applications",

View File

@@ -11,7 +11,7 @@
"total": "Total",
"free": "Libre",
"used": "Usado",
"load": "Load"
"load": "Carga"
},
"docker": {
"rx": "Recibido",
@@ -34,8 +34,8 @@
},
"rutorrent": {
"active": "Activo",
"upload": "Subir",
"download": "Descargar"
"upload": "Subida",
"download": "Descarga"
},
"sonarr": {
"wanted": "Más deseado",
@@ -69,7 +69,7 @@
},
"speedtest": {
"upload": "Subir",
"download": "Descargar",
"download": "Descarga",
"ping": "Ping"
},
"portainer": {
@@ -109,7 +109,11 @@
"downloaded": "Descargado"
},
"coinmarketcap": {
"configure": "Configurar una o varias criptomonedas para su seguimiento"
"configure": "Configurar una o varias criptomonedas para su seguimiento",
"1hour": "1 Hour",
"1day": "1 Day",
"7days": "7 Days",
"30days": "30 Days"
},
"gotify": {
"apps": "Aplicaciones",
@@ -117,16 +121,16 @@
"messages": "Mensajes"
},
"prowlarr": {
"enableIndexers": "Indexers",
"numberOfGrabs": "Grabs",
"numberOfQueries": "Queries",
"numberOfFailGrabs": "Fail Grabs",
"numberOfFailQueries": "Fail Queries"
"enableIndexers": "Indexadores",
"numberOfGrabs": "Capturas",
"numberOfQueries": "Consultas",
"numberOfFailGrabs": "Capturas Fallidas",
"numberOfFailQueries": "Consultas Fallidas"
},
"transmission": {
"download": "Download",
"upload": "Upload",
"leech": "Leech",
"seed": "Seed"
"download": "Descarga",
"upload": "Subida",
"leech": "Egoístas (Leech)",
"seed": "Semillas"
}
}

View File

@@ -120,7 +120,11 @@
"rate": "Évaluer"
},
"coinmarketcap": {
"configure": "Configurer une ou plusieurs crypto-monnaies à suivre"
"configure": "Configurer une ou plusieurs crypto-monnaies à suivre",
"1hour": "1 Hour",
"1day": "1 Day",
"7days": "7 Days",
"30days": "30 Days"
},
"gotify": {
"apps": "Applications",
@@ -135,8 +139,8 @@
"numberOfFailQueries": "Demande échouée"
},
"transmission": {
"download": "Download",
"upload": "Upload",
"download": "Réception",
"upload": "Envoi",
"leech": "Leech",
"seed": "Seed"
}

View File

@@ -109,7 +109,11 @@
"downloaded": "Downloaded"
},
"coinmarketcap": {
"configure": "Configure one or more crypto currencies to track"
"configure": "Configure one or more crypto currencies to track",
"1day": "1 Day",
"7days": "7 Days",
"1hour": "1 Hour",
"30days": "30 Days"
},
"gotify": {
"apps": "Applications",

View File

@@ -109,7 +109,11 @@
"remaining": "Gjenstående"
},
"coinmarketcap": {
"configure": "Sett opp én eller flere kryptovalutaer å holde øye med"
"configure": "Sett opp én eller flere kryptovalutaer å holde øye med",
"1hour": "1 Hour",
"1day": "1 Day",
"7days": "7 Days",
"30days": "30 Days"
},
"gotify": {
"apps": "Programmer",

View File

@@ -109,7 +109,11 @@
"downloaded": "Downloaded"
},
"coinmarketcap": {
"configure": "Configure one or more crypto currencies to track"
"configure": "Configure one or more crypto currencies to track",
"1hour": "1 Hour",
"7days": "7 Days",
"1day": "1 Day",
"30days": "30 Days"
},
"gotify": {
"apps": "Applications",

View File

@@ -1,6 +1,6 @@
{
"widget": {
"missing_type": "Tipo de widget ausente: {{type}}",
"missing_type": "Widget ausente: {{type}}",
"api_error": "Erro da API",
"status": "Status"
},
@@ -10,7 +10,7 @@
"resources": {
"total": "Total",
"free": "Livre",
"used": "Usada",
"used": "Usado",
"load": "Load"
},
"docker": {
@@ -18,22 +18,22 @@
"tx": "Tx",
"mem": "Mem",
"cpu": "CPU",
"offline": "Desligada"
"offline": "Desligado"
},
"emby": {
"playing": "A reproduzir",
"transcoding": "Transcodificação",
"bitrate": "Taxa de bits",
"no_active": "No Active Streams"
"bitrate": "Bitrate",
"no_active": "Sem streams ativas"
},
"tautulli": {
"playing": "Reproduzindo",
"transcoding": "Transcodificação",
"bitrate": "Taxa de bits",
"no_active": "No Active Streams"
"no_active": "Sem streams ativas"
},
"rutorrent": {
"active": "Ativa",
"active": "Ativo",
"upload": "Envio",
"download": "ReceçãoDownload"
},
@@ -44,13 +44,13 @@
},
"radarr": {
"wanted": "Desejado",
"queued": "Enfileiradas",
"queued": "Fila",
"movies": "Filmes"
},
"readarr": {
"wanted": "Wanted",
"queued": "Queued",
"books": "Books"
"queued": "Em fila",
"books": "Livros"
},
"ombi": {
"pending": "Pendente",
@@ -65,7 +65,7 @@
"pihole": {
"queries": "Consultas",
"blocked": "Bloqueado",
"gravity": "Gravidade"
"gravity": "Gravity"
},
"speedtest": {
"upload": "Envio",
@@ -73,18 +73,18 @@
"ping": "Ping"
},
"portainer": {
"running": "Corrida",
"stopped": "Parou",
"running": "A correr",
"stopped": "Parado",
"total": "Total"
},
"traefik": {
"routers": "Roteadores",
"routers": "Routers",
"services": "Serviços",
"middleware": "Middleware"
},
"npm": {
"enabled": "Habilitada",
"disabled": "Desabilitada",
"enabled": "Ativo",
"disabled": "Desabilitado",
"total": "Total"
},
"common": {
@@ -105,22 +105,26 @@
"wait": "Por favor aguarde"
},
"overseerr": {
"pending": "Pending",
"approved": "Approved",
"available": "Available"
"pending": "Pendente",
"approved": "Aprovado",
"available": "Disponível"
},
"sabnzbd": {
"rate": "Rate",
"queue": "Queue",
"timeleft": "Time Left"
"queue": "Fila",
"timeleft": "Tempo restante"
},
"nzbget": {
"rate": "Rate",
"remaining": "Remaining",
"remaining": "Restante",
"downloaded": "Downloaded"
},
"coinmarketcap": {
"configure": "Configure one or more crypto currencies to track"
"configure": "Configurar uma ou mais moedas",
"1hour": "1 Hour",
"1day": "1 Day",
"7days": "7 Days",
"30days": "30 Days"
},
"gotify": {
"apps": "Aplicações",
@@ -131,12 +135,12 @@
"enableIndexers": "Indexers",
"numberOfGrabs": "Grabs",
"numberOfQueries": "Queries",
"numberOfFailGrabs": "Fail Grabs",
"numberOfFailQueries": "Fail Queries"
"numberOfFailGrabs": "Falhados",
"numberOfFailQueries": "Pesquisas falhadas"
},
"transmission": {
"download": "Download",
"upload": "Upload",
"upload": "Envio",
"leech": "Leech",
"seed": "Seed"
}

View File

@@ -109,7 +109,11 @@
"downloaded": "Downloaded"
},
"coinmarketcap": {
"configure": "Configure one or more crypto currencies to track"
"configure": "Configure one or more crypto currencies to track",
"1hour": "1 Hour",
"1day": "1 Day",
"7days": "7 Days",
"30days": "30 Days"
},
"gotify": {
"apps": "Applications",

View File

@@ -109,7 +109,11 @@
"downloaded": "Downloaded"
},
"coinmarketcap": {
"configure": "Configure one or more crypto currencies to track"
"configure": "Configure one or more crypto currencies to track",
"1hour": "1 Hour",
"1day": "1 Day",
"7days": "7 Days",
"30days": "30 Days"
},
"gotify": {
"apps": "Applications",

View File

@@ -109,7 +109,11 @@
"downloaded": "下载"
},
"coinmarketcap": {
"configure": "配置一个或多个需要追踪的加密"
"configure": "配置一个或多个需要追踪的加密",
"1hour": "1 Hour",
"1day": "1 Day",
"7days": "7 Days",
"30days": "30 Days"
},
"gotify": {
"apps": "应用",

View File

@@ -114,7 +114,11 @@
"total": "Total"
},
"coinmarketcap": {
"configure": "Configure one or more crypto currencies to track"
"configure": "Configure one or more crypto currencies to track",
"1hour": "1 Hour",
"1day": "1 Day",
"7days": "7 Days",
"30days": "30 Days"
},
"prowlarr": {
"enableIndexers": "Indexers",

View File

@@ -0,0 +1,48 @@
import { Fragment } from "react";
import { Menu, Transition } from "@headlessui/react";
import { BiCog } from "react-icons/bi";
import classNames from "classnames";
export default function Dropdown({ options, value, setValue }) {
return (
<Menu as="div" className="relative inline-block text-left">
<div>
<Menu.Button className="text-xs inline-flex w-full items-center rounded bg-theme-200/50 dark:bg-theme-900/20 px-3 py-1.5">
{options.find((option) => option.value === value).label}
<BiCog className="-mr-1 ml-2 h-4 w-4" aria-hidden="true" />
</Menu.Button>
</div>
<Transition
as={Fragment}
enter="transition ease-out duration-100"
enterFrom="transform opacity-0 scale-95"
enterTo="transform opacity-100 scale-100"
leave="transition ease-in duration-75"
leaveFrom="transform opacity-100 scale-100"
leaveTo="transform opacity-0 scale-95"
>
<Menu.Items className="absolute right-0 z-10 mt-2 w-56 origin-top-right rounded-md bg-theme-200/50 dark:bg-theme-900/50 backdrop-blur shadow-md focus:outline-none text-theme-700 dark:text-theme-200">
<div className="py-1">
{options.map((option) => (
<Menu.Item key={option.value} as={Fragment}>
<button
onClick={() => {
setValue(option.value);
}}
type="button"
className={classNames(
value === option.value ? "bg-theme-300/40 dark:bg-theme-900/40" : "",
"w-full block px-3 py-1.5 text-sm hover:bg-theme-300/70 hover:dark:bg-theme-900/70 text-left"
)}
>
{option.label}
</button>
</Menu.Item>
))}
</div>
</Menu.Items>
</Transition>
</Menu>
);
}

View File

@@ -45,7 +45,7 @@ const widgetMappings = {
npm: Npm,
tautulli: Tautulli,
gotify: Gotify,
prowlarr: Prowlarr
prowlarr: Prowlarr,
};
export default function Widget({ service }) {

View File

@@ -1,15 +1,26 @@
import useSWR from "swr";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import getSymbolFromCurrency from "currency-symbol-map";
import classNames from "classnames";
import Widget from "../widget";
import Block from "../block";
import Dropdown from "components/services/dropdown";
import { formatApiUrl } from "utils/api-helpers";
export default function CoinMarketCap({ service }) {
const { t } = useTranslation();
const dateRangeOptions = [
{ label: t("coinmarketcap.1hour"), value: "1h" },
{ label: t("coinmarketcap.1day"), value: "24h" },
{ label: t("coinmarketcap.7days"), value: "7d" },
{ label: t("coinmarketcap.30days"), value: "30d" },
];
const [dateRange, setDateRange] = useState(dateRangeOptions[0].value);
const config = service.widget;
const currencyCode = config.currency ?? "USD";
const { symbols } = config;
@@ -30,7 +41,7 @@ export default function CoinMarketCap({ service }) {
return <Widget error={t("widget.api_error")} />;
}
if (!statsData) {
if (!statsData || !dateRange) {
return (
<Widget>
<Block value={t("coinmarketcap.configure")} />
@@ -39,28 +50,36 @@ export default function CoinMarketCap({ service }) {
}
const { data } = statsData;
const currencySymbol = getSymbolFromCurrency(currencyCode);
return (
<Widget>
<div className={classNames(service.description ? "-top-10" : "-top-8", "absolute right-1")}>
<Dropdown options={dateRangeOptions} value={dateRange} setValue={setDateRange} />
</div>
<div className="flex flex-col w-full">
{symbols.map((key) => (
{symbols.map((symbol) => (
<div
key={data[key].symbol}
key={data[symbol].symbol}
className="bg-theme-200/50 dark:bg-theme-900/20 rounded m-1 flex-1 flex flex-row items-center justify-between p-1 text-xs"
>
<div className="font-thin pl-2">{data[key].name}</div>
<div className="font-thin pl-2">{data[symbol].name}</div>
<div className="flex flex-row text-right">
<div className="font-bold mr-2">
{currencySymbol}
{data[key].quote[currencyCode].price.toFixed(2)}
{t("common.number", {
value: data[symbol].quote[currencyCode].price,
style: "currency",
currency: currencyCode,
})}
</div>
<div
className={`font-bold w-10 mr-2 ${
data[key].quote[currencyCode].percent_change_1h > 0 ? "text-emerald-300" : "text-rose-300"
data[symbol].quote[currencyCode][`percent_change_${dateRange}`] > 0
? "text-emerald-300"
: "text-rose-300"
}`}
>
{data[key].quote[currencyCode].percent_change_1h.toFixed(2)}%
{data[symbol].quote[currencyCode][`percent_change_${dateRange}`].toFixed(2)}%
</div>
</div>
</div>

View File

@@ -7,5 +7,5 @@ export default function Widget({ error = false, children }) {
);
}
return <div className="flex flex-row w-full">{children}</div>;
return <div className="relative flex flex-row w-full">{children}</div>;
}

View File

@@ -3,7 +3,6 @@ import Cpu from "./cpu";
import Memory from "./memory";
export default function Resources({ options }) {
console.log(options);
const { expanded } = options;
return (
<div className="flex flex-col max-w:full sm:basis-auto self-center m-auto flex-wrap">

View File

@@ -46,6 +46,8 @@ export default function Home({ settings }) {
<ThemeProvider>
<Head>
<title>{settings.title || "Homepage"}</title>
{settings.base && <base href={settings.base} />}
{settings.favicon && <link rel="icon" href={settings.favicon} />}
</Head>
<div className="fixed w-full h-full m-0 p-0" style={wrappedStyle} />
<div className="relative w-full container m-auto flex flex-col h-screen justify-between">