From f7357141ebebf610cdd563c450a3539256b7cce1 Mon Sep 17 00:00:00 2001 From: Bobban Rydh Date: Tue, 15 Sep 2026 21:34:50 +0200 Subject: [PATCH] Wire the Servers overview's Proxmox badge to the integration color setting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new integration badge-color setting only reached the Integrations page's Manage table — the Servers & Tasks overview card grid had its own hardcoded bg-purple-lt badge for Proxmox-linked servers that never picked it up. Reuses the same typeBadgeStyle pattern already used there and in the DNS module. Note: until a Proxmox color is set in Settings -> Badges, this badge now renders with Tabler's default neutral badge style rather than purple, matching how every other badge customized this way already behaves before a color is chosen. Co-Authored-By: Claude Sonnet 5 --- web/src/pages/ServersTasks.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/web/src/pages/ServersTasks.tsx b/web/src/pages/ServersTasks.tsx index 100959c..73b150f 100644 --- a/web/src/pages/ServersTasks.tsx +++ b/web/src/pages/ServersTasks.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useMemo, useState } from "react"; +import { useCallback, useEffect, useMemo, useState, type CSSProperties } from "react"; import { Link } from "react-router-dom"; import { api, @@ -22,6 +22,12 @@ const SCHEDULE_TYPE_OPTIONS: { value: ScheduleType; label: string }[] = [ { value: "manual", label: "Other / manual" }, ]; +function typeBadgeStyle(colors: Record, type: string): CSSProperties { + const color = colors[type]; + if (!color) return {}; + return { backgroundColor: `${color}22`, color, border: `1px solid ${color}55` }; +} + function installCommand(token: string, insecure: boolean): string { const curlFlags = insecure ? "-fsSL -k" : "-fsSL"; const envVars = insecure @@ -51,6 +57,11 @@ export default function ServersTasks({ user }: { user: CurrentUser }) { const [tasks, setTasks] = useState(null); const [error, setError] = useState(null); const [managingServers, setManagingServers] = useState(false); + const [integrationColors, setIntegrationColors] = useState>({}); + + useEffect(() => { + api.settings.integrationColors().then((res) => setIntegrationColors(res.integrationColors)).catch(() => {}); + }, []); const [filters, setFilters] = useState({ serverId: undefined as number | undefined, @@ -381,7 +392,9 @@ export default function ServersTasks({ user }: { user: CurrentUser }) {
{s.hostname ?? "no hostname reported"}
{s.proxmoxIntegrationId ? ( - Proxmox + + Proxmox + ) : s.lastSeenAt ? ( Agent ) : (