29 lines
706 B
Dart
29 lines
706 B
Dart
import '../parent/ParentViewModel.dart';
|
|
import 'ConnectHistory.dart';
|
|
|
|
class ViewHistory extends ParentViewModel {
|
|
ConnectHistory connection;
|
|
|
|
ViewHistory(super.context, this.connection);
|
|
|
|
void loadHistory() async {
|
|
try {
|
|
final history = await getDataManager().getDeployments();
|
|
connection.onHistoryLoaded(history);
|
|
} catch (error) {
|
|
handleError(error, loadHistory, () {}, "Retry");
|
|
}
|
|
}
|
|
|
|
void clearHistory() async {
|
|
showLoading("Clearing history …");
|
|
try {
|
|
await getDataManager().clearDeployments();
|
|
closeLoading();
|
|
connection.onHistoryCleared();
|
|
} catch (error) {
|
|
handleError(error, clearHistory, () {}, "Retry");
|
|
}
|
|
}
|
|
}
|