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:
@@ -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[]> {
|
||||
|
||||
Reference in New Issue
Block a user