From 6b0e06c1dc30fa2842261be4c038988018cedf4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E5=B0=8F=E9=B8=AD?= Date: Thu, 27 Aug 2026 18:11:09 +0800 Subject: [PATCH] fix: render KMS backend label in closed select The KMS backend select on the SSE page showed the raw option value (e.g. "vault-transit") until the dropdown was first opened, because base-ui's Select.Value renders the value itself when given no children mapping. Supply the label via a backendTypeLabels map as SelectValue children, following the established pattern in performance-server-list.tsx, and reuse the same map for the SelectItem labels. --- app/(dashboard)/sse/page.tsx | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/app/(dashboard)/sse/page.tsx b/app/(dashboard)/sse/page.tsx index 89ec4288..b92c93d3 100644 --- a/app/(dashboard)/sse/page.tsx +++ b/app/(dashboard)/sse/page.tsx @@ -936,6 +936,14 @@ export default function SSEPage() { : t("Changing KMS service state may briefly interrupt SSE requests.") const isPendingDefaultKey = pendingKeyAction?.key.key_id === status?.config_summary?.default_key_id + const backendTypeLabels: Record = { + local: t("Local filesystem"), + "vault-kv2": t("HashiCorp Vault KV2"), + "vault-transit": t("HashiCorp Vault Transit Engine"), + static: t("Static single-key (built-in)"), + unsupported: t("Unsupported KMS backend"), + } + const mutationLocked = Boolean(activeMutation || statusError || loadingStatus) const unsupportedKmsReadOnly = formState.backendType === "unsupported" const staticKmsReadOnly = hasConfiguration && formState.backendType === "static" @@ -1160,18 +1168,20 @@ export default function SSEPage() { disabled={formDisabled || localKmsConfigured} > - + + {backendTypeLabels[formState.backendType]} + {formState.backendType === "unsupported" ? ( - {t("Unsupported KMS backend")} + {backendTypeLabels.unsupported} ) : null} - {t("Local filesystem")} - {t("HashiCorp Vault KV2")} - {t("HashiCorp Vault Transit Engine")} - {t("Static single-key (built-in)")} + {backendTypeLabels.local} + {backendTypeLabels["vault-kv2"]} + {backendTypeLabels["vault-transit"]} + {backendTypeLabels.static}