fix(beszel): make chart stacking configurable and fix color mismatch

BeszelAreaChart hardcoded type="stacked" for all charts, causing Docker
Network I/O to render blended colors that didn't match the tooltip.

- Make `type` prop configurable (default "default")
- Only stack Memory, Docker CPU, and Docker Memory charts
- Add systemId as a persisted widget option with Menu-based selector
- Replace Popover with Menu trigger="click-hover" for proper hover UX
- Show error state with Select when selected system is not found
- Remove 1-minute time period (live SSE not wired yet)
This commit is contained in:
Thomas Camlong committed 2026-06-15 14:58:14 +02:00
1 parent ab41b76a66
commit 82eac2dcc1
3 files changed
+132 -42

No files matched your search

@@ -1,4 +1,4 @@
import { IconChartAreaLine } from "@tabler/icons-react";
import { IconChartAreaLine, IconServerOff } from "@tabler/icons-react";
import { createWidgetDefinition } from "../definition";
import { optionsBuilder } from "../options";
@@ -17,7 +17,11 @@ export const { definition, componentLoader } = createWidgetDefinition("beszelSys
integrationsRequired: true,
createOptions() {
return optionsBuilder.from((factory) => ({
timePeriod: factory.select({ defaultValue: "1h", options: timePeriodOptions }),
systemId: factory.text({ defaultValue: "" }),
timePeriod: factory.select({
defaultValue: "1h",
options: timePeriodOptions,
}),
showCpu: factory.switch({ defaultValue: true }),
showMemory: factory.switch({ defaultValue: true }),
showDisk: factory.switch({ defaultValue: true }),
@@ -28,4 +32,10 @@ export const { definition, componentLoader } = createWidgetDefinition("beszelSys
showDockerNetwork: factory.switch({ defaultValue: true }),
}));
},
errors: {
INTERNAL_SERVER_ERROR: {
icon: IconServerOff,
message: (t) => t("widget.beszelSystemStats.error.internalServerError"),
},
},
}).withDynamicImport(() => import("./component"));