Add app source and tests

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
alvocool
2026-10-11 10:15:30 +03:00
parent 7e246255c2
commit 38881d1fe1
135 changed files with 21057 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
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");
}
}
}