mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Show scanner source in device event tooltip
Surface the originating scanner ("ARP" or "mDNS") in the event timeline
tooltip so users can tell which scanner reported each sighting.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
d6cf9be412
commit
55a6b29d1c
@@ -257,9 +257,10 @@ class _EventChart extends StatelessWidget {
|
||||
final event = events[idx];
|
||||
final dt = event.createdOn.toLocal();
|
||||
final dateStr = DateFormat('MMM d, yyyy HH:mm').format(dt);
|
||||
final typeLabel = event.eventType == 'NewDevice'
|
||||
final baseLabel = event.eventType == 'NewDevice'
|
||||
? 'First seen'
|
||||
: 'Device seen';
|
||||
final typeLabel = '$baseLabel (${event.scannerLabel})';
|
||||
|
||||
final diffs = <TextSpan>[];
|
||||
if (event.ipv4Address != device.ipv4Address) {
|
||||
|
||||
@@ -5,6 +5,7 @@ class DeviceEvent {
|
||||
final String eventType;
|
||||
final String ipv4Address;
|
||||
final String vendor;
|
||||
final String scanner;
|
||||
|
||||
const DeviceEvent({
|
||||
required this.id,
|
||||
@@ -13,6 +14,7 @@ class DeviceEvent {
|
||||
required this.eventType,
|
||||
required this.ipv4Address,
|
||||
required this.vendor,
|
||||
required this.scanner,
|
||||
});
|
||||
|
||||
factory DeviceEvent.fromJson(Map<String, dynamic> json) {
|
||||
@@ -23,6 +25,13 @@ class DeviceEvent {
|
||||
eventType: json['event_type'] as String,
|
||||
ipv4Address: json['ipv4_address'] as String,
|
||||
vendor: json['vendor'] as String,
|
||||
scanner: json['scanner'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
String get scannerLabel => switch (scanner) {
|
||||
'Arp' => 'ARP',
|
||||
'Mdns' => 'mDNS',
|
||||
_ => scanner,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user