Fix: Add missing IP and MAC filtering logic in Devices page
This commit is contained in:
1 parent
1bb67e99dd
commit
a4dc705a3d
2 files changed
+9
-1
No files matched your search
+3
-1
@@ -41,11 +41,13 @@ async function collectAllAgents() {
|
||||
$set: {
|
||||
uuid: a.uuid,
|
||||
serial: a.serial || a.uuid,
|
||||
label: a.label,
|
||||
site_uuid: 'global', // Store globally
|
||||
provisioned: a.provisioned ?? true,
|
||||
activated: a.activated ?? false,
|
||||
last_seen_at: a.last_seen_at ?? null,
|
||||
},
|
||||
$setOnInsert: {
|
||||
label: a.label,
|
||||
}
|
||||
},
|
||||
{ upsert: true, new: true }
|
||||
|
||||
@@ -163,6 +163,12 @@ export default function DevicesPage() {
|
||||
if (filters.device_type && filters.device_type !== "All" && row.device_type !== filters.device_type) return false;
|
||||
if (filters.os_label && filters.os_label !== "All" && row.os_label !== filters.os_label) return false;
|
||||
if (filters.manufacturer && filters.manufacturer !== "All" && row.manufacturer !== filters.manufacturer) return false;
|
||||
if (filters.ip && filters.ip.trim() !== "" && filters.ip !== "All") {
|
||||
if (!row.ip_address || !row.ip_address.toLowerCase().includes(filters.ip.toLowerCase())) return false;
|
||||
}
|
||||
if (filters.mac && filters.mac.trim() !== "" && filters.mac !== "All") {
|
||||
if (!row.mac_address || !row.mac_address.toLowerCase().includes(filters.mac.toLowerCase())) return false;
|
||||
}
|
||||
|
||||
if (dateFrom || dateTo) {
|
||||
const d = row.last_seen ? new Date(row.last_seen).toISOString().slice(0, 10) : "";
|
||||
|
||||
Reference in new issue
Block a user