Skip to content

Commit b5e9229

Browse files
committed
feat: Add an option to remove duplicate devices during network search
1 parent 0e36c2e commit b5e9229

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

jccm/src/Frontend/Layout/InventorySearch/InventorySearchResult.js

+19-15
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,20 @@ export const InventorySearchResult = ({ columns, items, rowHeight, disabled, und
133133
const handleExportNoDuplicatedDevices = () => {
134134
// Define a mapping from object keys to Excel column names
135135
const columnMapping = {
136-
organization: 'Organization',
137-
site: 'Site',
138-
address: 'Address',
139-
port: 'Port',
140-
username: 'Username',
141-
password: 'Password',
142-
hardwareModel: 'Hardware Model',
143-
osName: 'OS Name',
144-
osVersion: 'OS Version',
145-
serialNumber: 'Serial Number',
146-
hostName: 'Host Name',
147-
routerId: 'Router ID',
148-
interfaceName: 'Interface Name',
149-
prunedAddresses: 'Pruned Addresses', // New column for removed addresses
136+
organization: 'organization',
137+
site: 'site',
138+
address: 'address',
139+
port: 'port',
140+
username: 'username',
141+
password: 'password',
142+
hardwareModel: 'hardware model',
143+
osName: 'os name',
144+
osVersion: 'os version',
145+
serialNumber: 'serial number',
146+
hostName: 'host name',
147+
routerId: 'router id',
148+
interfaceName: 'interface name',
149+
prunedAddresses: 'pruned addresses', // New column for removed addresses
150150
};
151151

152152
// Helper function to compare IPv4 addresses numerically
@@ -201,7 +201,11 @@ export const InventorySearchResult = ({ columns, items, rowHeight, disabled, und
201201
// Join pruned addresses into a single string
202202
orderedRow[columnMapping[key]] = item.prunedAddresses.join(', ') || 'N/A';
203203
} else {
204-
const value = item[key] ?? `Your ${key}`;
204+
let value = item[key] ?? `Your ${key}`;
205+
value =
206+
value !== null && typeof value === 'object' && !Array.isArray(value)
207+
? value.values.join(', ')
208+
: value;
205209

206210
orderedRow[columnMapping[key]] = value;
207211
}

0 commit comments

Comments
 (0)