fix naming + data type

This commit is contained in:
csehviktor
2025-07-15 04:30:27 +02:00
parent 96b844d3ac
commit 5cc98e2b67
3 changed files with 11 additions and 9 deletions
+5 -5
View File
@@ -1,6 +1,6 @@
import type { StatusMessage } from "@/services/types";
export type TimePeriod = "all" | "hour" | "day" | "week" | "month";
export type TimePeriod = "realtime" | "hour" | "day" | "week" | "month" | "all";
let data: StatusMessage[] = [];
const maxRealtimePoints = 50;
@@ -13,12 +13,12 @@ export function addDataPoint(value: StatusMessage) {
}
}
export function getRealtimeData(): StatusMessage[] {
return data ?? [];
export function addDataPoint(value: StatusMessage) {
realtimeData.push(value);
}
export function setHistoricalData(value: StatusMessage[]) {
data = value;
export function getRealtimeData(): StatusMessage[] {
return realtimeData ?? [];
}
export async function getHistoricalData(url: string): Promise<StatusMessage[]> {