import { useQuery } from "@tanstack/react-query" import Chart from "chart.js/auto" import { useEffect, useLayoutEffect, useRef, useState } from "react" import { beszelSystemsQuery } from "./beszel" import cn from "./components/lib/cn" import { StatusSeverity, TubeLine, formatLineName, tflDisruptionsQuery } from "./tfl" import { DEFAULT_LATITUDE, DEFAULT_LONGITUDE, currentWeatherQuery, dailyForecastQuery, getWeatherIcon, weatherDescriptionQuery, } from "./weather" function App() { return (
{formattedDate}
{formattedTime}
Loading weather
Error loading weather
{error?.message ?? "Unknown error"}
H:{highTemp}°
L:{lowTemp}°
{temperature}°
{weatherDescriptionContent}
Loading tube status
Error loading from TfL
{errorTFL?.message}
No TfL data available
{lineName}
{reason}
> ) } function SystemTile({ className, systemName, displayName, }: { className?: string; systemName: string; displayName: string }) { const { data } = useQuery({ ...beszelSystemsQuery(), refetchInterval: 1000, refetchIntervalInBackground: true, }) const chartRef = useRefNo system status available
{displayName}
CPU
{beszelSystemsData.info.cpu.toFixed(0).padStart(3, "0")}
RAM
{beszelSystemsData.info.ram.toFixed(0).padStart(3, "0")}
DSK
{beszelSystemsData.info.disk.toFixed(0).padStart(3, "0")}