diff --git a/package-lock.json b/package-lock.json index c3a663c..dbdd746 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ucentral-client", - "version": "2.10.0(38)", + "version": "2.10.0(39)", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ucentral-client", - "version": "2.10.0(38)", + "version": "2.10.0(39)", "license": "ISC", "dependencies": { "@chakra-ui/icons": "^2.0.18", diff --git a/package.json b/package.json index 7af0bb3..9eb3302 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ucentral-client", - "version": "2.10.0(38)", + "version": "2.10.0(39)", "description": "", "private": true, "main": "index.tsx", diff --git a/src/pages/Device/StatisticsCard/index.tsx b/src/pages/Device/StatisticsCard/index.tsx index a30785b..122c260 100644 --- a/src/pages/Device/StatisticsCard/index.tsx +++ b/src/pages/Device/StatisticsCard/index.tsx @@ -14,6 +14,25 @@ import { CardBody } from 'components/Containers/Card/CardBody'; import { CardHeader } from 'components/Containers/Card/CardHeader'; import { LoadingOverlay } from 'components/LoadingOverlay'; +const interfaceNameLabel = (v?: string) => { + if (!v) return ''; + + if (v.startsWith('up')) { + const split = v.split('v'); + const vlanId = split[split.length - 1]; + + return vlanId === '0' ? 'Upstream' : `Upstream - Vlan ${vlanId}`; + } + if (v.startsWith('down')) { + const split = v.split('v'); + const vlanId = split[split.length - 1]; + + return vlanId === '0' ? 'Downstream' : `Downstream - Vlan ${vlanId}`; + } + + return v; +}; + type Props = { serialNumber: string; }; @@ -61,7 +80,7 @@ const DeviceStatisticsCard = ({ serialNumber }: Props) => { {parsedData?.interfaces ? Object.keys(parsedData.interfaces).map((v) => ( )) : null}