mirror of
https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
synced 2025-10-29 17:32:20 +00:00
Merge pull request #185 from stephb9959/main
[WIFI-12603] Fallback if country code is contained in device type
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(39)",
|
||||
"version": "2.10.0(40)",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ucentral-client",
|
||||
"version": "2.10.0(39)",
|
||||
"version": "2.10.0(40)",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@chakra-ui/icons": "^2.0.18",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ucentral-client",
|
||||
"version": "2.10.0(39)",
|
||||
"version": "2.10.0(40)",
|
||||
"description": "",
|
||||
"private": true,
|
||||
"main": "index.tsx",
|
||||
|
||||
BIN
public/devices/cig_wf196.png
Normal file
BIN
public/devices/cig_wf196.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
BIN
public/devices/generic_ap.png
Normal file
BIN
public/devices/generic_ap.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
@@ -61,6 +61,19 @@ const DeviceSummary = ({ serialNumber }: Props) => {
|
||||
|
||||
return '-';
|
||||
};
|
||||
|
||||
const getDeviceCompatible = () => {
|
||||
if (!getDevice.data?.compatible) return undefined;
|
||||
|
||||
if (!getDevice.data?.compatible.includes('-')) return getDevice.data?.compatible;
|
||||
|
||||
const split = getDevice.data?.compatible.split('-');
|
||||
|
||||
if (split[split.length - 1]?.length === 2) return split[0]?.trim();
|
||||
|
||||
return getDevice.data?.compatible;
|
||||
};
|
||||
|
||||
return (
|
||||
<Card mb={4}>
|
||||
<CardHeader
|
||||
@@ -74,7 +87,7 @@ const DeviceSummary = ({ serialNumber }: Props) => {
|
||||
<CardBody>
|
||||
<Flex w="100%" alignItems="center">
|
||||
<Image
|
||||
src={`devices/${getDevice.data?.compatible}.png`}
|
||||
src={`devices/${getDeviceCompatible()}.png`}
|
||||
alt={getDevice?.data?.compatible}
|
||||
fallback={
|
||||
<Box minW="220px" w="220px" h="220px" mr={4} display="flex">
|
||||
|
||||
Reference in New Issue
Block a user