Add device event history chart to device details page

Displays a scatter chart timeline of when the device was seen online,
with a time range selector (Today → Last Year). Tooltips show event
date/time, type, and highlight any IP or vendor changes relative to
the current device data.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
rzuasti
2026-05-28 10:05:49 -04:00
co-authored by Claude Sonnet 4.6
parent e8df0a3980
commit 8e3eb96371
6 changed files with 387 additions and 0 deletions
+19
View File
@@ -6,6 +6,7 @@ import '../utils/friendly_date_formatter.dart';
import '../utils/oott_api.dart';
import '../widgets/status_badge.dart';
import 'device_actions.dart';
import 'device_event_history.dart';
class DeviceDetail extends StatefulWidget {
final String macAddress;
@@ -105,6 +106,10 @@ class _DeviceDetailState extends State<DeviceDetail> {
_DeviceHeader(device: device),
const SizedBox(height: 24),
_DeviceInfoCard(device: device),
const SizedBox(height: 24),
_SectionHeader(title: 'Event History'),
const SizedBox(height: 12),
DeviceEventHistory(device: device),
],
),
),
@@ -112,6 +117,20 @@ class _DeviceDetailState extends State<DeviceDetail> {
}
}
class _SectionHeader extends StatelessWidget {
final String title;
const _SectionHeader({required this.title});
@override
Widget build(BuildContext context) {
return Text(
title,
style: Theme.of(context).textTheme.titleMedium,
);
}
}
class _DeviceHeader extends StatelessWidget {
final Device device;