Files
PeachDeployments/lib/Peach/see/docker/run/ViewDockerRun.dart
alvocool 38881d1fe1 Add app source and tests
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 10:15:30 +03:00

26 lines
936 B
Dart

import '../../../about/external/data/Docker.dart';
import '../../../about/internal/application/ServerProfile.dart';
import '../../../comms/Comms.dart' show LogLine;
import '../../parent/ParentViewModel.dart';
import 'ConnectDockerRun.dart';
class ViewDockerRun extends ParentViewModel {
ConnectDockerRun connection;
ViewDockerRun(super.context, this.connection);
/// The command's output as it runs, shown in the console.
Stream<LogLine> get logs => getDataManager().logs;
void runContainer(ServerProfile server, DockerRunSpec spec) async {
if (!await canReach(server, () => runContainer(server, spec))) return;
try {
final (started, output) = await getDataManager().dockerRun(server, spec);
connection.onRunFinished(started, output);
} catch (error) {
connection.onRunFinished(false, error.toString());
handleError(error, () => runContainer(server, spec), () {}, "Retry");
}
}
}