pull/543/head
Michael Shamoon 2 years ago
commit e4c0a62fd9

@ -103,7 +103,9 @@
"tx": "TX",
"mem": "الرام",
"cpu": "المعالج",
"offline": "غير متصل"
"offline": "غير متصل",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "يعمل الان",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -55,7 +55,9 @@
"rx": "RX",
"tx": "TX",
"mem": "MEM",
"cpu": "CPU"
"cpu": "CPU",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "Възпроизвежда",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"ping": "Ping",
"error": "Error"
}
}

@ -45,7 +45,9 @@
"tx": "Transmès",
"mem": "Memòria",
"cpu": "Processador",
"offline": "Fora de línia"
"offline": "Fora de línia",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "Reproduint",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -57,7 +57,9 @@
"tx": "TX",
"mem": "RAM",
"cpu": "CPU",
"offline": "Offline"
"offline": "Offline",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "Přehrává",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -181,7 +181,9 @@
"rx": "RX",
"tx": "TX",
"mem": "RAM",
"offline": "Offline"
"offline": "Offline",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "Afspiller",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -23,7 +23,9 @@
"tx": "Tx",
"mem": "Mem",
"cpu": "Prozessor",
"offline": "Offline"
"offline": "Offline",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "Spielen",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"ping": "Ping",
"error": "Error"
}
}

@ -56,7 +56,13 @@
"tx": "TX",
"mem": "MEM",
"cpu": "CPU",
"offline": "Offline"
"offline": "Offline",
"error": "Error",
"unknown": "Unknown"
},
"ping": {
"error": "Error",
"ping": "Ping"
},
"emby": {
"playing": "Playing",

@ -3,10 +3,10 @@
"missing_type": "Falta el tipo de widget: {{type}}",
"api_error": "Error de API",
"status": "Estado",
"information": "Information",
"information": "Información",
"url": "URL",
"raw_error": "Raw Error",
"response_data": "Response Data"
"raw_error": "Error sin procesar",
"response_data": "Datos de respuesta"
},
"search": {
"placeholder": "Buscar…"
@ -23,7 +23,9 @@
"tx": "Transmitido",
"mem": "Memoria",
"cpu": "Procesador",
"offline": "Desconectado"
"offline": "Desconectado",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "Reproduciendo",
@ -325,7 +327,11 @@
"country": "País"
},
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
"channels": "Canales",
"hd": "Alta definición"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -29,7 +29,9 @@
"tx": "TX",
"mem": "RAM",
"cpu": "CPU",
"offline": "Offline"
"offline": "Offline",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "Toistaa",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -23,7 +23,9 @@
"tx": "Tx",
"mem": "Mém",
"cpu": "Cpu",
"offline": "Hors ligne"
"offline": "Hors ligne",
"error": "Erreur",
"unknown": "Inconnu"
},
"emby": {
"playing": "En lecture",
@ -325,7 +327,11 @@
"country": "Pays"
},
"hdhomerun": {
"channels": "Channels",
"channels": "Canaux",
"hd": "HD"
},
"ping": {
"error": "Erreur",
"ping": "Ping"
}
}

@ -29,7 +29,9 @@
"tx": "TX",
"mem": "זיכרון",
"cpu": "מעבד",
"offline": "כבוי"
"offline": "כבוי",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "מנגן",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -79,7 +79,9 @@
"tx": "TX",
"mem": "MEM",
"cpu": "CPU",
"offline": "Offline"
"offline": "Offline",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "Playing",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -59,17 +59,19 @@
"missing_type": "Nedostajuća vrsta widgeta: {{type}}",
"api_error": "API greška",
"status": "Stanje",
"information": "Information",
"information": "Informacije",
"url": "URL",
"raw_error": "Raw Error",
"response_data": "Response Data"
"raw_error": "Raw greška",
"response_data": "Podaci odgovora"
},
"docker": {
"rx": "RX",
"tx": "TX",
"mem": "MEM",
"cpu": "CPU",
"offline": "Nepovezan"
"offline": "Nepovezan",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "Reprodukcija",
@ -320,12 +322,16 @@
"total": "Ukupno"
},
"gluetun": {
"public_ip": "Public IP",
"region": "Region",
"country": "Country"
"public_ip": "Javni IP",
"region": "Regija",
"country": "Zemlja"
},
"hdhomerun": {
"channels": "Channels",
"channels": "Kanali",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -11,7 +11,9 @@
"tx": "TX",
"mem": "MEM",
"cpu": "CPU",
"offline": "Offline"
"offline": "Offline",
"error": "Error",
"unknown": "Unknown"
},
"lidarr": {
"albums": "Albumok",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -4,7 +4,9 @@
"mem": "MEM",
"cpu": "CPU",
"offline": "Offline",
"rx": "RX"
"rx": "RX",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "In riproduzione",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -150,7 +150,9 @@
"tx": "TX",
"mem": "MEM",
"cpu": "CPU",
"offline": "Luar talian"
"offline": "Luar talian",
"error": "Error",
"unknown": "Unknown"
},
"changedetectionio": {
"totalObserved": "Jumlah Diperhatikan",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -23,7 +23,9 @@
"tx": "Sendt",
"mem": "Minne",
"cpu": "Prosessor",
"offline": "Frakoblet"
"offline": "Frakoblet",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "Spiller",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -20,7 +20,9 @@
"tx": "TX",
"mem": "MEM",
"cpu": "CPU",
"offline": "Offline"
"offline": "Offline",
"error": "Error",
"unknown": "Unknown"
},
"speedtest": {
"upload": "Upload",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -53,17 +53,19 @@
"missing_type": "Brakujący typ widżetu: {{type}}",
"api_error": "Błąd API",
"status": "Stan",
"url": "URL",
"information": "Information",
"raw_error": "Raw Error",
"response_data": "Response Data"
"url": "Adres URL",
"information": "Informacje",
"raw_error": "Niesformatowany błąd",
"response_data": "Dane odpowiedzi"
},
"docker": {
"rx": "RX",
"tx": "TX",
"mem": "MEM",
"cpu": "CPU",
"offline": "Offline"
"rx": "Rx",
"tx": "Tx",
"mem": "Pamięć",
"cpu": "Procesor",
"offline": "Offline",
"error": "Błąd",
"unknown": "Nieznany"
},
"nzbget": {
"rate": "Szybkość",
@ -95,7 +97,7 @@
"wanted": "Poszukiwane",
"queued": "W kolejce",
"movies": "Filmy",
"missing": "Missing"
"missing": "Brakujące"
},
"lidarr": {
"wanted": "Poszukiwane",
@ -166,14 +168,14 @@
},
"mastodon": {
"user_count": "Użytkownicy",
"status_count": "Posts",
"status_count": "Posty",
"domain_count": "Domeny"
},
"strelaysrv": {
"numActiveSessions": "Sesje",
"numConnections": "Połączenia",
"dataRelayed": "Relayed",
"transferRate": "Rate"
"dataRelayed": "Przekazane",
"transferRate": "Przesył"
},
"authentik": {
"users": "Użytkownicy",
@ -181,10 +183,10 @@
"failedLoginsLast24H": "Nieudane logowania (24h)"
},
"proxmox": {
"mem": "MEM",
"cpu": "CPU",
"lxc": "LXC",
"vms": "VMs"
"mem": "Pamięć",
"cpu": "Procesor",
"lxc": "Kontenery LXC",
"vms": "Maszyn wirtualnych"
},
"unifi": {
"users": "Użytkownicy",
@ -203,25 +205,25 @@
"wlan_devices": "Urządzenia WLAN"
},
"plex": {
"streams": "Active Streams",
"streams": "Aktywne strumienie",
"movies": "Filmy",
"tv": "Seriale"
},
"glances": {
"cpu": "CPU",
"mem": "MEM",
"cpu": "Procesor",
"mem": "Pamięć",
"wait": "Proszę czekać"
},
"changedetectionio": {
"diffsDetected": "Diffs Detected",
"totalObserved": "Total Observed"
"diffsDetected": "Wykryto różnic",
"totalObserved": "Obserwowanych ogółem"
},
"wmo": {
"77-day": "Snow Grains",
"77-day": "Ziarnisty śnieg",
"0-day": "Słoneczny",
"0-night": "Clear",
"1-day": "Mainly Sunny",
"1-night": "Mainly Clear",
"0-night": "Bezchmurny",
"1-day": "Głównie słoneczny",
"1-night": "Głównie bezchmurny",
"2-day": "Częściowo pochmurnie",
"2-night": "Częściowo pochmurnie",
"3-day": "Pochmurnie",
@ -236,10 +238,10 @@
"53-night": "Mżawka",
"55-day": "Ciężka mżawka",
"55-night": "Ciężka mżawka",
"56-day": "Light Freezing Drizzle",
"56-night": "Light Freezing Drizzle",
"57-day": "Freezing Drizzle",
"57-night": "Freezing Drizzle",
"56-day": "Lekko chłodna mżawka",
"56-night": "Lekko chłodna mżawka",
"57-day": "Chłodna mżawka",
"57-night": "Chłodna mżawka",
"61-day": "Lekki deszcz",
"61-night": "Lekki deszcz",
"63-day": "Deszcz",
@ -256,7 +258,7 @@
"73-night": "Śnieg",
"75-day": "Ciężki śnieg",
"75-night": "Ciężki śnieg",
"77-night": "Snow Grains",
"77-night": "Ziarnisty śnieg",
"80-day": "Lekkie opady",
"80-night": "Lekkie opady",
"81-day": "Opady",
@ -275,7 +277,7 @@
"99-night": "Burza z gradobiciem"
},
"quicklaunch": {
"bookmark": "Bookmark",
"bookmark": "Zakładka",
"service": "Usługi"
},
"homebridge": {
@ -287,45 +289,49 @@
"child_bridges_status": "{{ok}}/{{total}}"
},
"autobrr": {
"approvedPushes": "Approved",
"rejectedPushes": "Rejected",
"filters": "Filters",
"indexers": "Indexers"
"approvedPushes": "Zaakceptowane",
"rejectedPushes": "Odrzucone",
"filters": "Filtry",
"indexers": "Indeksery"
},
"watchtower": {
"containers_scanned": "Scanned",
"containers_updated": "Updated",
"containers_failed": "Failed"
"containers_scanned": "Zeskanowane",
"containers_updated": "Zaktualizowane",
"containers_failed": "Niepowodzenie"
},
"tubearchivist": {
"downloads": "Queue",
"videos": "Videos",
"channels": "Channels",
"playlists": "Playlists"
"downloads": "Kolejka",
"videos": "Pliki wideo",
"channels": "Kanały",
"playlists": "Playlisty"
},
"truenas": {
"load": "System Load",
"uptime": "Uptime",
"alerts": "Alerts",
"load": "Obciążenie systemu",
"uptime": "Czas działania",
"alerts": "Ostrzeżenia",
"time": "{{value, number(style: unit; unitDisplay: long;)}}"
},
"navidrome": {
"please_wait": "Please Wait",
"nothing_streaming": "No Active Streams"
"please_wait": "Proszę czekać",
"nothing_streaming": "Brak aktywnych strumieni"
},
"pyload": {
"speed": "Speed",
"active": "Active",
"queue": "Queue",
"total": "Total"
"speed": "Prędkość",
"active": "Aktywne",
"queue": "Kolejka",
"total": "Razem"
},
"gluetun": {
"public_ip": "Public IP",
"public_ip": "Adres publiczny",
"region": "Region",
"country": "Country"
"country": "Państwo"
},
"hdhomerun": {
"channels": "Channels",
"channels": "Kanały",
"hd": "HD"
},
"ping": {
"error": "Błąd",
"ping": "Ping"
}
}

@ -57,7 +57,9 @@
"tx": "Tx",
"mem": "Mem",
"cpu": "CPU",
"offline": "Desligado"
"offline": "Desligado",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "Reproduzindo",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -23,7 +23,9 @@
"tx": "Tx",
"mem": "Mem",
"cpu": "CPU",
"offline": "Desligado"
"offline": "Desligado",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "A reproduzir",
@ -338,5 +340,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -11,7 +11,9 @@
"tx": "TX",
"mem": "MEM",
"cpu": "CPU",
"offline": "Offline"
"offline": "Offline",
"error": "Error",
"unknown": "Unknown"
},
"jellyseerr": {
"approved": "Aprobate",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -23,7 +23,9 @@
"tx": "Тx",
"mem": "Память",
"cpu": "Процессор",
"offline": "Не в сети"
"offline": "Не в сети",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "Воспроизведение",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -45,7 +45,9 @@
"tx": "TX",
"mem": "MEM",
"cpu": "CPU",
"offline": "Offline"
"offline": "Offline",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "Playing",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -26,7 +26,9 @@
"tx": "TX",
"mem": "MEM",
"cpu": "CPU",
"offline": "Offline"
"offline": "Offline",
"error": "Error",
"unknown": "Unknown"
},
"search": {
"placeholder": "Sök…"
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -46,7 +46,9 @@
"tx": "TX",
"mem": "MEM",
"cpu": "సీపియూ",
"offline": "ఆఫ్‌లైన్"
"offline": "ఆఫ్‌లైన్",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "ఆడుతున్నారు",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -45,7 +45,9 @@
"tx": "Giden Veri",
"mem": "Bellek",
"cpu": "İşlemci",
"offline": "Çevrimdışı"
"offline": "Çevrimdışı",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "Oynatılıyor",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -23,7 +23,9 @@
"tx": "TX",
"mem": "BỘ NHỚ",
"cpu": "CPU",
"offline": "Ngoại tuyến"
"offline": "Ngoại tuyến",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "Đang chơi",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -47,7 +47,9 @@
"tx": "發送",
"mem": "內存",
"cpu": "處理器",
"offline": "離線"
"offline": "離線",
"error": "Error",
"unknown": "Unknown"
},
"nzbget": {
"rate": "速度",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -23,7 +23,9 @@
"tx": "发送",
"mem": "内存",
"cpu": "处理器",
"offline": "离线"
"offline": "离线",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "播放中",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -19,7 +19,9 @@
"offline": "Offline",
"tx": "TX",
"mem": "MEM",
"cpu": "CPU"
"cpu": "CPU",
"error": "Error",
"unknown": "Unknown"
},
"emby": {
"playing": "Playing",
@ -327,5 +329,9 @@
"hdhomerun": {
"channels": "Channels",
"hd": "HD"
},
"ping": {
"error": "Error",
"ping": "Ping"
}
}

@ -3,6 +3,7 @@ import { useContext, useState } from "react";
import Status from "./status";
import Widget from "./widget";
import Ping from "./ping";
import Docker from "widgets/docker/component";
import { SettingsContext } from "utils/contexts/settings";
@ -30,7 +31,7 @@ export default function Item({ service }) {
<div
className={`${
hasLink ? "cursor-pointer " : " "
}transition-all h-15 mb-3 p-1 rounded-md font-medium text-theme-700 dark:text-theme-200 dark:hover:text-theme-300 shadow-md shadow-theme-900/10 dark:shadow-theme-900/20 bg-theme-100/20 hover:bg-theme-300/20 dark:bg-white/5 dark:hover:bg-white/10`}
}transition-all h-15 mb-3 p-1 rounded-md font-medium text-theme-700 dark:text-theme-200 dark:hover:text-theme-300 shadow-md shadow-theme-900/10 dark:shadow-theme-900/20 bg-theme-100/20 hover:bg-theme-300/20 dark:bg-white/5 dark:hover:bg-white/10 relative`}
>
<div className="flex select-none">
{service.icon &&
@ -70,17 +71,26 @@ export default function Item({ service }) {
</div>
)}
<div className="absolute top-0 right-0 w-1/2 flex flex-row justify-end gap-2 mr-2">
{service.ping && (
<div className="flex-shrink-0 flex items-center justify-center cursor-pointer">
<Ping service={service} />
<span className="sr-only">Ping status</span>
</div>
)}
{service.container && (
<button
type="button"
onClick={() => (statsOpen ? closeStats() : setStatsOpen(true))}
className="flex-shrink-0 flex items-center justify-center w-12 cursor-pointer"
className="flex-shrink-0 flex items-center justify-center cursor-pointer"
>
<Status service={service} />
<span className="sr-only">View container stats</span>
</button>
)}
</div>
</div>
{service.container && service.server && (
<div

@ -0,0 +1,44 @@
import { useTranslation } from "react-i18next";
import useSWR from "swr";
export default function Ping({ service }) {
const { t } = useTranslation();
const { data, error } = useSWR(`/api/ping?${new URLSearchParams({ping: service.ping}).toString()}`, {
refreshInterval: 30000
});
if (error) {
return (
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden">
<div className="text-[8px] font-bold text-rose-500 uppercase">{t("ping.error")}</div>
</div>
);
}
if (!data) {
return (
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden">
<div className="text-[8px] font-bold text-black/20 dark:text-white/40 uppercase">{t("ping.ping")}</div>
</div>
);
}
const statusText = `${service.ping}: HTTP status ${data.status}`;
if (data && data.status !== 200) {
return (
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={statusText}>
<div className="text-[8px] font-bold text-rose-500/80">{data.status}</div>
</div>
);
}
if (data && data.status === 200) {
return (
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={statusText}>
<div className="text-[8px] font-bold text-emerald-500/80">{t("common.ms", { value: data.latency, style: "unit", unit: "millisecond", unitDisplay: "narrow", maximumFractionDigits: 0 })}</div>
</div>
);
}
}

@ -1,19 +1,36 @@
import { useTranslation } from "react-i18next";
import useSWR from "swr";
export default function Status({ service }) {
const { t } = useTranslation();
const { data, error } = useSWR(`/api/docker/status/${service.container}/${service.server || ""}`);
if (error) {
return <div className="w-3 h-3 bg-rose-300 dark:bg-rose-500 rounded-full" />;
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={data.status}>
<div className="text-[8px] font-bold text-rose-500/80 uppercase">{t("docker.error")}</div>
</div>
}
if (data && data.status === "running") {
return <div className="w-3 h-3 bg-emerald-300 dark:bg-emerald-500 rounded-full" />;
return (
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={data.status}>
<div className="text-[8px] font-bold text-emerald-500/80 uppercase">{data.status}</div>
</div>
);
}
if (data && data.status === "not found") {
return <div className="h-2.5 w-2.5 bg-orange-400/50 dark:bg-yellow-200/40 -rotate-45" />;
if (data && (data.status === "not found" || data.status === "exited")) {
return (
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={data.status}>
<div className="text-[8px] font-bold text-orange-400/50 dark:text-orange-400/80 uppercase">{data.status}</div>
</div>
);
}
return <div className="w-3 h-3 bg-black/20 dark:bg-white/40 rounded-full" />;
return (
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden">
<div className="text-[8px] font-bold text-black/20 dark:text-white/40 uppercase">{t("docker.unknown")}</div>
</div>
);
}

@ -0,0 +1,28 @@
import { performance } from "perf_hooks";
import createLogger from "utils/logger";
import { httpProxy } from "utils/proxy/http";
const logger = createLogger("ping");
export default async function handler(req, res) {
const { ping: pingURL } = req.query;
if (!pingURL) {
logger.debug("No ping URL specified");
return res.status(400).send({
error: "No ping URL given",
});
}
const startTime = performance.now();
const [status] = await httpProxy(pingURL, {
method: "HEAD"
});
const endTime = performance.now();
return res.status(200).json({
status,
latency: endTime - startTime
});
}

@ -4,10 +4,15 @@ import { format as utilFormat } from "node:util";
import winston from "winston";
import checkAndCopyConfig, { getSettings } from "utils/config/config";
let winstonLogger;
function init() {
const configPath = join(process.cwd(), "config");
checkAndCopyConfig("settings.yaml");
const settings = getSettings();
const logpath = settings.logpath || configPath;
function combineMessageAndSplat() {
return {
@ -57,7 +62,7 @@ function init() {
winston.format.timestamp(),
winston.format.printf(messageFormatter)
),
filename: `${configPath}/logs/homepage.log`,
filename: `${logpath}/logs/homepage.log`,
handleExceptions: true,
handleRejections: true,
}),

@ -96,7 +96,7 @@ export async function httpProxy(url, params = {}) {
return [status, contentType, data, responseHeaders];
}
catch (err) {
logger.error("Error calling %s//%s%s...", url.protocol, url.hostname, url.pathname);
logger.error("Error calling %s//%s%s...", constructedUrl.protocol, constructedUrl.hostname, constructedUrl.pathname);
logger.error(err);
return [500, "application/json", { error: {message: err?.message ?? "Unknown error", url, rawError: err} }, null];
}

Loading…
Cancel
Save