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,32 @@
import '../../../about/internal/application/NotificationType.dart';
import '../../../about/internal/application/ServerProfile.dart';
import '../../parent/ParentViewModel.dart';
import 'ConnectServerEditor.dart';
class ViewServerEditor extends ParentViewModel {
ConnectServerEditor connection;
ViewServerEditor(super.context, this.connection);
/// Opens an SSH session with the details as entered, so the user finds out
/// now — not at first deploy — whether they work.
void testConnection(ServerProfile server) async {
showLoading("Connecting to ${server.host} …");
try {
await getDataManager().connect(server);
closeLoading();
connection.onConnectionVerified(server);
showApplicationNotification(
NotificationType.success,
"Connection verified",
"Peach signed in to ${server.username}@${server.host}:${server.port} "
"successfully.",
true,
true,
null,
);
} catch (error) {
handleError(error, () => testConnection(server), () {}, "Retry");
}
}
}