fix: add key file requirement message for PEM/DER certificates in CertificateUploadDialog

This commit is contained in:
GitHub Actions
2026-04-14 16:35:37 +00:00
parent 0c0adf0e5a
commit 14b48f23b6
2 changed files with 9 additions and 1 deletions

View File

@@ -102,7 +102,8 @@ export default function CertificateUploadDialog({
}
const canValidate = !!certFile && !validateMutation.isPending
const canSubmit = !!certFile && !!name.trim()
const needsKeyFile = !!certFile && !isPfx && !keyFile
const canSubmit = !!certFile && !!name.trim() && !needsKeyFile
return (
<Dialog open={open} onOpenChange={handleClose}>
@@ -166,6 +167,12 @@ export default function CertificateUploadDialog({
</>
)}
{needsKeyFile && (
<p role="alert" className="text-xs text-red-500">
{t('certificates.keyFileRequired')}
</p>
)}
{certFile && !validationResult && (
<Button
type="button"

View File

@@ -215,6 +215,7 @@
"dropFileHere": "Drag and drop a file here, or click to browse",
"formatDetected": "Detected: {{format}}",
"pfxDetected": "PFX/PKCS#12 detected — key is embedded, no separate key file needed.",
"keyFileRequired": "A private key file is required for PEM/DER certificates.",
"pfxPassword": "PFX Password (if protected)",
"validate": "Validate",