diff --git a/src/ui/AppShell.tsx b/src/ui/AppShell.tsx index f601e158..1c0137a5 100644 --- a/src/ui/AppShell.tsx +++ b/src/ui/AppShell.tsx @@ -25,6 +25,7 @@ import { AdminSettingsPanel } from "@/sidebar/AdminSettingsPanel"; import { CredentialsPanel } from "@/sidebar/CredentialsPanel"; import { SplitView } from "@/shell/SplitView"; import { renderTabContent } from "@/shell/tabUtils"; +import { AlertManager } from "@/dashboard/panels/alerts/AlertManager"; import { TabBar } from "@/shell/TabBar"; import type { Tab, @@ -207,6 +208,7 @@ export function AppShell({ const [hostsLoading, setHostsLoading] = useState(true); const [allHosts, setAllHosts] = useState([]); const [isAdmin, setIsAdmin] = useState(false); + const [userId, setUserId] = useState(null); const [backgroundTabRecords, setBackgroundTabRecords] = useState< OpenTabRecord[] >([]); @@ -246,7 +248,10 @@ export function AppShell({ useEffect(() => { getUserInfo() - .then((info) => setIsAdmin(info.is_admin)) + .then((info) => { + setIsAdmin(info.is_admin); + setUserId(info.userId); + }) .catch(() => setIsAdmin(false)); }, []); @@ -1702,6 +1707,7 @@ export function AppShell({ }} /> + ); } diff --git a/src/ui/dashboard/panels/alerts/AlertCard.tsx b/src/ui/dashboard/panels/alerts/AlertCard.tsx index 04b7edb6..0700a60e 100644 --- a/src/ui/dashboard/panels/alerts/AlertCard.tsx +++ b/src/ui/dashboard/panels/alerts/AlertCard.tsx @@ -32,16 +32,19 @@ const getAlertIcon = (type?: string) => { } }; -const getAccentBarClass = (priority?: string, type?: string): string => { - if (priority === "critical" || type === "error") return "bg-destructive"; - if (priority === "high" || type === "warning") return "bg-accent-brand"; - if (priority === "medium" || type === "success") return "bg-green-400"; - return "bg-border"; +const getAccentBorderClass = (priority?: string, type?: string): string => { + if (priority === "critical" || type === "error") + return "border-t-2 border-t-destructive"; + if (priority === "high" || type === "warning") + return "border-t-2 border-t-accent-brand"; + if (priority === "medium" || type === "success") + return "border-t-2 border-t-green-400"; + return ""; }; const getPriorityBadgeVariant = ( priority?: string, -): "destructive" | "secondary" | "outline" => { +): "destructive" | "secondary" | "default" => { switch (priority) { case "critical": case "high": @@ -50,13 +53,13 @@ const getPriorityBadgeVariant = ( return "secondary"; case "low": default: - return "outline"; + return "default"; } }; const getTypeBadgeVariant = ( type?: string, -): "destructive" | "secondary" | "outline" => { +): "destructive" | "secondary" | "default" => { switch (type) { case "error": return "destructive"; @@ -65,7 +68,7 @@ const getTypeBadgeVariant = ( case "success": case "info": default: - return "outline"; + return "default"; } }; @@ -86,13 +89,9 @@ export function AlertCard({ }; return ( -
-
- +
{getAlertIcon(alert.type)} @@ -123,7 +122,7 @@ export function AlertCard({
)} -
+

{alert.message}