mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Redesign Home screen with device summary and scanner status
Adds a responsive Home screen combining the notification list with a device summary panel and ARP scanner status, visible side-by-side on wide screens and stacked on narrow ones. Backend: - New GET /api/devices/summary endpoint returning registered device counts and "seen in last 24h / 7 days" breakdowns by registration status - Migration 07 adds indexes on (is_registered) and (last_seen, is_registered) so summary queries use index range scans instead of full table scans Frontend: - HomeScreen replaces NotificationList, embedding notifications, device summary card, and ArpScannerCard in a LayoutBuilder-driven two-column (≥700 px) or single-column layout - ArpScannerCard extracted to a shared public widget reused by both HomeScreen and StatusScreen - Nav rail entry renamed to "Home" with home icon Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
dc8f47e66d
commit
251d8a479e
@@ -7,6 +7,7 @@ import 'package:frontend/utils/pref_utils.dart';
|
||||
import '../model/arp_scanner_status.dart';
|
||||
import '../model/device.dart';
|
||||
import '../model/device_event.dart';
|
||||
import '../model/device_summary.dart';
|
||||
import '../model/device_type.dart';
|
||||
import '../model/notification.dart';
|
||||
|
||||
@@ -157,6 +158,13 @@ class BackendAPI {
|
||||
.toList();
|
||||
}
|
||||
|
||||
Future<DeviceSummary> getDeviceSummary() async {
|
||||
debugPrint('About to call GET /devices/summary');
|
||||
final response = await _dio.get('/devices/summary');
|
||||
debugPrint('Received: ${response.data}');
|
||||
return DeviceSummary.fromJson(response.data as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
Future<ArpScannerStatus> getArpScannerStatus() async {
|
||||
debugPrint('About to call GET /arp_scanner/status');
|
||||
final response = await _dio.get('/arp_scanner/status');
|
||||
|
||||
Reference in New Issue
Block a user