mirror of
https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
synced 2025-10-29 17:32:20 +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",
|
"name": "ucentral-client",
|
||||||
"version": "2.10.0(38)",
|
"version": "2.10.0(39)",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ucentral-client",
|
"name": "ucentral-client",
|
||||||
"version": "2.10.0(38)",
|
"version": "2.10.0(39)",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@chakra-ui/icons": "^2.0.18",
|
"@chakra-ui/icons": "^2.0.18",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ucentral-client",
|
"name": "ucentral-client",
|
||||||
"version": "2.10.0(38)",
|
"version": "2.10.0(39)",
|
||||||
"description": "",
|
"description": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "index.tsx",
|
"main": "index.tsx",
|
||||||
|
|||||||
@@ -14,6 +14,25 @@ import { CardBody } from 'components/Containers/Card/CardBody';
|
|||||||
import { CardHeader } from 'components/Containers/Card/CardHeader';
|
import { CardHeader } from 'components/Containers/Card/CardHeader';
|
||||||
import { LoadingOverlay } from 'components/LoadingOverlay';
|
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 = {
|
type Props = {
|
||||||
serialNumber: string;
|
serialNumber: string;
|
||||||
};
|
};
|
||||||
@@ -61,7 +80,7 @@ const DeviceStatisticsCard = ({ serialNumber }: Props) => {
|
|||||||
{parsedData?.interfaces
|
{parsedData?.interfaces
|
||||||
? Object.keys(parsedData.interfaces).map((v) => (
|
? Object.keys(parsedData.interfaces).map((v) => (
|
||||||
<option value={v} key={uuid()}>
|
<option value={v} key={uuid()}>
|
||||||
{v}
|
{interfaceNameLabel(v)}
|
||||||
</option>
|
</option>
|
||||||
))
|
))
|
||||||
: null}
|
: null}
|
||||||
|
|||||||
Reference in New Issue
Block a user