mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui.git
synced 2025-11-01 19:27:51 +00:00
feature/WIFI-1012: Added client device status support
This commit is contained in:
@@ -24,7 +24,25 @@ const clientDevicesTableColumns = [
|
|||||||
{ title: 'SSID', dataIndex: 'ssid' },
|
{ title: 'SSID', dataIndex: 'ssid' },
|
||||||
{ title: 'BAND', dataIndex: 'radioType' },
|
{ title: 'BAND', dataIndex: 'radioType' },
|
||||||
{ title: 'SIGNAL', dataIndex: 'signal' },
|
{ title: 'SIGNAL', dataIndex: 'signal' },
|
||||||
{ title: 'STATUS', dataIndex: 'status' },
|
{
|
||||||
|
title: 'STATUS',
|
||||||
|
dataIndex: ['details', 'associationState'],
|
||||||
|
render: text => (
|
||||||
|
<>
|
||||||
|
{!text ? (
|
||||||
|
'N/A'
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{text === 'Active_Data' ? (
|
||||||
|
'Connected'
|
||||||
|
) : (
|
||||||
|
<>{text === 'Disconnected' ? 'Disconnected' : 'N/A'}</>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const ClientDevices = ({ checkedLocations }) => {
|
const ClientDevices = ({ checkedLocations }) => {
|
||||||
@@ -82,35 +100,11 @@ const ClientDevices = ({ checkedLocations }) => {
|
|||||||
fetchFilterClientSessions();
|
fetchFilterClientSessions();
|
||||||
}, [checkedLocations]);
|
}, [checkedLocations]);
|
||||||
|
|
||||||
const clientDevicesTableData = () => {
|
|
||||||
const oldTableData = data && data.filterClientSessions && data.filterClientSessions.items;
|
|
||||||
if (!oldTableData) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
const newTable = oldTableData.map(obj => {
|
|
||||||
let status = obj.details.associationState;
|
|
||||||
if (status === 'Active_Data') {
|
|
||||||
status = 'Connected';
|
|
||||||
} else if (status === 'Disconnected') {
|
|
||||||
status = 'Disconnected';
|
|
||||||
} else {
|
|
||||||
status = 'N/A';
|
|
||||||
}
|
|
||||||
|
|
||||||
const newObj = { ...obj, status };
|
|
||||||
delete newObj.details;
|
|
||||||
return newObj;
|
|
||||||
});
|
|
||||||
|
|
||||||
return newTable;
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NetworkTableContainer
|
<NetworkTableContainer
|
||||||
activeTab="/network/client-devices"
|
activeTab="/network/client-devices"
|
||||||
tableColumns={clientDevicesTableColumns}
|
tableColumns={clientDevicesTableColumns}
|
||||||
tableData={clientDevicesTableData()}
|
tableData={data?.filterClientSessions?.items}
|
||||||
onLoadMore={handleLoadMore}
|
onLoadMore={handleLoadMore}
|
||||||
onRefresh={handleOnRefresh}
|
onRefresh={handleOnRefresh}
|
||||||
isLastPage={data && data.filterClientSessions && data.filterClientSessions.context.lastPage}
|
isLastPage={data && data.filterClientSessions && data.filterClientSessions.context.lastPage}
|
||||||
|
|||||||
Reference in New Issue
Block a user