From 2c84a4c9c2e4cf472ee5b22a17214e155eace918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Tue, 18 Aug 2026 16:58:47 +0200 Subject: [PATCH] fix: remove project name badges from the Coolify widget Coolify was the only service reporting the generic detail field (project name chips); drop it end to end - collector, type, and the widget's chip row - rather than leave the plumbing for zero producers. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01WpxhtQY3CExQdMs4j7MmJe --- components/widgets/service/Widget.tsx | 9 --------- lib/collectors/service.ts | 2 +- lib/collectors/services/coolify.ts | 15 ++------------- lib/types/service-result.ts | 1 - 4 files changed, 3 insertions(+), 24 deletions(-) diff --git a/components/widgets/service/Widget.tsx b/components/widgets/service/Widget.tsx index 795c082..222c216 100644 --- a/components/widgets/service/Widget.tsx +++ b/components/widgets/service/Widget.tsx @@ -60,15 +60,6 @@ export function ServiceWidget({ widget, widgetId }: { widget: ServiceWidget; wid ))} )} - {data.detail && data.detail.length > 0 && ( -
- {data.detail.map((entry) => ( - - {entry} - - ))} -
- )} {data.statError && {data.statError}} {widget.showStats && data.docker.cpuPercent !== null && memPercent !== null && (
diff --git a/lib/collectors/service.ts b/lib/collectors/service.ts index 9b22f45..bfa058a 100644 --- a/lib/collectors/service.ts +++ b/lib/collectors/service.ts @@ -9,7 +9,7 @@ import { collectUmami } from "./services/umami"; import { collectHeadscale } from "./services/headscale"; import { collectTraefikStat } from "./services/traefik"; -function collectServiceStat(widget: ServiceWidget): Promise<{ stats: ServiceStat[]; detail?: string[] }> { +function collectServiceStat(widget: ServiceWidget): Promise<{ stats: ServiceStat[] }> { switch (widget.service) { case "gitea": return collectGitea(widget); diff --git a/lib/collectors/services/coolify.ts b/lib/collectors/services/coolify.ts index 9eb23d4..1ff2148 100644 --- a/lib/collectors/services/coolify.ts +++ b/lib/collectors/services/coolify.ts @@ -2,12 +2,6 @@ import type { CoolifyServiceWidget } from "@/lib/config/schema"; import type { ServiceStat } from "@/lib/types/service-result"; import { serviceBaseUrl } from "./base-url"; -const DETAIL_LIMIT = 5; - -interface CoolifyProject { - name: string; -} - async function fetchCoolify(base: string, path: string, apiToken: string): Promise { const response = await fetch(`${base}${path}`, { headers: { Authorization: `Bearer ${apiToken}` }, @@ -19,22 +13,17 @@ async function fetchCoolify(base: string, path: string, apiToken: string): Pr return (await response.json()) as T; } -export async function collectCoolify( - widget: CoolifyServiceWidget -): Promise<{ stats: ServiceStat[]; detail?: string[] }> { +export async function collectCoolify(widget: CoolifyServiceWidget): Promise<{ stats: ServiceStat[] }> { const base = serviceBaseUrl(widget); const [projects, resources] = await Promise.all([ - fetchCoolify(base, "/api/v1/projects", widget.apiToken), + fetchCoolify(base, "/api/v1/projects", widget.apiToken), fetchCoolify(base, "/api/v1/resources", widget.apiToken), ]); - const names = projects.slice(0, DETAIL_LIMIT).map((p) => p.name); - if (projects.length > DETAIL_LIMIT) names.push(`+${projects.length - DETAIL_LIMIT} more`); return { stats: [ { label: "Projects", value: String(projects.length) }, { label: "Resources", value: String(resources.length) }, ], - detail: names.length > 0 ? names : undefined, }; } diff --git a/lib/types/service-result.ts b/lib/types/service-result.ts index 1a48aca..c06e094 100644 --- a/lib/types/service-result.ts +++ b/lib/types/service-result.ts @@ -8,6 +8,5 @@ export interface ServiceStat { export interface ServiceWidgetResult { docker: DockerContainerResult; stats: ServiceStat[]; - detail?: string[]; statError?: string; }