1+ import { IconAlertTriangle } from "@tabler/icons-react" ;
12import { Field , useFormikContext } from "formik" ;
23import { useState } from "react" ;
34import Select , { type ActionMeta } from "react-select" ;
45import type { DNSProvider } from "src/api/backend" ;
56import { useDnsProviders } from "src/hooks" ;
7+ import { T } from "src/locale" ;
68import styles from "./DNSProviderFields.module.css" ;
79
810interface DNSProviderOption {
911 readonly value : string ;
1012 readonly label : string ;
1113 readonly credentials : string ;
1214}
13- export function DNSProviderFields ( ) {
15+
16+ interface Props {
17+ showBoundaryBox ?: boolean ;
18+ }
19+ export function DNSProviderFields ( { showBoundaryBox = false } : Props ) {
1420 const { values, setFieldValue } = useFormikContext ( ) ;
1521 const { data : dnsProviders , isLoading } = useDnsProviders ( ) ;
1622 const [ dnsProviderId , setDnsProviderId ] = useState < string | null > ( null ) ;
@@ -31,17 +37,17 @@ export function DNSProviderFields() {
3137 } ) ) || [ ] ;
3238
3339 return (
34- < div className = { styles . dnsChallengeWarning } >
35- < p className = "text-info " >
36- This section requires some knowledge about Certbot and DNS plugins. Please consult the respective
37- plugins documentation.
40+ < div className = { showBoundaryBox ? styles . dnsChallengeWarning : undefined } >
41+ < p className = "text-warning " >
42+ < IconAlertTriangle size = { 16 } className = "me-1" />
43+ < T id = "certificates.dns.warning" />
3844 </ p >
3945
4046 < Field name = "meta.dnsProvider" >
4147 { ( { field } : any ) => (
4248 < div className = "row" >
4349 < label htmlFor = "dnsProvider" className = "form-label" >
44- DNS Provider
50+ < T id = "certificates.dns.provider" />
4551 </ label >
4652 < Select
4753 className = "react-select-container"
@@ -66,7 +72,7 @@ export function DNSProviderFields() {
6672 { ( { field } : any ) => (
6773 < div className = "mt-3" >
6874 < label htmlFor = "dnsProviderCredentials" className = "form-label" >
69- Credentials File Content
75+ < T id = "certificates.dns.credentials" />
7076 </ label >
7177 < textarea
7278 id = "dnsProviderCredentials"
@@ -78,13 +84,12 @@ export function DNSProviderFields() {
7884 />
7985 < div >
8086 < small className = "text-muted" >
81- This plugin requires a configuration file containing an API token or other
82- credentials to your provider
87+ < T id = "certificates.dns.credentials-note" />
8388 </ small >
8489 </ div >
8590 < div >
8691 < small className = "text-danger" >
87- This data will be stored as plaintext in the database and in a file!
92+ < T id = "certificates.dns.credentials-warning" />
8893 </ small >
8994 </ div >
9095 </ div >
@@ -94,20 +99,18 @@ export function DNSProviderFields() {
9499 { ( { field } : any ) => (
95100 < div className = "mt-3" >
96101 < label htmlFor = "propagationSeconds" className = "form-label" >
97- Propagation Seconds
102+ < T id = "certificates.dns.propagation-seconds" />
98103 </ label >
99104 < input
100105 id = "propagationSeconds"
101106 type = "number"
102- x
103107 className = "form-control"
104108 min = { 0 }
105109 max = { 600 }
106110 { ...field }
107111 />
108112 < small className = "text-muted" >
109- Leave empty to use the plugins default value. Number of seconds to wait for DNS
110- propagation.
113+ < T id = "certificates.dns.propagation-seconds-note" />
111114 </ small >
112115 </ div >
113116 ) }
0 commit comments