add none option for connection viwe

add key type picker
This commit is contained in:
neon443 committed 2025-07-01 20:43:51 +01:00
1 parent 97da44e4d5
commit 935c118d35
3 files changed
+14 -2

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@
import Foundation
enum KeyType: Codable, Equatable, Hashable, CustomStringConvertible {
enum KeyType: Codable, Equatable, Hashable, CustomStringConvertible, CaseIterable {
case ed25519
case rsa
+3 -1
View File
@@ -80,9 +80,11 @@ struct ConnectionView: View {
TextBox(label: "Password", text: $handler.host.password, prompt: "not required if using publickeys", secure: true)
Picker("Private key", selection: $handler.host.privateKeyID) {
Text("None")
.tag(nil as UUID?)
ForEach(keyManager.keypairs) { keypair in
Text(keypair.label)
.tag(keypair.id)
.tag(keypair.id as UUID?)
}
}
+10
View File
@@ -23,12 +23,22 @@ struct KeyImporterView: View {
var body: some View {
List {
TextBox(label: "Name", text: $keyName, prompt: "A name for your key")
Picker("Key type", selection: $keyType) {
ForEach(KeyType.allCases, id: \.self) { type in
Text(type.description)
.tag(type)
}
}
.pickerStyle(SegmentedPickerStyle())
HStack {
Text("Private Key")
Spacer()
Text("Required")
.foregroundStyle(.red)
}
TextEditor(text: $privkeyStr)
TextEditor(text: .constant(keypair.openSshPubkey))
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.