mirror of
https://github.com/csehviktor/status-monitor.git
synced 2026-04-29 00:27:35 +02:00
fix naming + data type
This commit is contained in:
@@ -22,10 +22,12 @@ export function AgentPage() {
|
||||
const { agent } = useParams();
|
||||
const { status, message } = useWebsocket(`ws://localhost:3000/ws/${agent}`);
|
||||
|
||||
const [period, setPeriod] = useState<TimePeriod | "realtime">("all");
|
||||
const [period, setPeriod] = useState<TimePeriod>("realtime");
|
||||
const [history, setHistory] = useState<StatusMessage[] | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (period === "realtime") return;
|
||||
|
||||
const fetchData = async () => {
|
||||
const data = await getHistoricalData(
|
||||
`http://localhost:3000/history/${agent}/${period}`,
|
||||
|
||||
Reference in New Issue
Block a user