From fe90feb1b781dc3dae883d77bacb7b1baca19870 Mon Sep 17 00:00:00 2001 From: Developer Date: Tue, 14 Jul 2026 17:20:27 +0000 Subject: [PATCH] fix: use saved SSH keys for task runners --- frontend/src/pages/ServicesPage.tsx | 37 +++- frontend/src/pages/Settings.tsx | 201 ++++++++++-------- .../__tests__/Settings.services.test.tsx | 27 ++- 3 files changed, 178 insertions(+), 87 deletions(-) diff --git a/frontend/src/pages/ServicesPage.tsx b/frontend/src/pages/ServicesPage.tsx index 029b16e..a79a204 100644 --- a/frontend/src/pages/ServicesPage.tsx +++ b/frontend/src/pages/ServicesPage.tsx @@ -34,6 +34,7 @@ import { useTestServiceInstance, } from "../hooks/useServices"; import { useServiceTypes } from "../hooks/useServices"; +import { useSSHKeys } from "../hooks/useSettings"; import { useDashboards, useDeleteDashboard, @@ -45,6 +46,7 @@ import type { ServiceInstanceInput, ServiceTestResult, ServiceTypeInfo, + SSHKey, } from "../types"; import { SectionCard } from "../components/SectionCard"; import { ConfirmDialog } from "../components/ConfirmDialog"; @@ -92,10 +94,12 @@ function ServiceConfigFields({ type, config, onChange, + sshKeys, }: { type: ServiceTypeInfo; config: Record; onChange: (config: Record) => void; + sshKeys: SSHKey[]; }) { const properties = ( @@ -109,6 +113,7 @@ function ServiceConfigFields({ // Multi-line resizable textarea for fields that hold complex values (opt-in // via `format: "textarea"`, or well-known multi-line keys). const TEXTAREA_KEYS = new Set(["notes", "command"]); + const noSSHKey = "__no_ssh_key__"; return (
{Object.entries(properties).map(([key, schema]) => { @@ -118,11 +123,37 @@ function ServiceConfigFields({ return ( - {isTextarea ? ( + {type.service_type === "ssh_tasks" && key === "ssh_key_id" ? ( + + ) : isTextarea ? (