initial commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
import 'backup_method.dart';
|
||||
|
||||
part 'run_state.freezed.dart';
|
||||
part 'run_state.g.dart';
|
||||
|
||||
/// Mirrors `models.RunState` — the live (in-memory, non-persisted) progress
|
||||
/// of a single backup target's current or most recent run. Polled from
|
||||
/// `GET /.../backup/targets/:tid/progress` while a run is in flight.
|
||||
@freezed
|
||||
sealed class RunState with _$RunState {
|
||||
const factory RunState({
|
||||
@Default(false) bool running,
|
||||
@JsonKey(name: 'target_id') @Default('') String targetId,
|
||||
BackupMethod? method,
|
||||
@Default(0) double percent,
|
||||
String? eta,
|
||||
String? message,
|
||||
@JsonKey(name: 'started_at') DateTime? startedAt,
|
||||
}) = _RunState;
|
||||
|
||||
factory RunState.fromJson(Map<String, dynamic> json) => _$RunStateFromJson(json);
|
||||
}
|
||||
Reference in New Issue
Block a user