From f9b3522850bd6a0490c21da88552130f835b4856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Bures=CC=8C?= Date: Thu, 2 Nov 2023 13:15:40 +0100 Subject: [PATCH] ~ Adjustments --- Klic/App State.swift | 2 ++ Klic/Views/Create Key/Create Key Sheet.swift | 35 ++++++++++++++++---- README.md | 16 +++++++-- 3 files changed, 44 insertions(+), 9 deletions(-) diff --git a/Klic/App State.swift b/Klic/App State.swift index f48bd88..b418349 100644 --- a/Klic/App State.swift +++ b/Klic/App State.swift @@ -12,6 +12,8 @@ class AppState: ObservableObject { @Published var isShowingSSHKeyAdditionSheet: Bool = false + @Published var isCreatingKey: Bool = false + @Published var isLoadingKeys: Bool = true @Published var navigationSelection: UUID? diff --git a/Klic/Views/Create Key/Create Key Sheet.swift b/Klic/Views/Create Key/Create Key Sheet.swift index 44a3ae4..6f61d60 100644 --- a/Klic/Views/Create Key/Create Key Sheet.swift +++ b/Klic/Views/Create Key/Create Key Sheet.swift @@ -9,6 +9,9 @@ import SwiftUI struct CreateKeySheet: View { + @EnvironmentObject var appState: AppState + @EnvironmentObject var keyTracker: KeyTracker + @State private var passphrase: String = "" @State private var keyName: String = "" @@ -16,26 +19,44 @@ struct CreateKeySheet: View { VStack(alignment: .leading, spacing: 10) { Form { - TextField("Name:", text: $keyName) - TextField("Passphrase:", text: $passphrase) + LabeledContent { + TextField("", text: $keyName) + } label: { + Text("Name:") + } + + LabeledContent { + TextField("", text: $passphrase) + } label: { + VStack(alignment: .trailing, spacing: 3, content: { + Text("Passphrase:") + Text("Optional") + .font(.subheadline) + .foregroundColor(.gray) + }) + } } HStack { DismissSheetButton() + .disabled(appState.isCreatingKey) Spacer() + if appState.isCreatingKey + { + ProgressView() + .frame(width: 10, height: 10) + .scaleEffect(0.5) + } + CreateKeyButton(labelStyle: .textOnly, keyName: keyName, passphrase: passphrase) .keyboardShortcut(.defaultAction) - .disabled(keyName.isEmpty) + .disabled(keyName.isEmpty || keyTracker.keys.contains(where: { $0.name == keyName })) } } .padding() .frame(width: 250) } } - -#Preview { - CreateKeySheet() -} diff --git a/README.md b/README.md index b601f76..141038b 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,22 @@ +![Icon](https://i.imgur.com/Vo86TjT.png) + # Kei - The Simple SSH Key Manager -Key is a FOSS manager for your SSH keys. +Key is a simple, FOSS manager for your SSH keys. + +## Why Kei? +Kei is the simplest, most performant SSH key manager. It's not designed to be full of features, and instead does one thing only, and does it well: showing your SSH keys and allowing you to create and delete them quickly. ## Features - Seeing your existing SSH key - Quickly adding new SSH keys - Convenience features, such as: - Copying public and private keys with simple buttons - - Full keyboard control \ No newline at end of file + - Full keyboard control + +## Screenshots +### Key Detail +![SSH key detail](https://i.imgur.com/kTITKjh.jpg) + +### Key Addition Sheet +![SSH key addition sheet](https://i.imgur.com/R8LwwrV.jpg) \ No newline at end of file