Files
oott/frontend/lib/model/device.dart
T
rzuastiandClaude Opus 4.7 3a579f0321 Redesign devices list as a sortable, responsive headered list
GET /api/devices accepts sort_by/sort_order (whitelisted columns; default
last_seen DESC, stable secondary sort on mac_address), device registration
captures an optional hostname, and the Flutter list switches between a
wide headered layout and a compact ListTile under 600px. Per-row overflow
menu retains View details / Register / Forget actions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 11:09:55 -04:00

34 lines
940 B
Dart

import 'device_type.dart';
class Device {
final String macAddress;
final String ipv4Address;
final String vendor;
final DateTime lastSeen;
final bool isRegistered;
final String owner;
final DeviceType deviceType;
final String? name;
Device({
required this.macAddress,
required this.ipv4Address,
required this.vendor,
required this.lastSeen,
required this.isRegistered,
required this.owner,
required this.deviceType,
this.name,
});
Device.fromJson(Map<String, dynamic> json)
: macAddress = json['mac_address'] as String,
ipv4Address = json['ipv4_address'] as String,
vendor = json['vendor'] as String,
lastSeen = DateTime.parse(json['last_seen'] as String),
isRegistered = json['is_registered'] as bool,
owner = json['owner'] as String,
deviceType = DeviceType.fromString(json['device_type'] as String),
name = json['name'] as String?;
}