mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-05 21:47:48 +01:00
Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d861264ecf | ||
|
|
e3237b9022 | ||
|
|
3882dd4f5a | ||
|
|
d66326b41d | ||
|
|
ef1c5dbcc9 | ||
|
|
c45c8e93de | ||
|
|
1e93bf3ec4 | ||
|
|
4bff209bd7 | ||
|
|
e5ee937c38 | ||
|
|
c418efe007 | ||
|
|
5677254b46 | ||
|
|
cb76a8165d | ||
|
|
a7a1eca0cd | ||
|
|
85bc078c46 | ||
|
|
5c347d9427 | ||
|
|
6c17efc2ab | ||
|
|
a6e929ba86 | ||
|
|
f9886f7c63 | ||
|
|
ec937f6212 | ||
|
|
b7427c3409 | ||
|
|
5bd9cf46ea | ||
|
|
c340c42ef3 | ||
|
|
27c5b4227d | ||
|
|
914e869778 | ||
|
|
e4ea30becc | ||
|
|
61f91f0e45 | ||
|
|
c6d8668e69 | ||
|
|
3c73b000df | ||
|
|
ed5a5ae86f |
@@ -28,9 +28,8 @@ COPY . .
|
||||
RUN <<EOF
|
||||
set -xe
|
||||
yarn next telemetry disable
|
||||
mkdir config
|
||||
mkdir config && echo '-' > config/settings.yaml
|
||||
npm run build
|
||||
rm -rf config
|
||||
EOF
|
||||
|
||||
# Production image, copy all the files and run next
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
* Information & Utility Widgets
|
||||
- System Stats (Disk, CPU, Memory)
|
||||
- Weather via WeatherAPI.com or OpenWeatherMap ([AlexFullmoon](https://github.com/benphelps/homepage/pull/25))
|
||||
- Automatic location detection (with HTTPS), or manual location selection
|
||||
- Search Bar ([aidenpwnz](https://github.com/benphelps/homepage/pull/45))
|
||||
* Customizable
|
||||
- 21 theme colors with light and dark mode support
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
"react-i18next": "^11.18.5",
|
||||
"react-icons": "^4.4.0",
|
||||
"rutorrent-promise": "^2.0.0",
|
||||
"shvl": "^3.0.0",
|
||||
"swr": "^1.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
6
pnpm-lock.yaml
generated
6
pnpm-lock.yaml
generated
@@ -32,6 +32,7 @@ specifiers:
|
||||
react-i18next: ^11.18.5
|
||||
react-icons: ^4.4.0
|
||||
rutorrent-promise: ^2.0.0
|
||||
shvl: ^3.0.0
|
||||
swr: ^1.3.0
|
||||
tailwindcss: ^3.1.8
|
||||
typescript: ^4.8.2
|
||||
@@ -56,6 +57,7 @@ dependencies:
|
||||
react-i18next: 11.18.5_4sidbwfhen5r7txudrvpua6nty
|
||||
react-icons: 4.4.0_react@18.2.0
|
||||
rutorrent-promise: 2.0.0
|
||||
shvl: 3.0.0
|
||||
swr: 1.3.0_react@18.2.0
|
||||
|
||||
devDependencies:
|
||||
@@ -2354,6 +2356,10 @@ packages:
|
||||
engines: {node: '>=8'}
|
||||
dev: true
|
||||
|
||||
/shvl/3.0.0:
|
||||
resolution: {integrity: sha512-5IomAM3ykE/g9K9L6lhODc+TpCuN03rrhlboegeKyyfh66DDdpRD5JN37DYhNHH+RaYjiIDx64K/Ms/xQYOR5w==}
|
||||
dev: false
|
||||
|
||||
/side-channel/1.0.4:
|
||||
resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
|
||||
dependencies:
|
||||
|
||||
@@ -1,87 +1,93 @@
|
||||
{
|
||||
"widget":{
|
||||
"missing_type":"Fehlender Widget-Typ: {{type}}",
|
||||
"api_error":"API-Fehler",
|
||||
"status":"Status"
|
||||
},
|
||||
"search":{
|
||||
"placeholder":"Suche…"
|
||||
},
|
||||
"resources":{
|
||||
"total":"Gesamt",
|
||||
"free":"Frei",
|
||||
"used":"Gebraucht"
|
||||
},
|
||||
"docker":{
|
||||
"rx":"Rx",
|
||||
"tx":"Tx",
|
||||
"mem":"Mem",
|
||||
"cpu":"Zentralprozessor",
|
||||
"offline":"Offline"
|
||||
},
|
||||
"emby":{
|
||||
"playing":"Spielen",
|
||||
"transcoding":"Transcodierung",
|
||||
"bitrate":"Bitrate"
|
||||
},
|
||||
"tautulli":{
|
||||
"playing":"Spielen",
|
||||
"transcoding":"Transcodierung",
|
||||
"bitrate":"Bitrate"
|
||||
},
|
||||
"nzbget":{
|
||||
"rate":"Rate",
|
||||
"remaining":"Verblieben",
|
||||
"downloaded":"Heruntergeladen"
|
||||
},
|
||||
"rutorrent":{
|
||||
"active":"Aktiv",
|
||||
"upload":"Hochladen",
|
||||
"download":"Download"
|
||||
},
|
||||
"sonarr":{
|
||||
"wanted":"Gesucht",
|
||||
"queued":"In Warteschlange",
|
||||
"series":"Serie"
|
||||
},
|
||||
"radarr":{
|
||||
"wanted":"Gesucht",
|
||||
"queued":"In Warteschlange",
|
||||
"movies":"Filme"
|
||||
},
|
||||
"ombi":{
|
||||
"pending":"Ausstehend",
|
||||
"approved":"Genehmigt",
|
||||
"available":"Verfügbar"
|
||||
},
|
||||
"jellyseerr":{
|
||||
"pending":"Ausstehend",
|
||||
"approved":"Genehmigt",
|
||||
"available":"Verfügbar"
|
||||
},
|
||||
"pihole":{
|
||||
"queries":"Abfragen",
|
||||
"blocked":"verstopft",
|
||||
"gravity":"Schwere"
|
||||
},
|
||||
"speedtest":{
|
||||
"upload":"Hochladen",
|
||||
"download":"Download",
|
||||
"ping":"Klingeln"
|
||||
},
|
||||
"portainer":{
|
||||
"running":"Betrieb",
|
||||
"stopped":"Gestoppt",
|
||||
"total":"Gesamt"
|
||||
},
|
||||
"traefik":{
|
||||
"routers":"Router",
|
||||
"services":"Dienstleistungen",
|
||||
"middleware":"Middleware"
|
||||
},
|
||||
"npm":{
|
||||
"enabled":"Ermöglicht",
|
||||
"disabled":"Deaktiviert",
|
||||
"total":"Gesamt"
|
||||
}
|
||||
"widget": {
|
||||
"missing_type": "Fehlender Widget-Typ: {{type}}",
|
||||
"api_error": "API-Fehler",
|
||||
"status": "Status"
|
||||
},
|
||||
"search": {
|
||||
"placeholder": "Suche…"
|
||||
},
|
||||
"resources": {
|
||||
"total": "Gesamt",
|
||||
"free": "Frei",
|
||||
"used": "Gebraucht"
|
||||
},
|
||||
"docker": {
|
||||
"rx": "Rx",
|
||||
"tx": "Tx",
|
||||
"mem": "Mem",
|
||||
"cpu": "Prozessor",
|
||||
"offline": "Offline"
|
||||
},
|
||||
"emby": {
|
||||
"playing": "Spielen",
|
||||
"transcoding": "Transcodierung",
|
||||
"bitrate": "Bitrate"
|
||||
},
|
||||
"tautulli": {
|
||||
"playing": "Spielen",
|
||||
"transcoding": "Transcodierung",
|
||||
"bitrate": "Bitrate"
|
||||
},
|
||||
"nzbget": {
|
||||
"rate": "Rate",
|
||||
"remaining": "Verblieben",
|
||||
"downloaded": "Heruntergeladen"
|
||||
},
|
||||
"rutorrent": {
|
||||
"active": "Aktiv",
|
||||
"upload": "Hochladen",
|
||||
"download": "Download"
|
||||
},
|
||||
"sonarr": {
|
||||
"wanted": "Gesucht",
|
||||
"queued": "In Warteschlange",
|
||||
"series": "Serie"
|
||||
},
|
||||
"radarr": {
|
||||
"wanted": "Gesucht",
|
||||
"queued": "In Warteschlange",
|
||||
"movies": "Filme"
|
||||
},
|
||||
"ombi": {
|
||||
"pending": "Ausstehend",
|
||||
"approved": "Genehmigt",
|
||||
"available": "Verfügbar"
|
||||
},
|
||||
"jellyseerr": {
|
||||
"pending": "Ausstehend",
|
||||
"approved": "Genehmigt",
|
||||
"available": "Verfügbar"
|
||||
},
|
||||
"pihole": {
|
||||
"queries": "Abfragen",
|
||||
"blocked": "Blockiert",
|
||||
"gravity": "Gravity"
|
||||
},
|
||||
"speedtest": {
|
||||
"upload": "Upload",
|
||||
"download": "Download",
|
||||
"ping": "Ping"
|
||||
},
|
||||
"portainer": {
|
||||
"running": "Betrieb",
|
||||
"stopped": "Gestoppt",
|
||||
"total": "Gesamt"
|
||||
},
|
||||
"traefik": {
|
||||
"routers": "Router",
|
||||
"services": "Services",
|
||||
"middleware": "Middleware"
|
||||
},
|
||||
"npm": {
|
||||
"enabled": "Aktiviert",
|
||||
"disabled": "Deaktiviert",
|
||||
"total": "Gesamt"
|
||||
},
|
||||
"weather": {
|
||||
"current": "Aktueller Standort",
|
||||
"allow": "Zum Zulassen anklicken",
|
||||
"updating": "Aktualisieren",
|
||||
"wait": "Bitte warten"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,12 @@
|
||||
"api_error": "API Error",
|
||||
"status": "Status"
|
||||
},
|
||||
"weather": {
|
||||
"current": "Current Location",
|
||||
"allow": "Click to allow",
|
||||
"updating": "Updating",
|
||||
"wait": "Please wait"
|
||||
},
|
||||
"search": {
|
||||
"placeholder": "Search…"
|
||||
},
|
||||
|
||||
@@ -83,5 +83,11 @@
|
||||
"enabled": "Activado",
|
||||
"disabled": "Desactivado",
|
||||
"total": "Total"
|
||||
},
|
||||
"weather": {
|
||||
"current": "Current Location",
|
||||
"allow": "Click to allow",
|
||||
"updating": "Updating",
|
||||
"wait": "Please wait"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,5 +94,11 @@
|
||||
"bitrate": "{{value, bytes(bits: true)}}",
|
||||
"percent": "{{value, percent}}",
|
||||
"ms": "{{value, number}}"
|
||||
},
|
||||
"weather": {
|
||||
"current": "Current Location",
|
||||
"allow": "Click to allow",
|
||||
"updating": "Updating",
|
||||
"wait": "Please wait"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,5 +83,11 @@
|
||||
"enabled": "Enabled",
|
||||
"disabled": "Disabled",
|
||||
"total": "Total"
|
||||
},
|
||||
"weather": {
|
||||
"current": "Current Location",
|
||||
"allow": "Click to allow",
|
||||
"updating": "Updating",
|
||||
"wait": "Please wait"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,5 +83,11 @@
|
||||
"enabled": "Påskrudd",
|
||||
"disabled": "Avskrudd",
|
||||
"total": "Totalt"
|
||||
},
|
||||
"weather": {
|
||||
"allow": "Klikk for å tillate",
|
||||
"updating": "Oppdaterer …",
|
||||
"wait": "Vent litt …",
|
||||
"current": "Nåværende posisjon"
|
||||
}
|
||||
}
|
||||
|
||||
93
public/locales/nl/common.json
Normal file
93
public/locales/nl/common.json
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"widget": {
|
||||
"missing_type": "Missing Widget Type: {{type}}",
|
||||
"api_error": "API Error",
|
||||
"status": "Status"
|
||||
},
|
||||
"resources": {
|
||||
"total": "Total",
|
||||
"free": "Free",
|
||||
"used": "Used"
|
||||
},
|
||||
"docker": {
|
||||
"rx": "RX",
|
||||
"tx": "TX",
|
||||
"mem": "MEM",
|
||||
"cpu": "CPU",
|
||||
"offline": "Offline"
|
||||
},
|
||||
"nzbget": {
|
||||
"rate": "Rate",
|
||||
"remaining": "Remaining",
|
||||
"downloaded": "Downloaded"
|
||||
},
|
||||
"speedtest": {
|
||||
"upload": "Upload",
|
||||
"download": "Download",
|
||||
"ping": "Ping"
|
||||
},
|
||||
"portainer": {
|
||||
"running": "Running",
|
||||
"stopped": "Stopped",
|
||||
"total": "Total"
|
||||
},
|
||||
"weather": {
|
||||
"updating": "Updating",
|
||||
"wait": "Please wait",
|
||||
"current": "Current Location",
|
||||
"allow": "Click to allow"
|
||||
},
|
||||
"search": {
|
||||
"placeholder": "Search…"
|
||||
},
|
||||
"emby": {
|
||||
"playing": "Playing",
|
||||
"transcoding": "Transcoding",
|
||||
"bitrate": "Bitrate"
|
||||
},
|
||||
"tautulli": {
|
||||
"playing": "Playing",
|
||||
"transcoding": "Transcoding",
|
||||
"bitrate": "Bitrate"
|
||||
},
|
||||
"rutorrent": {
|
||||
"active": "Active",
|
||||
"upload": "Upload",
|
||||
"download": "Download"
|
||||
},
|
||||
"sonarr": {
|
||||
"wanted": "Wanted",
|
||||
"queued": "Queued",
|
||||
"series": "Series"
|
||||
},
|
||||
"radarr": {
|
||||
"movies": "Movies",
|
||||
"wanted": "Wanted",
|
||||
"queued": "Queued"
|
||||
},
|
||||
"ombi": {
|
||||
"pending": "Pending",
|
||||
"approved": "Approved",
|
||||
"available": "Available"
|
||||
},
|
||||
"jellyseerr": {
|
||||
"pending": "Pending",
|
||||
"approved": "Approved",
|
||||
"available": "Available"
|
||||
},
|
||||
"pihole": {
|
||||
"queries": "Queries",
|
||||
"blocked": "Blocked",
|
||||
"gravity": "Gravity"
|
||||
},
|
||||
"traefik": {
|
||||
"routers": "Routers",
|
||||
"services": "Services",
|
||||
"middleware": "Middleware"
|
||||
},
|
||||
"npm": {
|
||||
"enabled": "Enabled",
|
||||
"disabled": "Disabled",
|
||||
"total": "Total"
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
"status": "Status"
|
||||
},
|
||||
"search": {
|
||||
"placeholder": "Procurar…"
|
||||
"placeholder": "Pesquisar…"
|
||||
},
|
||||
"resources": {
|
||||
"total": "Total",
|
||||
@@ -20,32 +20,32 @@
|
||||
"offline": "Desligada"
|
||||
},
|
||||
"emby": {
|
||||
"playing": "Jogando",
|
||||
"playing": "A reproduzir",
|
||||
"transcoding": "Transcodificação",
|
||||
"bitrate": "Taxa de bits"
|
||||
},
|
||||
"tautulli": {
|
||||
"playing": "Jogando",
|
||||
"playing": "Reproduzindo",
|
||||
"transcoding": "Transcodificação",
|
||||
"bitrate": "Taxa de bits"
|
||||
},
|
||||
"nzbget": {
|
||||
"rate": "Avaliar",
|
||||
"remaining": "Remanescente",
|
||||
"remaining": "Em falta",
|
||||
"downloaded": "Baixada"
|
||||
},
|
||||
"rutorrent": {
|
||||
"active": "Ativa",
|
||||
"upload": "Envio",
|
||||
"download": "Download"
|
||||
"download": "ReceçãoDownload"
|
||||
},
|
||||
"sonarr": {
|
||||
"wanted": "Desejada",
|
||||
"queued": "Enfileiradas",
|
||||
"series": "Series"
|
||||
"queued": "Em fila",
|
||||
"series": "Séries"
|
||||
},
|
||||
"radarr": {
|
||||
"wanted": "Desejada",
|
||||
"wanted": "Desejado",
|
||||
"queued": "Enfileiradas",
|
||||
"movies": "Filmes"
|
||||
},
|
||||
@@ -94,5 +94,11 @@
|
||||
"ms": "{{value, number}}",
|
||||
"bitrate": "{{value, bytes(bits: true)}}",
|
||||
"percent": "{{value, percent}}"
|
||||
},
|
||||
"weather": {
|
||||
"current": "Localização atual",
|
||||
"allow": "Clicar para permitir",
|
||||
"updating": "A atualizar",
|
||||
"wait": "Por favor aguarde"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,5 +83,11 @@
|
||||
"enabled": "Включено",
|
||||
"disabled": "Неполноценный",
|
||||
"total": "Общий"
|
||||
},
|
||||
"weather": {
|
||||
"wait": "Please wait",
|
||||
"current": "Current Location",
|
||||
"allow": "Click to allow",
|
||||
"updating": "Updating"
|
||||
}
|
||||
}
|
||||
|
||||
93
public/locales/vi/common.json
Normal file
93
public/locales/vi/common.json
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"widget": {
|
||||
"missing_type": "Thiếu loại Widget: {{type}}",
|
||||
"api_error": "Lỗi API",
|
||||
"status": "Trạng thái"
|
||||
},
|
||||
"search": {
|
||||
"placeholder": "Tìm kiếm…"
|
||||
},
|
||||
"resources": {
|
||||
"total": "Tổng",
|
||||
"free": "Dư",
|
||||
"used": "Đã dùng"
|
||||
},
|
||||
"docker": {
|
||||
"rx": "RX",
|
||||
"tx": "TX",
|
||||
"mem": "BỘ NHỚ",
|
||||
"cpu": "CPU",
|
||||
"offline": "Ngoại tuyến"
|
||||
},
|
||||
"emby": {
|
||||
"playing": "Đang chơi",
|
||||
"transcoding": "Chuyển định dạng",
|
||||
"bitrate": "Bitrate"
|
||||
},
|
||||
"tautulli": {
|
||||
"playing": "Đang chơi",
|
||||
"transcoding": "Chuyển định dạng",
|
||||
"bitrate": "Bitrate"
|
||||
},
|
||||
"nzbget": {
|
||||
"rate": "Rate",
|
||||
"remaining": "Còn lại",
|
||||
"downloaded": "Đã tải"
|
||||
},
|
||||
"rutorrent": {
|
||||
"active": "Hoạt động",
|
||||
"upload": "Tải lên",
|
||||
"download": "Tải xuống"
|
||||
},
|
||||
"sonarr": {
|
||||
"wanted": "Wanted",
|
||||
"queued": "Queued",
|
||||
"series": "Series"
|
||||
},
|
||||
"radarr": {
|
||||
"wanted": "Wanted",
|
||||
"queued": "Queued",
|
||||
"movies": "Movies"
|
||||
},
|
||||
"ombi": {
|
||||
"pending": "Pending",
|
||||
"approved": "Approved",
|
||||
"available": "Available"
|
||||
},
|
||||
"jellyseerr": {
|
||||
"pending": "Pending",
|
||||
"approved": "Approved",
|
||||
"available": "Available"
|
||||
},
|
||||
"pihole": {
|
||||
"queries": "Queries",
|
||||
"blocked": "Blocked",
|
||||
"gravity": "Gravity"
|
||||
},
|
||||
"speedtest": {
|
||||
"upload": "Upload",
|
||||
"download": "Download",
|
||||
"ping": "Ping"
|
||||
},
|
||||
"portainer": {
|
||||
"running": "Running",
|
||||
"stopped": "Stopped",
|
||||
"total": "Total"
|
||||
},
|
||||
"traefik": {
|
||||
"routers": "Routers",
|
||||
"services": "Services",
|
||||
"middleware": "Middleware"
|
||||
},
|
||||
"npm": {
|
||||
"enabled": "Enabled",
|
||||
"disabled": "Disabled",
|
||||
"total": "Total"
|
||||
},
|
||||
"weather": {
|
||||
"current": "Current Location",
|
||||
"allow": "Click to allow",
|
||||
"updating": "Updating",
|
||||
"wait": "Please wait"
|
||||
}
|
||||
}
|
||||
@@ -1,87 +1,93 @@
|
||||
{
|
||||
"widget":{
|
||||
"missing_type":"缺少小部件类型:{{type}}",
|
||||
"api_error":"API错误",
|
||||
"status":"地位"
|
||||
},
|
||||
"search":{
|
||||
"placeholder":"搜索…"
|
||||
},
|
||||
"resources":{
|
||||
"total":"全部的",
|
||||
"free":"自由的",
|
||||
"used":"用过的"
|
||||
},
|
||||
"docker":{
|
||||
"rx":"rx",
|
||||
"tx":"TX",
|
||||
"mem":"mem",
|
||||
"cpu":"中央处理器",
|
||||
"offline":"离线"
|
||||
},
|
||||
"emby":{
|
||||
"playing":"玩",
|
||||
"transcoding":"转码",
|
||||
"bitrate":"比特率"
|
||||
},
|
||||
"tautulli":{
|
||||
"playing":"玩",
|
||||
"transcoding":"转码",
|
||||
"bitrate":"比特率"
|
||||
},
|
||||
"nzbget":{
|
||||
"rate":"速度",
|
||||
"remaining":"其余的",
|
||||
"downloaded":"下载"
|
||||
},
|
||||
"rutorrent":{
|
||||
"active":"积极的",
|
||||
"upload":"上传",
|
||||
"download":"下载"
|
||||
},
|
||||
"sonarr":{
|
||||
"wanted":"通缉",
|
||||
"queued":"排队",
|
||||
"series":"系列"
|
||||
},
|
||||
"radarr":{
|
||||
"wanted":"通缉",
|
||||
"queued":"排队",
|
||||
"movies":"电影"
|
||||
},
|
||||
"ombi":{
|
||||
"pending":"待办的",
|
||||
"approved":"得到正式认可的",
|
||||
"available":"可用的"
|
||||
},
|
||||
"jellyseerr":{
|
||||
"pending":"待办的",
|
||||
"approved":"得到正式认可的",
|
||||
"available":"可用的"
|
||||
},
|
||||
"pihole":{
|
||||
"queries":"查询",
|
||||
"blocked":"阻止",
|
||||
"gravity":"重力"
|
||||
},
|
||||
"speedtest":{
|
||||
"upload":"上传",
|
||||
"download":"下载",
|
||||
"ping":"ping"
|
||||
},
|
||||
"portainer":{
|
||||
"running":"跑步",
|
||||
"stopped":"停了下来",
|
||||
"total":"全部的"
|
||||
},
|
||||
"traefik":{
|
||||
"routers":"路由器",
|
||||
"services":"服务",
|
||||
"middleware":"中间件"
|
||||
},
|
||||
"npm":{
|
||||
"enabled":"已启用",
|
||||
"disabled":"禁用",
|
||||
"total":"全部的"
|
||||
}
|
||||
"widget": {
|
||||
"missing_type": "缺少小部件类型:{{type}}",
|
||||
"api_error": "API错误",
|
||||
"status": "地位"
|
||||
},
|
||||
"search": {
|
||||
"placeholder": "搜索…"
|
||||
},
|
||||
"resources": {
|
||||
"total": "全部的",
|
||||
"free": "自由的",
|
||||
"used": "用过的"
|
||||
},
|
||||
"docker": {
|
||||
"rx": "rx",
|
||||
"tx": "TX",
|
||||
"mem": "mem",
|
||||
"cpu": "中央处理器",
|
||||
"offline": "离线"
|
||||
},
|
||||
"emby": {
|
||||
"playing": "玩",
|
||||
"transcoding": "转码",
|
||||
"bitrate": "比特率"
|
||||
},
|
||||
"tautulli": {
|
||||
"playing": "玩",
|
||||
"transcoding": "转码",
|
||||
"bitrate": "比特率"
|
||||
},
|
||||
"nzbget": {
|
||||
"rate": "速度",
|
||||
"remaining": "其余的",
|
||||
"downloaded": "下载"
|
||||
},
|
||||
"rutorrent": {
|
||||
"active": "积极的",
|
||||
"upload": "上传",
|
||||
"download": "下载"
|
||||
},
|
||||
"sonarr": {
|
||||
"wanted": "通缉",
|
||||
"queued": "排队",
|
||||
"series": "系列"
|
||||
},
|
||||
"radarr": {
|
||||
"wanted": "通缉",
|
||||
"queued": "排队",
|
||||
"movies": "电影"
|
||||
},
|
||||
"ombi": {
|
||||
"pending": "待办的",
|
||||
"approved": "得到正式认可的",
|
||||
"available": "可用的"
|
||||
},
|
||||
"jellyseerr": {
|
||||
"pending": "待办的",
|
||||
"approved": "得到正式认可的",
|
||||
"available": "可用的"
|
||||
},
|
||||
"pihole": {
|
||||
"queries": "查询",
|
||||
"blocked": "阻止",
|
||||
"gravity": "重力"
|
||||
},
|
||||
"speedtest": {
|
||||
"upload": "上传",
|
||||
"download": "下载",
|
||||
"ping": "ping"
|
||||
},
|
||||
"portainer": {
|
||||
"running": "跑步",
|
||||
"stopped": "停了下来",
|
||||
"total": "全部的"
|
||||
},
|
||||
"traefik": {
|
||||
"routers": "路由器",
|
||||
"services": "服务",
|
||||
"middleware": "中间件"
|
||||
},
|
||||
"npm": {
|
||||
"enabled": "已启用",
|
||||
"disabled": "禁用",
|
||||
"total": "全部的"
|
||||
},
|
||||
"weather": {
|
||||
"current": "Current Location",
|
||||
"allow": "Click to allow",
|
||||
"updating": "Updating",
|
||||
"wait": "Please wait"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ export default function Item({ service }) {
|
||||
}}
|
||||
className="flex-1 flex items-center justify-between rounded-r-md "
|
||||
>
|
||||
<div className="flex-1 px-2 py-2 text-sm">
|
||||
<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>
|
||||
|
||||
@@ -1,6 +1,48 @@
|
||||
import Emby from "./emby";
|
||||
import useSWR from "swr";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import Widget from "../widget";
|
||||
import Block from "../block";
|
||||
|
||||
import { formatApiUrl } from "utils/api-helpers";
|
||||
|
||||
// Jellyfin and Emby share the same API, so proxy the Emby widget to Jellyfin.
|
||||
export default function Jellyfin({ service }) {
|
||||
return <Emby service={service} />;
|
||||
const { t } = useTranslation();
|
||||
|
||||
const config = service.widget;
|
||||
|
||||
const { data: sessionsData, error: sessionsError } = useSWR(formatApiUrl(config, "Sessions"));
|
||||
|
||||
if (sessionsError) {
|
||||
return <Widget error={t("widget.api_error")} />;
|
||||
}
|
||||
|
||||
if (!sessionsData) {
|
||||
return (
|
||||
<Widget>
|
||||
<Block label={t("emby.playing")} />
|
||||
<Block label={t("emby.transcoding")} />
|
||||
<Block label={t("emby.bitrate")} />
|
||||
</Widget>
|
||||
);
|
||||
}
|
||||
|
||||
const playing = sessionsData.filter((session) => session?.NowPlayingItem);
|
||||
const transcoding = sessionsData.filter(
|
||||
(session) => session?.PlayState && session.PlayState.PlayMethod === "Transcode"
|
||||
);
|
||||
|
||||
const bitrate = playing.reduce(
|
||||
(acc, session) =>
|
||||
acc + session.NowPlayingQueueFullItems[0].MediaSources.reduce((acb, source) => acb + source.Bitrate, 0),
|
||||
0
|
||||
);
|
||||
|
||||
return (
|
||||
<Widget>
|
||||
<Block label={t("emby.playing")} value={playing.length} />
|
||||
<Block label={t("emby.transcoding")} value={transcoding.length} />
|
||||
<Block label={t("emby.bitrate")} value={t("common.bitrate", { value: bitrate })} />
|
||||
</Widget>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,25 +1,28 @@
|
||||
import useSWR from "swr";
|
||||
import { useState } from "react";
|
||||
import { BiError } from "react-icons/bi";
|
||||
import { WiCloudDown } from "react-icons/wi";
|
||||
import { MdLocationDisabled, MdLocationSearching } from "react-icons/md";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import Icon from "./icon";
|
||||
|
||||
export default function OpenWeatherMap({ options }) {
|
||||
function Widget({ options }) {
|
||||
const { t, i18n } = useTranslation();
|
||||
|
||||
const { data, error } = useSWR(
|
||||
`/api/widgets/openweathermap?${new URLSearchParams({ lang: i18n.language, ...options }).toString()}`
|
||||
);
|
||||
|
||||
if (error || data?.cod === 401) {
|
||||
if (error || data?.cod === 401 || data?.error) {
|
||||
return (
|
||||
<div className="flex flex-col">
|
||||
<div className="flex flex-col justify-center">
|
||||
<div className="flex flex-row items-center justify-end">
|
||||
<div className="flex flex-col items-center">
|
||||
<BiError className="w-8 h-8 text-theme-800 dark:text-theme-200" />
|
||||
<div className="flex flex-col ml-3 text-left">
|
||||
<span className="text-theme-800 dark:text-theme-200 text-sm">API</span>
|
||||
<span className="text-theme-800 dark:text-theme-200 text-xs">Error</span>
|
||||
<span className="text-theme-800 dark:text-theme-200 text-sm">{t("widget.api_error")}</span>
|
||||
<span className="text-theme-800 dark:text-theme-200 text-xs">-</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -28,11 +31,19 @@ export default function OpenWeatherMap({ options }) {
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
return <div className="flex flex-row items-center" />;
|
||||
}
|
||||
|
||||
if (data.error) {
|
||||
return <div className="flex flex-row items-center" />;
|
||||
return (
|
||||
<div className="flex flex-col justify-center">
|
||||
<div className="flex flex-row items-center justify-end">
|
||||
<div className="flex flex-col items-center">
|
||||
<WiCloudDown className="w-8 h-8 text-theme-800 dark:text-theme-200" />
|
||||
</div>
|
||||
<div className="flex flex-col ml-3 text-left">
|
||||
<span className="text-theme-800 dark:text-theme-200 text-sm">{t("weather.updating")}</span>
|
||||
<span className="text-theme-800 dark:text-theme-200 text-xs">{t("weather.wait")}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const unit = options.units === "metric" ? "celsius" : "fahrenheit";
|
||||
@@ -57,3 +68,55 @@ export default function OpenWeatherMap({ options }) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function OpenWeatherMap({ options }) {
|
||||
const { t } = useTranslation();
|
||||
const [location, setLocation] = useState(false);
|
||||
const [requesting, setRequesting] = useState(false);
|
||||
|
||||
if (!location && options.latitude && options.longitude) {
|
||||
setLocation({ latitude: options.latitude, longitude: options.longitude });
|
||||
}
|
||||
|
||||
const requestLocation = () => {
|
||||
setRequesting(true);
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
(position) => {
|
||||
setLocation({ latitude: position.coords.latitude, longitude: position.coords.longitude });
|
||||
setRequesting(false);
|
||||
},
|
||||
() => {
|
||||
setRequesting(false);
|
||||
},
|
||||
{
|
||||
enableHighAccuracy: true,
|
||||
maximumAge: 1000 * 60 * 60 * 3,
|
||||
timeout: 1000 * 30,
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
if (!requesting && !location) requestLocation();
|
||||
|
||||
if (!location) {
|
||||
return (
|
||||
<button type="button" onClick={() => requestLocation()} className="flex flex-col justify-center">
|
||||
<div className="flex flex-row items-center justify-end">
|
||||
<div className="flex flex-col items-center">
|
||||
{requesting ? (
|
||||
<MdLocationSearching className="w-6 h-6 text-theme-800 dark:text-theme-200 animate-pulse" />
|
||||
) : (
|
||||
<MdLocationDisabled className="w-6 h-6 text-theme-800 dark:text-theme-200" />
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-col ml-3 text-left">
|
||||
<span className="text-theme-800 dark:text-theme-200 text-sm">{t("weather.current")}</span>
|
||||
<span className="text-theme-800 dark:text-theme-200 text-xs">{t("weather.allow")}</span>
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
return <Widget options={{ ...location, ...options }} />;
|
||||
}
|
||||
|
||||
@@ -1,25 +1,28 @@
|
||||
import useSWR from "swr";
|
||||
import { useState } from "react";
|
||||
import { BiError } from "react-icons/bi";
|
||||
import { WiCloudDown } from "react-icons/wi";
|
||||
import { MdLocationDisabled, MdLocationSearching } from "react-icons/md";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import Icon from "./icon";
|
||||
|
||||
export default function WeatherApi({ options }) {
|
||||
function Widget({ options }) {
|
||||
const { t, i18n } = useTranslation();
|
||||
|
||||
const { data, error } = useSWR(
|
||||
`/api/widgets/weather?${new URLSearchParams({ lang: i18n.language, ...options }).toString()}`
|
||||
);
|
||||
|
||||
if (error) {
|
||||
if (error || data?.error) {
|
||||
return (
|
||||
<div className="flex flex-col">
|
||||
<div className="flex flex-col justify-center">
|
||||
<div className="flex flex-row items-center justify-end">
|
||||
<div className="flex flex-col items-center">
|
||||
<BiError className="w-8 h-8 text-theme-800 dark:text-theme-200" />
|
||||
<div className="flex flex-col ml-3 text-left">
|
||||
<span className="text-theme-800 dark:text-theme-200 text-sm">API</span>
|
||||
<span className="text-theme-800 dark:text-theme-200 text-xs">Error</span>
|
||||
<span className="text-theme-800 dark:text-theme-200 text-sm">{t("widget.api_error")}</span>
|
||||
<span className="text-theme-800 dark:text-theme-200 text-xs">-</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -28,11 +31,19 @@ export default function WeatherApi({ options }) {
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
return <div className="flex flex-row items-center justify-end" />;
|
||||
}
|
||||
|
||||
if (data.error) {
|
||||
return <div className="flex flex-row items-center justify-end" />;
|
||||
return (
|
||||
<div className="flex flex-col justify-center">
|
||||
<div className="flex flex-row items-center justify-end">
|
||||
<div className="flex flex-col items-center">
|
||||
<WiCloudDown className="w-8 h-8 text-theme-800 dark:text-theme-200" />
|
||||
</div>
|
||||
<div className="flex flex-col ml-3 text-left">
|
||||
<span className="text-theme-800 dark:text-theme-200 text-sm">{t("weather.updating")}</span>
|
||||
<span className="text-theme-800 dark:text-theme-200 text-xs">{t("weather.wait")}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const unit = options.units === "metric" ? "celsius" : "fahrenheit";
|
||||
@@ -58,3 +69,55 @@ export default function WeatherApi({ options }) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function WeatherApi({ options }) {
|
||||
const { t } = useTranslation();
|
||||
const [location, setLocation] = useState(false);
|
||||
const [requesting, setRequesting] = useState(false);
|
||||
|
||||
if (!location && options.latitude && options.longitude) {
|
||||
setLocation({ latitude: options.latitude, longitude: options.longitude });
|
||||
}
|
||||
|
||||
const requestLocation = () => {
|
||||
setRequesting(true);
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
(position) => {
|
||||
setLocation({ latitude: position.coords.latitude, longitude: position.coords.longitude });
|
||||
setRequesting(false);
|
||||
},
|
||||
() => {
|
||||
setRequesting(false);
|
||||
},
|
||||
{
|
||||
enableHighAccuracy: true,
|
||||
maximumAge: 1000 * 60 * 60 * 3,
|
||||
timeout: 1000 * 30,
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
if (!requesting && !location) requestLocation();
|
||||
|
||||
if (!location) {
|
||||
return (
|
||||
<button type="button" onClick={() => requestLocation()} className="flex flex-col justify-center">
|
||||
<div className="flex flex-row items-center justify-end">
|
||||
<div className="flex flex-col items-center">
|
||||
{requesting ? (
|
||||
<MdLocationSearching className="w-6 h-6 text-theme-800 dark:text-theme-200 animate-pulse" />
|
||||
) : (
|
||||
<MdLocationDisabled className="w-6 h-6 text-theme-800 dark:text-theme-200" />
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-col ml-3 text-left">
|
||||
<span className="text-theme-800 dark:text-theme-200 text-sm">{t("weather.current")}</span>
|
||||
<span className="text-theme-800 dark:text-theme-200 text-xs">{t("weather.allow")}</span>
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
return <Widget options={{ ...location, ...options }} />;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ export default async function handler(req, res) {
|
||||
}
|
||||
|
||||
try {
|
||||
const docker = new Docker(await getDockerArguments(containerServer));
|
||||
const docker = new Docker(getDockerArguments(containerServer));
|
||||
const containers = await docker.listContainers({
|
||||
all: true,
|
||||
});
|
||||
|
||||
@@ -13,7 +13,7 @@ export default async function handler(req, res) {
|
||||
}
|
||||
|
||||
try {
|
||||
const docker = new Docker(await getDockerArguments(containerServer));
|
||||
const docker = new Docker(getDockerArguments(containerServer));
|
||||
const containers = await docker.listContainers({
|
||||
all: true,
|
||||
});
|
||||
|
||||
@@ -1,40 +1,38 @@
|
||||
import { promises as fs } from "fs";
|
||||
import path from "path";
|
||||
|
||||
import yaml from "js-yaml";
|
||||
|
||||
import checkAndCopyConfig from "utils/config";
|
||||
import { servicesFromConfig, servicesFromDocker, cleanServiceGroups } from "utils/service-helpers";
|
||||
|
||||
export default async function handler(req, res) {
|
||||
checkAndCopyConfig("services.yaml");
|
||||
let discoveredServices;
|
||||
let configuredServices;
|
||||
|
||||
const servicesYaml = path.join(process.cwd(), "config", "services.yaml");
|
||||
const fileContents = await fs.readFile(servicesYaml, "utf8");
|
||||
const services = yaml.load(fileContents);
|
||||
try {
|
||||
discoveredServices = cleanServiceGroups(await servicesFromDocker());
|
||||
} catch {
|
||||
discoveredServices = [];
|
||||
}
|
||||
|
||||
// map easy to write YAML objects into easy to consume JS arrays
|
||||
const servicesArray = services.map((group) => ({
|
||||
name: Object.keys(group)[0],
|
||||
services: group[Object.keys(group)[0]].map((entries) => {
|
||||
const { widget, ...service } = entries[Object.keys(entries)[0]];
|
||||
const result = {
|
||||
name: Object.keys(entries)[0],
|
||||
...service,
|
||||
};
|
||||
try {
|
||||
configuredServices = cleanServiceGroups(await servicesFromConfig());
|
||||
} catch {
|
||||
configuredServices = [];
|
||||
}
|
||||
|
||||
if (widget) {
|
||||
const { type } = widget;
|
||||
const mergedGroupsNames = [
|
||||
...new Set([discoveredServices.map((group) => group.name), configuredServices.map((group) => group.name)].flat()),
|
||||
];
|
||||
|
||||
result.widget = {
|
||||
type,
|
||||
service_group: Object.keys(group)[0],
|
||||
service_name: Object.keys(entries)[0],
|
||||
};
|
||||
}
|
||||
const mergedGroups = [];
|
||||
|
||||
return result;
|
||||
}),
|
||||
}));
|
||||
mergedGroupsNames.forEach((groupName) => {
|
||||
const discoveredGroup = discoveredServices.find((group) => group.name === groupName) || { services: [] };
|
||||
const configuredGroup = configuredServices.find((group) => group.name === groupName) || { services: [] };
|
||||
|
||||
res.send(servicesArray);
|
||||
const mergedGroup = {
|
||||
name: groupName,
|
||||
services: [...discoveredGroup.services, ...configuredGroup.services].filter((service) => service),
|
||||
};
|
||||
|
||||
mergedGroups.push(mergedGroup);
|
||||
});
|
||||
|
||||
res.send(mergedGroups);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { existsSync } from "fs";
|
||||
|
||||
import { cpu, drive, mem } from "node-os-utils";
|
||||
|
||||
export default async function handler(req, res) {
|
||||
@@ -13,6 +15,12 @@ export default async function handler(req, res) {
|
||||
}
|
||||
|
||||
if (type === "disk") {
|
||||
if (!existsSync(target)) {
|
||||
return res.status(404).json({
|
||||
error: "Target not found",
|
||||
});
|
||||
}
|
||||
|
||||
return res.status(200).json({
|
||||
drive: await drive.info(target || "/"),
|
||||
});
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import path from "path";
|
||||
import { promises as fs } from "fs";
|
||||
import { readFileSync } from "fs";
|
||||
|
||||
import yaml from "js-yaml";
|
||||
|
||||
import checkAndCopyConfig from "utils/config";
|
||||
|
||||
export default async function getDockerArguments(server) {
|
||||
export default function getDockerArguments(server) {
|
||||
checkAndCopyConfig("docker.yaml");
|
||||
|
||||
const configFile = path.join(process.cwd(), "config", "docker.yaml");
|
||||
const configData = await fs.readFile(configFile, "utf8");
|
||||
const configData = readFileSync(configFile, "utf8");
|
||||
const servers = yaml.load(configData);
|
||||
|
||||
if (!server) {
|
||||
|
||||
@@ -11,7 +11,7 @@ i18n
|
||||
.init({
|
||||
fallbackLng: "en",
|
||||
ns: ["common"],
|
||||
debug: process.env.NODE_ENV === "development",
|
||||
// debug: process.env.NODE_ENV === "development",
|
||||
defaultNS: "common",
|
||||
nonExplicitSupportedLngs: true,
|
||||
interpolation: {
|
||||
|
||||
@@ -2,12 +2,23 @@ import { promises as fs } from "fs";
|
||||
import path from "path";
|
||||
|
||||
import yaml from "js-yaml";
|
||||
import Docker from "dockerode";
|
||||
import * as shvl from "shvl";
|
||||
|
||||
import checkAndCopyConfig from "utils/config";
|
||||
import getDockerArguments from "utils/docker";
|
||||
|
||||
export async function servicesFromConfig() {
|
||||
checkAndCopyConfig("services.yaml");
|
||||
|
||||
export default async function getServiceWidget(group, service) {
|
||||
const servicesYaml = path.join(process.cwd(), "config", "services.yaml");
|
||||
const fileContents = await fs.readFile(servicesYaml, "utf8");
|
||||
const services = yaml.load(fileContents);
|
||||
|
||||
if (!services) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// map easy to write YAML objects into easy to consume JS arrays
|
||||
const servicesArray = services.map((servicesGroup) => ({
|
||||
name: Object.keys(servicesGroup)[0],
|
||||
@@ -17,7 +28,106 @@ export default async function getServiceWidget(group, service) {
|
||||
})),
|
||||
}));
|
||||
|
||||
const serviceGroup = servicesArray.find((g) => g.name === group);
|
||||
return servicesArray;
|
||||
}
|
||||
|
||||
export async function servicesFromDocker() {
|
||||
checkAndCopyConfig("docker.yaml");
|
||||
|
||||
const dockerYaml = path.join(process.cwd(), "config", "docker.yaml");
|
||||
const dockerFileContents = await fs.readFile(dockerYaml, "utf8");
|
||||
const servers = yaml.load(dockerFileContents);
|
||||
|
||||
if (!servers) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const serviceServers = await Promise.all(
|
||||
Object.keys(servers).map(async (serverName) => {
|
||||
const docker = new Docker(getDockerArguments(serverName));
|
||||
const containers = await docker.listContainers({
|
||||
all: true,
|
||||
});
|
||||
|
||||
// bad docker connections can result in a <Buffer ...> object?
|
||||
// in any case, this ensures the result is the expected array
|
||||
if (!Array.isArray(containers)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const discovered = containers.map((container) => {
|
||||
let constructedService = null;
|
||||
|
||||
Object.keys(container.Labels).forEach((label) => {
|
||||
if (label.startsWith("homepage")) {
|
||||
if (!constructedService) {
|
||||
constructedService = {
|
||||
container: container.Names[0].replace(/^\//, ""),
|
||||
server: serverName,
|
||||
};
|
||||
}
|
||||
shvl.set(constructedService, label.replace("homepage.", ""), container.Labels[label]);
|
||||
}
|
||||
});
|
||||
|
||||
return constructedService;
|
||||
});
|
||||
|
||||
return { server: serverName, services: discovered.filter((filteredService) => filteredService) };
|
||||
})
|
||||
);
|
||||
|
||||
const mappedServiceGroups = [];
|
||||
|
||||
serviceServers.forEach((server) => {
|
||||
server.services.forEach((serverService) => {
|
||||
let serverGroup = mappedServiceGroups.find((searchedGroup) => searchedGroup.name === serverService.group);
|
||||
if (!serverGroup) {
|
||||
mappedServiceGroups.push({
|
||||
name: serverService.group,
|
||||
services: [],
|
||||
});
|
||||
serverGroup = mappedServiceGroups[mappedServiceGroups.length - 1];
|
||||
}
|
||||
|
||||
const { name: serviceName, group: serverServiceGroup, ...pushedService } = serverService;
|
||||
const result = {
|
||||
name: serviceName,
|
||||
...pushedService,
|
||||
};
|
||||
|
||||
serverGroup.services.push(result);
|
||||
});
|
||||
});
|
||||
|
||||
return mappedServiceGroups;
|
||||
}
|
||||
|
||||
export function cleanServiceGroups(groups) {
|
||||
return groups.map((serviceGroup) => ({
|
||||
name: serviceGroup.name,
|
||||
services: serviceGroup.services.map((service) => {
|
||||
const cleanedService = { ...service };
|
||||
|
||||
if (cleanedService.widget) {
|
||||
const { type } = cleanedService.widget;
|
||||
|
||||
cleanedService.widget = {
|
||||
type,
|
||||
service_name: service.name,
|
||||
service_group: serviceGroup.name,
|
||||
};
|
||||
}
|
||||
|
||||
return cleanedService;
|
||||
}),
|
||||
}));
|
||||
}
|
||||
|
||||
export default async function getServiceWidget(group, service) {
|
||||
const configuredServices = await servicesFromConfig();
|
||||
|
||||
const serviceGroup = configuredServices.find((g) => g.name === group);
|
||||
if (serviceGroup) {
|
||||
const serviceEntry = serviceGroup.services.find((s) => s.name === service);
|
||||
if (serviceEntry) {
|
||||
@@ -26,5 +136,16 @@ export default async function getServiceWidget(group, service) {
|
||||
}
|
||||
}
|
||||
|
||||
const discoveredServices = await servicesFromDocker();
|
||||
|
||||
const dockerServiceGroup = discoveredServices.find((g) => g.name === group);
|
||||
if (dockerServiceGroup) {
|
||||
const dockerServiceEntry = dockerServiceGroup.services.find((s) => s.name === service);
|
||||
if (dockerServiceEntry) {
|
||||
const { widget } = dockerServiceEntry;
|
||||
return widget;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user