feat: show WAF count in blocked stat card; clean up proxy hosts table

- Analytics: show "X from WAF" sub-stat under Blocked Requests card
- Proxy hosts: remove WAF column and redundant Status column (toggle already shows enabled state)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
fuomag9
2026-03-04 22:44:52 +01:00
parent c20ba54b4c
commit bd4220c74c
2 changed files with 2 additions and 30 deletions

View File

@@ -458,6 +458,7 @@ export default function AnalyticsClient() {
<StatCard
label="Blocked Requests"
value={summary.blockedRequests.toLocaleString()}
sub={(wafStats?.total ?? 0) > 0 ? `${wafStats!.total.toLocaleString()} from WAF` : undefined}
color={summary.blockedRequests > 0 ? '#ef4444' : undefined}
/>
</Grid>

View File

@@ -2,8 +2,7 @@
import { useEffect, useRef, useState } from "react";
import { useRouter, usePathname, useSearchParams } from "next/navigation";
import { Chip, IconButton, Stack, Switch, Tooltip, Typography } from "@mui/material";
import SecurityIcon from "@mui/icons-material/Security";
import { IconButton, Stack, Switch, Tooltip, Typography } from "@mui/material";
import EditIcon from "@mui/icons-material/Edit";
import DeleteIcon from "@mui/icons-material/Delete";
import ContentCopyIcon from "@mui/icons-material/ContentCopy";
@@ -15,7 +14,6 @@ import { toggleProxyHostAction } from "./actions";
import { PageHeader } from "@/src/components/ui/PageHeader";
import { SearchField } from "@/src/components/ui/SearchField";
import { DataTable } from "@/src/components/ui/DataTable";
import { StatusChip } from "@/src/components/ui/StatusChip";
import { CreateHostDialog, EditHostDialog, DeleteHostDialog } from "@/src/components/proxy-hosts/HostDialogs";
type Props = {
@@ -96,33 +94,6 @@ export default function ProxyHostsClient({ hosts, certificates, accessLists, aut
</Typography>
)
},
{
id: "waf",
label: "WAF",
render: (host: ProxyHost) => {
if (!host.waf?.enabled) return <Typography variant="body2" color="text.disabled"></Typography>;
const excludedCount = host.waf.excluded_rule_ids?.length ?? 0;
return (
<Stack direction="row" alignItems="center" spacing={0.5}>
<SecurityIcon sx={{ fontSize: 16, color: 'success.light' }} />
{excludedCount > 0 && (
<Chip
label={`${excludedCount} suppressed`}
size="small"
sx={{ fontSize: 11, height: 20 }}
/>
)}
</Stack>
);
}
},
{
id: "status",
label: "Status",
render: (host: ProxyHost) => (
<StatusChip status={host.enabled ? "active" : "inactive"} label={host.enabled ? "Active" : "Paused"} />
)
},
{
id: "actions",
label: "Actions",