Identify unknown devices: OUI vendor lookup, mDNS, manual labels
- OUI: mac-oui-lookup package resolves vendor from the MAC prefix (computed on read, no storage needed). Already correctly identifies the LXC host prefix as "Proxmox Server Solutions GmbH" and several "unknown" devices as "Amazon Technologies Inc." -- likely the Echo Dots / Ring gear. - mDNS: discover-devices.sh now runs avahi-resolve per discovered IP (parallel, bounded 2s timeout per host so one non-mDNS device can't stall the run), stored in a new devices.mdns_hostname column. - Manual labels: new device_labels table keyed by MAC (survives DHCP IP changes), PUT/DELETE /api/devices/:mac/label, inline-editable Name cell in the dashboard. Deliberately separate from vendor/mDNS info -- those are shown as an italic *hint* for unlabeled devices, not treated as "known" until the admin actually confirms one. - Fixed the Name column's sort comparator to match what's rendered (name, else vendor/mDNS hint) instead of just the raw name field -- caught while reasoning through what the existing sort test would actually need to assert once hints appear in the column. Part of #15 (OUI/mDNS/manual labels done; on-demand deep-check next). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ interface RawEntry {
|
||||
ip: string;
|
||||
mac: string;
|
||||
state: string;
|
||||
mdnsHostname?: string;
|
||||
}
|
||||
|
||||
// Reads the JSON file produced by scripts/discover-devices.sh (a systemd timer
|
||||
@@ -30,6 +31,7 @@ export async function refreshDevices(
|
||||
ip: entry.ip,
|
||||
mac: entry.mac,
|
||||
knownName: knownDevices.get(entry.ip) ?? null,
|
||||
mdnsHostname: entry.mdnsHostname ?? null,
|
||||
}));
|
||||
|
||||
upsertDevices(db, devices);
|
||||
|
||||
Reference in New Issue
Block a user