From af8bfc702cc01282ceb504d3795a0983d8ac01a6 Mon Sep 17 00:00:00 2001 From: Marc Brooks Date: Mon, 10 Nov 2025 19:18:10 +0000 Subject: [PATCH] Localize LLDP card --- ui/localization/messages/en.json | 9 +++++++ ui/src/components/LLDPNeighborsCard.tsx | 26 +++++++++---------- ui/src/hooks/stores.ts | 2 -- .../routes/devices.$id.settings.network.tsx | 6 ++--- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/ui/localization/messages/en.json b/ui/localization/messages/en.json index bf446099..a3433685 100644 --- a/ui/localization/messages/en.json +++ b/ui/localization/messages/en.json @@ -634,10 +634,19 @@ "network_ipv6_mode_title": "IPv6 Mode", "network_ipv6_prefix": "IP Prefix", "network_ipv6_prefix_invalid": "Prefix must be between 0 and 128", + "network_ll_dp_chassis_id": "Chassis ID", "network_ll_dp_description": "Control which TLVs will be sent over Link Layer Discovery Protocol", "network_ll_dp_disabled": "Disabled", + "network_ll_dp_mac_address": "MAC Address", + "network_ll_dp_management_address": "Management Address", + "network_ll_dp_neighbors": "LLDP Neighbors", + "network_ll_dp_port_description": "Port Description", + "network_ll_dp_port_id": "Port ID", "network_ll_dp_rx_and_tx": "Receive and transmit", "network_ll_dp_rx_only": "Receive only", + "network_ll_dp_source": "Source", + "network_ll_dp_system_description": "System Description", + "network_ll_dp_system_name": "System Name", "network_ll_dp_title": "LLDP", "network_ll_dp_tx_only": "Transmit only", "network_mac_address_copy_error": "Failed to copy MAC address", diff --git a/ui/src/components/LLDPNeighborsCard.tsx b/ui/src/components/LLDPNeighborsCard.tsx index eec31570..d62c8454 100644 --- a/ui/src/components/LLDPNeighborsCard.tsx +++ b/ui/src/components/LLDPNeighborsCard.tsx @@ -1,9 +1,7 @@ +import { LLDPNeighbor } from "@hooks/stores"; +import { GridCard } from "@components/Card"; import { cx } from "@/cva.config"; - -import { LLDPNeighbor } from "../hooks/stores"; - -import { GridCard } from "./Card"; - +import { m } from "@localizations/messages"; interface LLDPDataLineProps { label: string; @@ -31,7 +29,7 @@ export default function LLDPNeighborsCard({

- LLDP Neighbors + {m.network_ll_dp_neighbors()}

@@ -46,37 +44,37 @@ export default function LLDPNeighborsCard({
{neighbor.system_name && ( - + )} {neighbor.system_description && ( - + )} {neighbor.chassis_id && ( - + )} {neighbor.port_id && ( - + )} {neighbor.port_description && ( - + )} {neighbor.management_addresses && neighbor.management_addresses.length > 0 && ( neighbor.management_addresses.map((address, index) => ( - + )) )} {neighbor.mac && ( - + )} {neighbor.source && ( - + )}
diff --git a/ui/src/hooks/stores.ts b/ui/src/hooks/stores.ts index 7b27e9d7..ea52317f 100644 --- a/ui/src/hooks/stores.ts +++ b/ui/src/hooks/stores.ts @@ -835,8 +835,6 @@ export const useNetworkStateStore = create((set, get) => ({ }, })); - - export interface LLDPNeighborsState { neighbors: LLDPNeighbor[]; setNeighbors: (neighbors: LLDPNeighbor[]) => void; diff --git a/ui/src/routes/devices.$id.settings.network.tsx b/ui/src/routes/devices.$id.settings.network.tsx index 98525d08..1e28d717 100644 --- a/ui/src/routes/devices.$id.settings.network.tsx +++ b/ui/src/routes/devices.$id.settings.network.tsx @@ -16,9 +16,10 @@ import EmptyCard from "@components/EmptyCard"; import { GridCard } from "@components/Card"; import InputField, { InputFieldWithLabel } from "@components/InputField"; import Ipv6NetworkCard from "@components/Ipv6NetworkCard"; -import { SelectMenuBasic } from "@/components/SelectMenuBasic"; +import LLDPNeighborsCard from "@components/LLDPNeighborsCard"; +import { SelectMenuBasic } from "@components/SelectMenuBasic"; import { SettingsItem } from "@components/SettingsItem"; -import { SettingsPageHeader } from "@/components/SettingsPageheader"; +import { SettingsPageHeader } from "@components/SettingsPageheader"; import StaticIpv4Card from "@components/StaticIpv4Card"; import StaticIpv6Card from "@components/StaticIpv6Card"; import { useCopyToClipboard } from "@components/useCopyToClipBoard"; @@ -26,7 +27,6 @@ import { netMaskFromCidr4 } from "@/utils/ip"; import { getNetworkSettings, getNetworkState, getLLDPNeighbors } from "@/utils/jsonrpc"; import notifications from "@/notifications"; import { m } from "@localizations/messages"; -import LLDPNeighborsCard from "@components/LLDPNeighborsCard"; dayjs.extend(relativeTime);