mirror of
https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
synced 2025-10-29 01:12:19 +00:00
[WIFI-12585] Fix entity button on device page
Signed-off-by: Charles <charles.bourque96@gmail.com>
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ucentral-client",
|
||||
"version": "2.10.0(38)",
|
||||
"version": "2.10.0(39)",
|
||||
"description": "",
|
||||
"private": true,
|
||||
"main": "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) => (
|
||||
<option value={v} key={uuid()}>
|
||||
{v}
|
||||
{interfaceNameLabel(v)}
|
||||
</option>
|
||||
))
|
||||
: null}
|
||||
|
||||
Reference in New Issue
Block a user