fix(beszel): review fixes for MCP and widget styling

- Throw TRPCError instead of returning null when no integration
- Sort beszelRouter import alphabetically in mcp.ts
- Replace ternary with lookup table for background color
- Mention integration_all in MCP server instructions
This commit is contained in:
Thomas Camlong committed 2026-06-16 15:18:13 +02:00
1 parent 420c0c30e4
commit 0a05bbed8d
4 files changed
+8 -4

No files matched your search

+4 -1
View File
@@ -1,3 +1,4 @@
import { TRPCError } from "@trpc/server";
import { observable } from "@trpc/server/observable";
import { z } from "zod/v4";
@@ -160,7 +161,9 @@ export const beszelRouter = createTRPCRouter({
)
.query(async ({ ctx, input }) => {
const integration = ctx.integrations[0];
if (!integration) return null;
if (!integration) {
throw new TRPCError({ code: "BAD_REQUEST", message: "At least one Beszel integrationId is required" });
}
const innerHandler = beszelStatsRequestHandler.handler(integration, {
systemId: input.systemId,
timePeriod: input.timePeriod,