fix(ui): сохранять поиск и выбранный узел OSPF
This commit is contained in:
1 parent
1d522527b4
commit
7a68ae8184
9 files changed
+113
-32
No files matched your search
@@ -45,6 +45,7 @@ function stateClass(state: OspfNeighborRow["state"]) {
|
||||
}
|
||||
|
||||
interface OspfNeighborsDataGridProps {
|
||||
emptyTitle?: string
|
||||
neighbors: OspfNeighborRow[]
|
||||
highlightRouterId?: string | null
|
||||
selectedRouterId?: string | null
|
||||
@@ -54,6 +55,7 @@ interface OspfNeighborsDataGridProps {
|
||||
|
||||
function OspfNeighborsDataGrid({
|
||||
neighbors,
|
||||
emptyTitle,
|
||||
highlightRouterId,
|
||||
selectedRouterId,
|
||||
onSelect,
|
||||
@@ -211,7 +213,7 @@ function OspfNeighborsDataGrid({
|
||||
return (
|
||||
<EmptyState
|
||||
icon={<NetworkIcon className="size-4" />}
|
||||
title="Нет OSPF-соседей"
|
||||
title={emptyTitle ?? "Нет OSPF-соседей"}
|
||||
className="border-0 py-10"
|
||||
/>
|
||||
)
|
||||
|
||||
@@ -39,10 +39,11 @@ function routeTypeClass(type: OspfRouteRow["type"]) {
|
||||
}
|
||||
|
||||
interface OspfRoutesDataGridProps {
|
||||
emptyTitle?: string
|
||||
routes: OspfRouteRow[]
|
||||
}
|
||||
|
||||
function OspfRoutesDataGrid({ routes }: OspfRoutesDataGridProps) {
|
||||
function OspfRoutesDataGrid({ routes, emptyTitle }: OspfRoutesDataGridProps) {
|
||||
const columns = useMemo<ColumnDef<DataGridFeatures, OspfRouteRow>[]>(
|
||||
() => [
|
||||
{
|
||||
@@ -153,7 +154,7 @@ function OspfRoutesDataGrid({ routes }: OspfRoutesDataGridProps) {
|
||||
return (
|
||||
<EmptyState
|
||||
icon={<RouteIcon className="size-4" />}
|
||||
title="Нет OSPF-маршрутов"
|
||||
title={emptyTitle ?? "Нет OSPF-маршрутов"}
|
||||
className="border-0 py-10"
|
||||
/>
|
||||
)
|
||||
|
||||
@@ -30,6 +30,7 @@ interface DataPageToolbarProps<T extends string = string> {
|
||||
search?: string
|
||||
onSearchChange?: (value: string) => void
|
||||
searchPlaceholder?: string
|
||||
searchLabel?: string
|
||||
segmented?: {
|
||||
value: T
|
||||
onChange: (value: T) => void
|
||||
@@ -46,6 +47,7 @@ function DataPageToolbar<T extends string = string>({
|
||||
search,
|
||||
onSearchChange,
|
||||
searchPlaceholder = "Поиск…",
|
||||
searchLabel,
|
||||
segmented,
|
||||
filterControl,
|
||||
countLabel,
|
||||
@@ -69,6 +71,7 @@ function DataPageToolbar<T extends string = string>({
|
||||
<SearchIcon className="size-3.5" />
|
||||
</InputGroupAddon>
|
||||
<InputGroupInput
|
||||
aria-label={searchLabel ?? searchPlaceholder}
|
||||
placeholder={searchPlaceholder}
|
||||
value={search ?? ""}
|
||||
onChange={(e) => onSearchChange(e.target.value)}
|
||||
|
||||
Reference in new issue
Block a user