@@ -13,6 +13,8 @@ interface Props {
1313}
1414
1515const TargetForm : FC < Props > = ( { target, onSubmit } ) => {
16+ const importLimit = 50 ;
17+ const createLimit = 10 ;
1618 const [ searchParams ] = useSearchParams ( ) ;
1719 const certFingerprint = searchParams . get ( "fingerprint" ) ;
1820 const [ showFingerprintModal , setShowFingerprintModal ] =
@@ -50,6 +52,8 @@ const TargetForm: FC<Props> = ({ target, onSubmit }) => {
5052 tlsClientCert : "" ,
5153 tlsClientKey : "" ,
5254 trustedServerCertificateFingerprint : "" ,
55+ importLimit : importLimit ,
56+ createLimit : createLimit ,
5357 } ;
5458
5559 if ( target ) {
@@ -62,6 +66,8 @@ const TargetForm: FC<Props> = ({ target, onSubmit }) => {
6266 tlsClientKey : target . properties . tls_client_key ,
6367 trustedServerCertificateFingerprint :
6468 target . properties . trusted_server_certificate_fingerprint ,
69+ importLimit : target . properties . import_limit || importLimit ,
70+ createLimit : target . properties . create_limit || createLimit ,
6571 } ;
6672 }
6773
@@ -78,6 +84,8 @@ const TargetForm: FC<Props> = ({ target, onSubmit }) => {
7884 tls_client_key : values . tlsClientKey ,
7985 trusted_server_certificate_fingerprint :
8086 values . trustedServerCertificateFingerprint ,
87+ import_limit : values . importLimit ,
88+ create_limit : values . createLimit ,
8189 } ,
8290 } ;
8391
@@ -233,6 +241,40 @@ const TargetForm: FC<Props> = ({ target, onSubmit }) => {
233241 { formik . errors . trustedServerCertificateFingerprint }
234242 </ Form . Control . Feedback >
235243 </ Form . Group >
244+ < Form . Group className = "mb-3" controlId = "importLimit" >
245+ < Form . Label > Import limit</ Form . Label >
246+ < Form . Control
247+ type = "number"
248+ name = "importLimit"
249+ value = { formik . values . importLimit }
250+ disabled = { formik . isSubmitting }
251+ onChange = { formik . handleChange }
252+ onBlur = { formik . handleBlur }
253+ isInvalid = {
254+ ! ! formik . errors . importLimit && formik . touched . importLimit
255+ }
256+ />
257+ < Form . Control . Feedback type = "invalid" >
258+ { formik . errors . importLimit }
259+ </ Form . Control . Feedback >
260+ </ Form . Group >
261+ < Form . Group className = "mb-3" controlId = "createLimit" >
262+ < Form . Label > Create limit</ Form . Label >
263+ < Form . Control
264+ type = "number"
265+ name = "createLimit"
266+ value = { formik . values . createLimit }
267+ disabled = { formik . isSubmitting }
268+ onChange = { formik . handleChange }
269+ onBlur = { formik . handleBlur }
270+ isInvalid = {
271+ ! ! formik . errors . createLimit && formik . touched . createLimit
272+ }
273+ />
274+ < Form . Control . Feedback type = "invalid" >
275+ { formik . errors . createLimit }
276+ </ Form . Control . Feedback >
277+ </ Form . Group >
236278 </ Form >
237279 </ div >
238280 < div className = "fixed-footer p-3" >
0 commit comments