docs(beszel): update system stats widget documentation and add time-period config
Update docs with new widget options and add client-side time-period configuration for future live streaming support.
This commit is contained in:
2 files changed
+21
-2
No files matched your search
@@ -10,10 +10,10 @@ export const beszelSystemStatsWidget: WidgetDefinition = {
|
||||
items: [
|
||||
{
|
||||
name: "Time period",
|
||||
description: "The time range for chart data",
|
||||
description: "The time range for chart data. '1 Minute' enables live streaming via PocketBase SSE (requires Beszel agent >= 0.13.0)",
|
||||
values: {
|
||||
type: "select",
|
||||
options: ["1 Hour", "12 Hours", "24 Hours", "1 Week", "30 Days"],
|
||||
options: ["1 Minute", "1 Hour", "12 Hours", "24 Hours", "1 Week", "30 Days"],
|
||||
},
|
||||
defaultValue: "1 Hour",
|
||||
},
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
export const beszelTimePeriods = ["1m", "1h", "12h", "24h", "1w", "30d"] as const;
|
||||
export type BeszelTimePeriod = (typeof beszelTimePeriods)[number];
|
||||
|
||||
export const beszelTimePeriodConfig: Record<
|
||||
BeszelTimePeriod,
|
||||
{
|
||||
beszelStatType: string;
|
||||
perPage: number;
|
||||
refetchMs: number;
|
||||
serverCacheSeconds: number;
|
||||
}
|
||||
> = {
|
||||
"1m": { beszelStatType: "1m", perPage: 60, refetchMs: 0, serverCacheSeconds: 5 },
|
||||
"1h": { beszelStatType: "1m", perPage: 60, refetchMs: 60_000, serverCacheSeconds: 60 },
|
||||
"12h": { beszelStatType: "10m", perPage: 72, refetchMs: 300_000, serverCacheSeconds: 300 },
|
||||
"24h": { beszelStatType: "20m", perPage: 72, refetchMs: 600_000, serverCacheSeconds: 600 },
|
||||
"1w": { beszelStatType: "120m", perPage: 84, refetchMs: 1_800_000, serverCacheSeconds: 1800 },
|
||||
"30d": { beszelStatType: "480m", perPage: 90, refetchMs: 3_600_000, serverCacheSeconds: 3600 },
|
||||
};
|
||||
Reference in new issue
Block a user