Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions ui/localization/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -634,12 +634,21 @@
"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_rx_only": "Receive only",
"network_ll_dp_tx_only": "Transmit only",
"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",
"network_mac_address_copy_success": "MAC address { mac } copied to clipboard",
"network_mac_address_description": "Hardware identifier for the network interface",
Expand Down
26 changes: 12 additions & 14 deletions ui/src/components/LLDPNeighborsCard.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -31,7 +29,7 @@ export default function LLDPNeighborsCard({
<div className="animate-fadeIn p-4 text-black opacity-0 animation-duration-500 dark:text-white">
<div className="space-y-4">
<h3 className="text-base font-bold text-slate-900 dark:text-white">
LLDP Neighbors
{m.network_ll_dp_neighbors()}
</h3>

<div className="space-y-3 pt-2">
Expand All @@ -46,37 +44,37 @@ export default function LLDPNeighborsCard({
<div className="grid grid-cols-2 gap-x-8 gap-y-4">

{neighbor.system_name && (
<LLDPDataLine label="System Name" value={neighbor.system_name} />
<LLDPDataLine label={m.network_ll_dp_system_name()} value={neighbor.system_name} />
)}

{neighbor.system_description && (
<LLDPDataLine label="System Description" value={neighbor.system_description} className="col-span-2" />
<LLDPDataLine label={m.network_ll_dp_system_description()} value={neighbor.system_description} className="col-span-2" />
)}

{neighbor.chassis_id && (
<LLDPDataLine label="Chassis ID" value={neighbor.chassis_id} />
<LLDPDataLine label={m.network_ll_dp_chassis_id()} value={neighbor.chassis_id} />
)}

{neighbor.port_id && (
<LLDPDataLine label="Port ID" value={neighbor.port_id} />
<LLDPDataLine label={m.network_ll_dp_port_id()} value={neighbor.port_id} />
)}

{neighbor.port_description && (
<LLDPDataLine label="Port Description" value={neighbor.port_description} />
<LLDPDataLine label={m.network_ll_dp_port_description()} value={neighbor.port_description} />
)}

{neighbor.management_addresses && neighbor.management_addresses.length > 0 && (
neighbor.management_addresses.map((address, index) => (
<LLDPDataLine label="Management Address" value={address.address} key={index} />
<LLDPDataLine label={m.network_ll_dp_management_address()} value={address.address} key={index} />
))
)}

{neighbor.mac && (
<LLDPDataLine label="MAC Address" value={neighbor.mac} className="font-mono" />
<LLDPDataLine label={m.network_ll_dp_mac_address()} value={neighbor.mac} className="font-mono" />
)}

{neighbor.source && (
<LLDPDataLine label="Source" value={neighbor.source} />
<LLDPDataLine label={m.network_ll_dp_source()} value={neighbor.source} />
)}
</div>
</div>
Expand Down
2 changes: 0 additions & 2 deletions ui/src/hooks/stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,6 @@ export const useNetworkStateStore = create<NetworkState>((set, get) => ({
},
}));



export interface LLDPNeighborsState {
neighbors: LLDPNeighbor[];
setNeighbors: (neighbors: LLDPNeighbor[]) => void;
Expand Down
6 changes: 3 additions & 3 deletions ui/src/routes/devices.$id.settings.network.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ 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";
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);

Expand Down