mirror of
https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
synced 2025-11-02 11:17:46 +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",
|
"name": "ucentral-client",
|
||||||
"version": "2.10.0(39)",
|
"version": "2.10.0(40)",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ucentral-client",
|
"name": "ucentral-client",
|
||||||
"version": "2.10.0(39)",
|
"version": "2.10.0(40)",
|
||||||
"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(39)",
|
"version": "2.10.0(40)",
|
||||||
"description": "",
|
"description": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "index.tsx",
|
"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 '-';
|
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 (
|
return (
|
||||||
<Card mb={4}>
|
<Card mb={4}>
|
||||||
<CardHeader
|
<CardHeader
|
||||||
@@ -74,7 +87,7 @@ const DeviceSummary = ({ serialNumber }: Props) => {
|
|||||||
<CardBody>
|
<CardBody>
|
||||||
<Flex w="100%" alignItems="center">
|
<Flex w="100%" alignItems="center">
|
||||||
<Image
|
<Image
|
||||||
src={`devices/${getDevice.data?.compatible}.png`}
|
src={`devices/${getDeviceCompatible()}.png`}
|
||||||
alt={getDevice?.data?.compatible}
|
alt={getDevice?.data?.compatible}
|
||||||
fallback={
|
fallback={
|
||||||
<Box minW="220px" w="220px" h="220px" mr={4} display="flex">
|
<Box minW="220px" w="220px" h="220px" mr={4} display="flex">
|
||||||
|
|||||||
Reference in New Issue
Block a user