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 ) : (