mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-10 10:32:09 +08:00
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79e5ff2fea | ||
|
|
7f91fe59e2 | ||
|
|
b40dad3d3e | ||
|
|
f9f816845f | ||
|
|
193b58d0fc | ||
|
|
b7f490544a | ||
|
|
5d85e3c0e2 | ||
|
|
75214c345a | ||
|
|
6d55e74ae4 | ||
|
|
710f979f94 | ||
|
|
c2a036c526 | ||
|
|
a6c52df4cb | ||
|
|
4d1ad16ea2 | ||
|
|
94c093ea57 | ||
|
|
acd421c617 | ||
|
|
4d2004c8c9 | ||
|
|
6c5bfa466f | ||
|
|
794938c525 | ||
|
|
62188ffdc7 | ||
|
|
34f7bd4341 | ||
|
|
6b45825472 | ||
|
|
b81a5d1e51 | ||
|
|
5d9e90f033 | ||
|
|
55a3e6880b | ||
|
|
beee9ecd84 | ||
|
|
b94d7a4ae8 | ||
|
|
331999c1a4 | ||
|
|
e5db1ec848 | ||
|
|
17d7161374 | ||
|
|
06d4f2b9f3 | ||
|
|
4b69fdefef | ||
|
|
13db31ede0 | ||
|
|
22a073ba1a | ||
|
|
ce9c115f3d | ||
|
|
767aa9b3e1 |
@@ -12,7 +12,6 @@
|
|||||||
"@headlessui/react": "^1.7.0",
|
"@headlessui/react": "^1.7.0",
|
||||||
"@tailwindcss/forms": "^0.5.3",
|
"@tailwindcss/forms": "^0.5.3",
|
||||||
"classnames": "^2.3.1",
|
"classnames": "^2.3.1",
|
||||||
"currency-symbol-map": "^5.1.0",
|
|
||||||
"dockerode": "^3.3.4",
|
"dockerode": "^3.3.4",
|
||||||
"i18next": "^21.9.1",
|
"i18next": "^21.9.1",
|
||||||
"i18next-browser-languagedetector": "^6.1.5",
|
"i18next-browser-languagedetector": "^6.1.5",
|
||||||
|
|||||||
6
pnpm-lock.yaml
generated
6
pnpm-lock.yaml
generated
@@ -5,7 +5,6 @@ specifiers:
|
|||||||
'@tailwindcss/forms': ^0.5.3
|
'@tailwindcss/forms': ^0.5.3
|
||||||
autoprefixer: ^10.4.9
|
autoprefixer: ^10.4.9
|
||||||
classnames: ^2.3.1
|
classnames: ^2.3.1
|
||||||
currency-symbol-map: ^5.1.0
|
|
||||||
dockerode: ^3.3.4
|
dockerode: ^3.3.4
|
||||||
eslint: ^8.23.1
|
eslint: ^8.23.1
|
||||||
eslint-config-airbnb: ^19.0.4
|
eslint-config-airbnb: ^19.0.4
|
||||||
@@ -42,7 +41,6 @@ dependencies:
|
|||||||
'@headlessui/react': 1.7.0_biqbaboplfbrettd7655fr4n2y
|
'@headlessui/react': 1.7.0_biqbaboplfbrettd7655fr4n2y
|
||||||
'@tailwindcss/forms': 0.5.3_tailwindcss@3.1.8
|
'@tailwindcss/forms': 0.5.3_tailwindcss@3.1.8
|
||||||
classnames: 2.3.1
|
classnames: 2.3.1
|
||||||
currency-symbol-map: 5.1.0
|
|
||||||
dockerode: 3.3.4
|
dockerode: 3.3.4
|
||||||
i18next: 21.9.1
|
i18next: 21.9.1
|
||||||
i18next-browser-languagedetector: 6.1.5
|
i18next-browser-languagedetector: 6.1.5
|
||||||
@@ -706,10 +704,6 @@ packages:
|
|||||||
engines: {node: '>=4'}
|
engines: {node: '>=4'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
/currency-symbol-map/5.1.0:
|
|
||||||
resolution: {integrity: sha512-LO/lzYRw134LMDVnLyAf1dHE5tyO6axEFkR3TXjQIOmMkAM9YL6QsiUwuXzZAmFnuDJcs4hayOgyIYtViXFrLw==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/damerau-levenshtein/1.0.8:
|
/damerau-levenshtein/1.0.8:
|
||||||
resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==}
|
resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|||||||
@@ -109,7 +109,11 @@
|
|||||||
"downloaded": "Downloaded"
|
"downloaded": "Downloaded"
|
||||||
},
|
},
|
||||||
"coinmarketcap": {
|
"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": {
|
"gotify": {
|
||||||
"apps": "Applications",
|
"apps": "Applications",
|
||||||
|
|||||||
@@ -126,7 +126,11 @@
|
|||||||
"total": "Total"
|
"total": "Total"
|
||||||
},
|
},
|
||||||
"coinmarketcap": {
|
"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": {
|
"gotify": {
|
||||||
"apps": "Applications",
|
"apps": "Applications",
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"total": "Total",
|
"total": "Total",
|
||||||
"free": "Libre",
|
"free": "Libre",
|
||||||
"used": "Usado",
|
"used": "Usado",
|
||||||
"load": "Load"
|
"load": "Carga"
|
||||||
},
|
},
|
||||||
"docker": {
|
"docker": {
|
||||||
"rx": "Recibido",
|
"rx": "Recibido",
|
||||||
@@ -34,8 +34,8 @@
|
|||||||
},
|
},
|
||||||
"rutorrent": {
|
"rutorrent": {
|
||||||
"active": "Activo",
|
"active": "Activo",
|
||||||
"upload": "Subir",
|
"upload": "Subida",
|
||||||
"download": "Descargar"
|
"download": "Descarga"
|
||||||
},
|
},
|
||||||
"sonarr": {
|
"sonarr": {
|
||||||
"wanted": "Más deseado",
|
"wanted": "Más deseado",
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
},
|
},
|
||||||
"speedtest": {
|
"speedtest": {
|
||||||
"upload": "Subir",
|
"upload": "Subir",
|
||||||
"download": "Descargar",
|
"download": "Descarga",
|
||||||
"ping": "Ping"
|
"ping": "Ping"
|
||||||
},
|
},
|
||||||
"portainer": {
|
"portainer": {
|
||||||
@@ -109,7 +109,11 @@
|
|||||||
"downloaded": "Descargado"
|
"downloaded": "Descargado"
|
||||||
},
|
},
|
||||||
"coinmarketcap": {
|
"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": {
|
"gotify": {
|
||||||
"apps": "Aplicaciones",
|
"apps": "Aplicaciones",
|
||||||
@@ -117,16 +121,16 @@
|
|||||||
"messages": "Mensajes"
|
"messages": "Mensajes"
|
||||||
},
|
},
|
||||||
"prowlarr": {
|
"prowlarr": {
|
||||||
"enableIndexers": "Indexers",
|
"enableIndexers": "Indexadores",
|
||||||
"numberOfGrabs": "Grabs",
|
"numberOfGrabs": "Capturas",
|
||||||
"numberOfQueries": "Queries",
|
"numberOfQueries": "Consultas",
|
||||||
"numberOfFailGrabs": "Fail Grabs",
|
"numberOfFailGrabs": "Capturas Fallidas",
|
||||||
"numberOfFailQueries": "Fail Queries"
|
"numberOfFailQueries": "Consultas Fallidas"
|
||||||
},
|
},
|
||||||
"transmission": {
|
"transmission": {
|
||||||
"download": "Download",
|
"download": "Descarga",
|
||||||
"upload": "Upload",
|
"upload": "Subida",
|
||||||
"leech": "Leech",
|
"leech": "Egoístas (Leech)",
|
||||||
"seed": "Seed"
|
"seed": "Semillas"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,7 +120,11 @@
|
|||||||
"rate": "Évaluer"
|
"rate": "Évaluer"
|
||||||
},
|
},
|
||||||
"coinmarketcap": {
|
"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": {
|
"gotify": {
|
||||||
"apps": "Applications",
|
"apps": "Applications",
|
||||||
@@ -135,8 +139,8 @@
|
|||||||
"numberOfFailQueries": "Demande échouée"
|
"numberOfFailQueries": "Demande échouée"
|
||||||
},
|
},
|
||||||
"transmission": {
|
"transmission": {
|
||||||
"download": "Download",
|
"download": "Réception",
|
||||||
"upload": "Upload",
|
"upload": "Envoi",
|
||||||
"leech": "Leech",
|
"leech": "Leech",
|
||||||
"seed": "Seed"
|
"seed": "Seed"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,11 @@
|
|||||||
"downloaded": "Downloaded"
|
"downloaded": "Downloaded"
|
||||||
},
|
},
|
||||||
"coinmarketcap": {
|
"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": {
|
"gotify": {
|
||||||
"apps": "Applications",
|
"apps": "Applications",
|
||||||
|
|||||||
@@ -109,7 +109,11 @@
|
|||||||
"remaining": "Gjenstående"
|
"remaining": "Gjenstående"
|
||||||
},
|
},
|
||||||
"coinmarketcap": {
|
"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": {
|
"gotify": {
|
||||||
"apps": "Programmer",
|
"apps": "Programmer",
|
||||||
|
|||||||
@@ -109,7 +109,11 @@
|
|||||||
"downloaded": "Downloaded"
|
"downloaded": "Downloaded"
|
||||||
},
|
},
|
||||||
"coinmarketcap": {
|
"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": {
|
"gotify": {
|
||||||
"apps": "Applications",
|
"apps": "Applications",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"widget": {
|
"widget": {
|
||||||
"missing_type": "Tipo de widget ausente: {{type}}",
|
"missing_type": "Widget ausente: {{type}}",
|
||||||
"api_error": "Erro da API",
|
"api_error": "Erro da API",
|
||||||
"status": "Status"
|
"status": "Status"
|
||||||
},
|
},
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
"resources": {
|
"resources": {
|
||||||
"total": "Total",
|
"total": "Total",
|
||||||
"free": "Livre",
|
"free": "Livre",
|
||||||
"used": "Usada",
|
"used": "Usado",
|
||||||
"load": "Load"
|
"load": "Load"
|
||||||
},
|
},
|
||||||
"docker": {
|
"docker": {
|
||||||
@@ -18,22 +18,22 @@
|
|||||||
"tx": "Tx",
|
"tx": "Tx",
|
||||||
"mem": "Mem",
|
"mem": "Mem",
|
||||||
"cpu": "CPU",
|
"cpu": "CPU",
|
||||||
"offline": "Desligada"
|
"offline": "Desligado"
|
||||||
},
|
},
|
||||||
"emby": {
|
"emby": {
|
||||||
"playing": "A reproduzir",
|
"playing": "A reproduzir",
|
||||||
"transcoding": "Transcodificação",
|
"transcoding": "Transcodificação",
|
||||||
"bitrate": "Taxa de bits",
|
"bitrate": "Bitrate",
|
||||||
"no_active": "No Active Streams"
|
"no_active": "Sem streams ativas"
|
||||||
},
|
},
|
||||||
"tautulli": {
|
"tautulli": {
|
||||||
"playing": "Reproduzindo",
|
"playing": "Reproduzindo",
|
||||||
"transcoding": "Transcodificação",
|
"transcoding": "Transcodificação",
|
||||||
"bitrate": "Taxa de bits",
|
"bitrate": "Taxa de bits",
|
||||||
"no_active": "No Active Streams"
|
"no_active": "Sem streams ativas"
|
||||||
},
|
},
|
||||||
"rutorrent": {
|
"rutorrent": {
|
||||||
"active": "Ativa",
|
"active": "Ativo",
|
||||||
"upload": "Envio",
|
"upload": "Envio",
|
||||||
"download": "ReceçãoDownload"
|
"download": "ReceçãoDownload"
|
||||||
},
|
},
|
||||||
@@ -44,13 +44,13 @@
|
|||||||
},
|
},
|
||||||
"radarr": {
|
"radarr": {
|
||||||
"wanted": "Desejado",
|
"wanted": "Desejado",
|
||||||
"queued": "Enfileiradas",
|
"queued": "Fila",
|
||||||
"movies": "Filmes"
|
"movies": "Filmes"
|
||||||
},
|
},
|
||||||
"readarr": {
|
"readarr": {
|
||||||
"wanted": "Wanted",
|
"wanted": "Wanted",
|
||||||
"queued": "Queued",
|
"queued": "Em fila",
|
||||||
"books": "Books"
|
"books": "Livros"
|
||||||
},
|
},
|
||||||
"ombi": {
|
"ombi": {
|
||||||
"pending": "Pendente",
|
"pending": "Pendente",
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
"pihole": {
|
"pihole": {
|
||||||
"queries": "Consultas",
|
"queries": "Consultas",
|
||||||
"blocked": "Bloqueado",
|
"blocked": "Bloqueado",
|
||||||
"gravity": "Gravidade"
|
"gravity": "Gravity"
|
||||||
},
|
},
|
||||||
"speedtest": {
|
"speedtest": {
|
||||||
"upload": "Envio",
|
"upload": "Envio",
|
||||||
@@ -73,18 +73,18 @@
|
|||||||
"ping": "Ping"
|
"ping": "Ping"
|
||||||
},
|
},
|
||||||
"portainer": {
|
"portainer": {
|
||||||
"running": "Corrida",
|
"running": "A correr",
|
||||||
"stopped": "Parou",
|
"stopped": "Parado",
|
||||||
"total": "Total"
|
"total": "Total"
|
||||||
},
|
},
|
||||||
"traefik": {
|
"traefik": {
|
||||||
"routers": "Roteadores",
|
"routers": "Routers",
|
||||||
"services": "Serviços",
|
"services": "Serviços",
|
||||||
"middleware": "Middleware"
|
"middleware": "Middleware"
|
||||||
},
|
},
|
||||||
"npm": {
|
"npm": {
|
||||||
"enabled": "Habilitada",
|
"enabled": "Ativo",
|
||||||
"disabled": "Desabilitada",
|
"disabled": "Desabilitado",
|
||||||
"total": "Total"
|
"total": "Total"
|
||||||
},
|
},
|
||||||
"common": {
|
"common": {
|
||||||
@@ -105,22 +105,26 @@
|
|||||||
"wait": "Por favor aguarde"
|
"wait": "Por favor aguarde"
|
||||||
},
|
},
|
||||||
"overseerr": {
|
"overseerr": {
|
||||||
"pending": "Pending",
|
"pending": "Pendente",
|
||||||
"approved": "Approved",
|
"approved": "Aprovado",
|
||||||
"available": "Available"
|
"available": "Disponível"
|
||||||
},
|
},
|
||||||
"sabnzbd": {
|
"sabnzbd": {
|
||||||
"rate": "Rate",
|
"rate": "Rate",
|
||||||
"queue": "Queue",
|
"queue": "Fila",
|
||||||
"timeleft": "Time Left"
|
"timeleft": "Tempo restante"
|
||||||
},
|
},
|
||||||
"nzbget": {
|
"nzbget": {
|
||||||
"rate": "Rate",
|
"rate": "Rate",
|
||||||
"remaining": "Remaining",
|
"remaining": "Restante",
|
||||||
"downloaded": "Downloaded"
|
"downloaded": "Downloaded"
|
||||||
},
|
},
|
||||||
"coinmarketcap": {
|
"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": {
|
"gotify": {
|
||||||
"apps": "Aplicações",
|
"apps": "Aplicações",
|
||||||
@@ -131,12 +135,12 @@
|
|||||||
"enableIndexers": "Indexers",
|
"enableIndexers": "Indexers",
|
||||||
"numberOfGrabs": "Grabs",
|
"numberOfGrabs": "Grabs",
|
||||||
"numberOfQueries": "Queries",
|
"numberOfQueries": "Queries",
|
||||||
"numberOfFailGrabs": "Fail Grabs",
|
"numberOfFailGrabs": "Falhados",
|
||||||
"numberOfFailQueries": "Fail Queries"
|
"numberOfFailQueries": "Pesquisas falhadas"
|
||||||
},
|
},
|
||||||
"transmission": {
|
"transmission": {
|
||||||
"download": "Download",
|
"download": "Download",
|
||||||
"upload": "Upload",
|
"upload": "Envio",
|
||||||
"leech": "Leech",
|
"leech": "Leech",
|
||||||
"seed": "Seed"
|
"seed": "Seed"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,11 @@
|
|||||||
"downloaded": "Downloaded"
|
"downloaded": "Downloaded"
|
||||||
},
|
},
|
||||||
"coinmarketcap": {
|
"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": {
|
"gotify": {
|
||||||
"apps": "Applications",
|
"apps": "Applications",
|
||||||
|
|||||||
@@ -109,7 +109,11 @@
|
|||||||
"downloaded": "Downloaded"
|
"downloaded": "Downloaded"
|
||||||
},
|
},
|
||||||
"coinmarketcap": {
|
"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": {
|
"gotify": {
|
||||||
"apps": "Applications",
|
"apps": "Applications",
|
||||||
|
|||||||
@@ -109,7 +109,11 @@
|
|||||||
"downloaded": "下载"
|
"downloaded": "下载"
|
||||||
},
|
},
|
||||||
"coinmarketcap": {
|
"coinmarketcap": {
|
||||||
"configure": "配置一个或多个需要追踪的加密"
|
"configure": "配置一个或多个需要追踪的加密",
|
||||||
|
"1hour": "1 Hour",
|
||||||
|
"1day": "1 Day",
|
||||||
|
"7days": "7 Days",
|
||||||
|
"30days": "30 Days"
|
||||||
},
|
},
|
||||||
"gotify": {
|
"gotify": {
|
||||||
"apps": "应用",
|
"apps": "应用",
|
||||||
|
|||||||
@@ -114,7 +114,11 @@
|
|||||||
"total": "Total"
|
"total": "Total"
|
||||||
},
|
},
|
||||||
"coinmarketcap": {
|
"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": {
|
"prowlarr": {
|
||||||
"enableIndexers": "Indexers",
|
"enableIndexers": "Indexers",
|
||||||
|
|||||||
48
src/components/services/dropdown.jsx
Normal file
48
src/components/services/dropdown.jsx
Normal 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>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -45,7 +45,7 @@ const widgetMappings = {
|
|||||||
npm: Npm,
|
npm: Npm,
|
||||||
tautulli: Tautulli,
|
tautulli: Tautulli,
|
||||||
gotify: Gotify,
|
gotify: Gotify,
|
||||||
prowlarr: Prowlarr
|
prowlarr: Prowlarr,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function Widget({ service }) {
|
export default function Widget({ service }) {
|
||||||
|
|||||||
@@ -1,15 +1,26 @@
|
|||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import getSymbolFromCurrency from "currency-symbol-map";
|
import classNames from "classnames";
|
||||||
|
|
||||||
import Widget from "../widget";
|
import Widget from "../widget";
|
||||||
import Block from "../block";
|
import Block from "../block";
|
||||||
|
|
||||||
|
import Dropdown from "components/services/dropdown";
|
||||||
import { formatApiUrl } from "utils/api-helpers";
|
import { formatApiUrl } from "utils/api-helpers";
|
||||||
|
|
||||||
export default function CoinMarketCap({ service }) {
|
export default function CoinMarketCap({ service }) {
|
||||||
const { t } = useTranslation();
|
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 config = service.widget;
|
||||||
const currencyCode = config.currency ?? "USD";
|
const currencyCode = config.currency ?? "USD";
|
||||||
const { symbols } = config;
|
const { symbols } = config;
|
||||||
@@ -30,7 +41,7 @@ export default function CoinMarketCap({ service }) {
|
|||||||
return <Widget error={t("widget.api_error")} />;
|
return <Widget error={t("widget.api_error")} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!statsData) {
|
if (!statsData || !dateRange) {
|
||||||
return (
|
return (
|
||||||
<Widget>
|
<Widget>
|
||||||
<Block value={t("coinmarketcap.configure")} />
|
<Block value={t("coinmarketcap.configure")} />
|
||||||
@@ -39,28 +50,36 @@ export default function CoinMarketCap({ service }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { data } = statsData;
|
const { data } = statsData;
|
||||||
const currencySymbol = getSymbolFromCurrency(currencyCode);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Widget>
|
<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">
|
<div className="flex flex-col w-full">
|
||||||
{symbols.map((key) => (
|
{symbols.map((symbol) => (
|
||||||
<div
|
<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"
|
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="flex flex-row text-right">
|
||||||
<div className="font-bold mr-2">
|
<div className="font-bold mr-2">
|
||||||
{currencySymbol}
|
{t("common.number", {
|
||||||
{data[key].quote[currencyCode].price.toFixed(2)}
|
value: data[symbol].quote[currencyCode].price,
|
||||||
|
style: "currency",
|
||||||
|
currency: currencyCode,
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className={`font-bold w-10 mr-2 ${
|
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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -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>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import Cpu from "./cpu";
|
|||||||
import Memory from "./memory";
|
import Memory from "./memory";
|
||||||
|
|
||||||
export default function Resources({ options }) {
|
export default function Resources({ options }) {
|
||||||
console.log(options);
|
|
||||||
const { expanded } = options;
|
const { expanded } = options;
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col max-w:full sm:basis-auto self-center m-auto flex-wrap">
|
<div className="flex flex-col max-w:full sm:basis-auto self-center m-auto flex-wrap">
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ export default function Home({ settings }) {
|
|||||||
<ThemeProvider>
|
<ThemeProvider>
|
||||||
<Head>
|
<Head>
|
||||||
<title>{settings.title || "Homepage"}</title>
|
<title>{settings.title || "Homepage"}</title>
|
||||||
|
{settings.base && <base href={settings.base} />}
|
||||||
|
{settings.favicon && <link rel="icon" href={settings.favicon} />}
|
||||||
</Head>
|
</Head>
|
||||||
<div className="fixed w-full h-full m-0 p-0" style={wrappedStyle} />
|
<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">
|
<div className="relative w-full container m-auto flex flex-col h-screen justify-between">
|
||||||
|
|||||||
Reference in New Issue
Block a user