Editor: Passwort unter Benutzername, Live-Validierung, Fehlerbericht kopieren, Doku

This commit is contained in:
x3
2026-09-21 23:29:39 +02:00
parent 4fd711474c
commit ebb838b6b1
5 changed files with 98 additions and 16 deletions
@@ -43,6 +43,9 @@ struct EmbeddedTerminalView: View {
.lineLimit(3)
}
Spacer()
Button("Bericht kopieren") { copyReport() }
.buttonStyle(.link).font(.caption)
.help("Kopiert Profil (ohne Passwort), Status und letzte Ausgabe — hierher schicken zur Fehlersuche")
Button("Diagnose") { diagnose() }.buttonStyle(.link).font(.caption)
Button("Erneut") { connect() }.buttonStyle(.link).font(.caption)
}
@@ -129,6 +132,20 @@ struct EmbeddedTerminalView: View {
input = ""
}
/// Fehlerbericht ohne Secrets (Passwort steht weder im Profil noch im Befehl).
/// Hinweis: Wer das Passwort sichtbar eingetippt hat (nicht Auge-Modus),
/// löscht die Ausgabe vorher per „Leeren".
func copyReport() {
var r = "RemminaMac Fehlerbericht\n"
r += "Profil: \(profile.name) | \(profile.proto.rawValue) | \(profile.username)@\(profile.host):\(profile.port)\n"
r += "Auto-Login: \(term.autoLogin ? "ja" : "nein") | sshpass: \(SSHService.findSshpass() ?? "fehlt")\n"
r += "Status: \(statusText)\n"
let tail = term.lines.suffix(20).map { $0.map(\.text).joined() }.joined(separator: "\n")
r += "--- letzte Ausgabe ---\n\(tail)\n"
NSPasteboard.general.clearContents()
NSPasteboard.general.setString(r, forType: .string)
}
var failed: Bool {
if case .done(let code, _) = term.state {
return (code ?? 1) != 0