diff --git a/src/components/connections/ConnectionEditDialog.vue b/src/components/connections/ConnectionEditDialog.vue
index 88a4046..22191a5 100644
--- a/src/components/connections/ConnectionEditDialog.vue
+++ b/src/components/connections/ConnectionEditDialog.vue
@@ -270,10 +270,27 @@
+
+
+ {{ keyFileName }}
+
+
@@ -385,6 +402,25 @@ const newCred = ref
({
passphrase: "",
});
+// SSH key file picker
+const keyFileInputRef = ref(null);
+const keyFileName = ref("");
+
+function browseKeyFile(): void {
+ keyFileInputRef.value?.click();
+}
+
+function loadKeyFile(event: Event): void {
+ const file = (event.target as HTMLInputElement).files?.[0];
+ if (!file) return;
+ keyFileName.value = file.name;
+ const reader = new FileReader();
+ reader.onload = () => {
+ newCred.value.privateKeyPEM = (reader.result as string).trim();
+ };
+ reader.readAsText(file);
+}
+
const form = ref({
name: "",
hostname: "",
@@ -431,6 +467,7 @@ function setProtocol(protocol: "ssh" | "rdp"): void {
function resetNewCredForm(): void {
newCred.value = { name: "", username: "", password: "", privateKeyPEM: "", passphrase: "" };
newCredError.value = "";
+ keyFileName.value = "";
}
async function deleteSelectedCredential(): Promise {