fix(ui): сохранять переходные и неизвестные состояния OSPF
This commit is contained in:
1 parent
c18c148a23
commit
3dc25628af
9 files changed
+82
-22
No files matched your search
@@ -7,6 +7,7 @@ import {
|
||||
type ColumnDef,
|
||||
useTable,
|
||||
} from "@tanstack/react-table"
|
||||
import type { OspfNeighborState } from "@/lib/ospf-state"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { DataGridShell } from "@/components/data-grids/shared/data-grid-shell"
|
||||
import {
|
||||
@@ -28,7 +29,7 @@ export interface OspfNeighborRow {
|
||||
remoteLabel: string
|
||||
remoteRouterId: string
|
||||
area: string
|
||||
state: "Full" | "2-Way" | "ExStart" | "Down"
|
||||
state: OspfNeighborState
|
||||
cost: number
|
||||
uptime: string
|
||||
priority: number
|
||||
@@ -37,7 +38,8 @@ export interface OspfNeighborRow {
|
||||
function stateClass(state: OspfNeighborRow["state"]) {
|
||||
if (state === "Full")
|
||||
return "bg-[var(--status-online-bg)] text-[var(--status-online-fg)] border-current/25"
|
||||
if (state === "2-Way")
|
||||
if (state === "Unknown") return "bg-muted text-muted-foreground border-border"
|
||||
if (state !== "Down")
|
||||
return "bg-[var(--status-degraded-bg)] text-[var(--status-degraded-fg)] border-current/25"
|
||||
return "bg-[var(--status-offline-bg)] text-[var(--status-offline-fg)] border-current/25"
|
||||
}
|
||||
@@ -133,7 +135,7 @@ function OspfNeighborsDataGrid({
|
||||
row.original.dataUnknown ? "bg-muted text-muted-foreground" : stateClass(row.original.state),
|
||||
)}
|
||||
>
|
||||
{row.original.dataUnknown ? "Неизвестно" : row.original.state}
|
||||
{row.original.dataUnknown || row.original.state === "Unknown" ? "Неизвестно" : row.original.state}
|
||||
</span>
|
||||
),
|
||||
meta: {
|
||||
|
||||
Reference in new issue
Block a user