2026-06-05 21:57:58 -04:00
|
|
|
/// Status of an active scanner (one that runs on an interval, e.g. ARP, SNMP).
|
|
|
|
|
/// Mirrors the backend's `ActiveSnapshot` / `ActiveScannerStatusResponse`.
|
|
|
|
|
class ActiveScannerStatus {
|
2026-05-28 18:16:04 -04:00
|
|
|
final bool isRunning;
|
|
|
|
|
final double? runningForSeconds;
|
|
|
|
|
final double? nextRunInSeconds;
|
2026-06-02 08:45:45 -04:00
|
|
|
final int? lastScanDevicesSeen;
|
|
|
|
|
final double? lastScanSecondsAgo;
|
2026-05-28 18:16:04 -04:00
|
|
|
|
2026-06-05 21:57:58 -04:00
|
|
|
const ActiveScannerStatus({
|
2026-05-28 18:16:04 -04:00
|
|
|
required this.isRunning,
|
|
|
|
|
this.runningForSeconds,
|
|
|
|
|
this.nextRunInSeconds,
|
2026-06-02 08:45:45 -04:00
|
|
|
this.lastScanDevicesSeen,
|
|
|
|
|
this.lastScanSecondsAgo,
|
2026-05-28 18:16:04 -04:00
|
|
|
});
|
|
|
|
|
|
2026-06-05 21:57:58 -04:00
|
|
|
factory ActiveScannerStatus.fromJson(Map<String, dynamic> json) {
|
|
|
|
|
return ActiveScannerStatus(
|
2026-05-28 18:16:04 -04:00
|
|
|
isRunning: json['is_running'] as bool,
|
|
|
|
|
runningForSeconds: (json['running_for_seconds'] as num?)?.toDouble(),
|
|
|
|
|
nextRunInSeconds: (json['next_run_in_seconds'] as num?)?.toDouble(),
|
2026-06-02 08:45:45 -04:00
|
|
|
lastScanDevicesSeen: (json['last_scan_devices_seen'] as num?)?.toInt(),
|
|
|
|
|
lastScanSecondsAgo: (json['last_scan_seconds_ago'] as num?)?.toDouble(),
|
2026-05-28 18:16:04 -04:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|