fix(ui): улучшить мобильную сводку и детали BGP

This commit is contained in:
Denozordec committed 2026-09-30 17:23:18 +07:00
1 parent aa678b9d5d
commit 72a63b4a4f
13 files changed
+76 -15

No files matched your search

+11 -7
View File
@@ -286,6 +286,7 @@ function SessionsTab({ sessions, emptyTitle, selectedSessionId, onSelectSession
{urlError && <Alert variant="warning"><AlertCircleIcon /><AlertDescription>{urlError}<Button variant="outline" size="sm" onClick={reset}>Сбросить фильтры BGP</Button></AlertDescription></Alert>}
<DataPageCard>
<DataPageToolbar
className="[&>div:first-child]:max-w-full [&>div:first-child]:overflow-x-auto [&>div:first-child_button]:shrink-0 [&>div:first-child_button]:whitespace-nowrap"
segmented={{
value: stateFilter,
onChange: setStateFilter,
@@ -324,6 +325,7 @@ function SessionsTab({ sessions, emptyTitle, selectedSessionId, onSelectSession
</div>
}
/>
{selectedSessionId && sessions.some(s => s.id === selectedSessionId) && !filtered.some(s => s.id === selectedSessionId) && <p role="status" className="px-5 py-2 text-xs text-muted-foreground">Сессия из ссылки скрыта текущими фильтрами.</p>}
{hasFilters && !urlError && <Button variant="ghost" size="sm" onClick={reset}>Сбросить фильтры BGP</Button>}
<BgpSessionsDataGrid sessions={filtered} emptyTitle={urlError ? "Некорректные фильтры BGP" : emptyTitle} selectedSessionId={selectedSessionId} onSelectSession={onSelectSession} />
</DataPageCard>
@@ -454,18 +456,19 @@ function AnalyticsTab({ sessions }: { sessions: BgpSession[] }) {
return (
<div className="flex flex-col gap-5">
<KpiStatGrid
gridClassName="grid-cols-2 @3xl:grid-cols-2 @6xl:grid-cols-4"
aria-label="Сводка префиксов BGP"
items={[
{
id: "rx",
label: "Всего префиксов",
label: "Префиксы",
value: fmtNum(totalRx),
icon: <DownloadIcon className="size-4" />,
iconClassName: "text-success",
},
{
id: "active",
label: "Активных маршрутов",
label: "Маршруты",
hint: totalActive === null ? "нет данных API" : undefined,
value: fmtNum(totalActive),
icon: <GitMergeIcon className="size-4" />,
@@ -473,14 +476,14 @@ function AnalyticsTab({ sessions }: { sessions: BgpSession[] }) {
},
{
id: "ebgp",
label: "eBGP сессий",
label: "eBGP",
value: sessions.some(s => s.type === "Unknown") ? "—" : ebgpSessions,
icon: <ActivityIcon className="size-4" />,
iconClassName: "text-muted-foreground",
},
{
id: "ibgp",
label: "iBGP сессий",
label: "iBGP",
value: sessions.some(s => s.type === "Unknown") ? "—" : ibgpSessions,
icon: <ServerIcon className="size-4" />,
iconClassName: "text-muted-foreground",
@@ -809,11 +812,12 @@ function BgpPageContent({ selectedServerId, selectedSessionId, activeTab, onSele
)}
<KpiStatGrid
gridClassName="grid-cols-2 @3xl:grid-cols-2 @6xl:grid-cols-4"
aria-label="Сводка BGP"
items={[
{
id: "sessions",
label: "Сессий всего",
label: "Сессий",
value: incomplete ? "—" : sessions.length,
hint: incomplete ? "неизвестно" : undefined,
icon: <GitMergeIcon className="size-4" />,
@@ -828,7 +832,7 @@ function BgpPageContent({ selectedServerId, selectedSessionId, activeTab, onSele
},
{
id: "not-estab",
label: "Не установлено",
label: "Не поднято",
value: incomplete || sessions.some(s => s.state === "Unknown") ? "—" : notEstab,
icon: <AlertCircleIcon className="size-4" />,
iconClassName: notEstab > 0 ? "text-warning" : "text-muted-foreground",
@@ -836,7 +840,7 @@ function BgpPageContent({ selectedServerId, selectedSessionId, activeTab, onSele
},
{
id: "prefixes",
label: "Получено префиксов",
label: "Префиксы",
value: incomplete ? "—" : fmtNum(totalRx),
icon: <DownloadIcon className="size-4" />,
iconClassName: "text-info",