cleanup: remove alert configuration icons from dashboard

- Removed cog/bell-slash icons next to guest names
- Users can see alert configuration in the Alerts settings tab
- Cleaned up unused alert override loading code
- Simplified dashboard display to reduce visual clutter
This commit is contained in:
Pulse Monitor
2025-08-21 10:39:56 +00:00
parent 590c80ea63
commit dc509d103e
2 changed files with 1 additions and 41 deletions
@@ -1,4 +1,4 @@
import { createSignal, createMemo, createEffect, For, Show, onMount } from 'solid-js';
import { createSignal, createMemo, createEffect, For, Show } from 'solid-js';
import type { VM, Container, Node } from '@/types/api';
import { GuestRow } from './GuestRow';
import NodeCard from './NodeCard';
@@ -9,7 +9,6 @@ import { createTooltipSystem, showTooltip, hideTooltip } from '@/components/shar
import { ComponentErrorBoundary } from '@/components/ErrorBoundary';
import { ScrollableTable } from '@/components/shared/ScrollableTable';
import { parseFilterStack, evaluateFilterStack } from '@/utils/searchQuery';
import { AlertsAPI } from '@/api/alerts';
interface DashboardProps {
vms: VM[];
@@ -25,7 +24,6 @@ export function Dashboard(props: DashboardProps) {
const { connected, activeAlerts, initialDataReceived } = useWebSocket();
const [search, setSearch] = createSignal('');
const [isSearchLocked, setIsSearchLocked] = createSignal(false);
const [alertOverrides, setAlertOverrides] = createSignal<Record<string, any>>({});
// Initialize from localStorage with proper type checking
const storedViewMode = localStorage.getItem('dashboardViewMode');
@@ -51,17 +49,6 @@ export function Dashboard(props: DashboardProps) {
// Create tooltip system
const TooltipComponent = createTooltipSystem();
// Load alert overrides on mount
onMount(async () => {
try {
const config = await AlertsAPI.getConfig();
if (config.overrides) {
setAlertOverrides(config.overrides);
}
} catch (err) {
console.error('Failed to load alert overrides:', err);
}
});
// Create a mapping from node name to host URL
@@ -761,14 +748,11 @@ export function Dashboard(props: DashboardProps) {
<ComponentErrorBoundary name="GuestRow">
{(() => {
const guestId = guest.id || `${guest.instance}-${guest.name}-${guest.vmid}`;
const override = alertOverrides()[guestId];
return (
<GuestRow
guest={guest}
showNode={false}
alertStyles={getAlertStyles(guestId, activeAlerts)}
hasOverride={!!override}
overrideDisabled={override?.disabled === true}
/>
);
})()}
@@ -27,8 +27,6 @@ interface GuestRowProps {
alertCount: number;
severity: 'critical' | 'warning' | null;
};
hasOverride?: boolean;
overrideDisabled?: boolean;
customUrl?: string;
}
@@ -119,28 +117,6 @@ export function GuestRow(props: GuestRowProps) {
</a>
</Show>
{/* Override indicator */}
<Show when={props.hasOverride}>
<div
class={`flex items-center ${props.overrideDisabled ? 'text-gray-400' : 'text-blue-500'}`}
title={props.overrideDisabled ? 'Alerts disabled for this guest' : 'Custom alert thresholds'}
>
<Show when={props.overrideDisabled} fallback={
<svg class="w-3.5 h-3.5" fill="currentColor" viewBox="0 0 20 20">
{/* Settings/cog icon for custom thresholds */}
<path fill-rule="evenodd" d="M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z" clip-rule="evenodd" />
</svg>
}>
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 20 20">
{/* Outline bell with slash for disabled alerts */}
<path stroke-linecap="round" stroke-linejoin="round" d="M10 2a6 6 0 00-6 6v3.586l-.707.707A1 1 0 004 14h12a1 1 0 00.707-1.707L16 11.586V8a6 6 0 00-6-6zM10 18a3 3 0 01-3-3h6a3 3 0 01-3 3z" />
<path stroke-linecap="round" stroke-linejoin="round" d="M3 3l14 14" />
</svg>
</Show>
</div>
</Show>
{/* Alert indicators */}
<Show when={props.alertStyles?.hasAlert}>
<div class="flex items-center gap-1">