Adjust ui

This commit is contained in:
Fang-Pen Lin
2025-12-03 14:23:17 -08:00
parent 02babcb3a5
commit c1d537c114

View File

@@ -1,6 +1,8 @@
import { Controller, useFormContext } from "react-hook-form";
import { faQuestionCircle } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { FormControl, Input, Switch, TextArea } from "@app/components/v2";
import { FormControl, Input, Switch, TextArea, Tooltip } from "@app/components/v2";
export const KubernetesResourceFields = () => {
const { control, watch } = useFormContext();
@@ -23,36 +25,6 @@ export const KubernetesResourceFields = () => {
</FormControl>
)}
/>
<Controller
name="connectionDetails.namespace"
control={control}
render={({ field, fieldState: { error } }) => (
<FormControl
errorText={error?.message}
isError={Boolean(error?.message)}
label="Namespace"
>
<Input placeholder="default" {...field} />
</FormControl>
)}
/>
<Controller
name="connectionDetails.skipTLSVerify"
control={control}
render={({ field: { value, onChange }, fieldState: { error } }) => (
<FormControl isError={Boolean(error?.message)} errorText={error?.message}>
<Switch
className="bg-mineshaft-400/50 shadow-inner data-[state=checked]:bg-green/80"
id="skip-tls-verify"
thumbClassName="bg-mineshaft-800"
isChecked={value}
onCheckedChange={onChange}
>
Skip TLS Verification
</Switch>
</FormControl>
)}
/>
<Controller
name="connectionDetails.caCertificate"
control={control}
@@ -73,6 +45,36 @@ export const KubernetesResourceFields = () => {
</FormControl>
)}
/>
<Controller
name="connectionDetails.sslRejectUnauthorized"
control={control}
render={({ field: { value, onChange }, fieldState: { error } }) => (
<FormControl isError={Boolean(error?.message)} errorText={error?.message}>
<Switch
className="bg-mineshaft-400/50 shadow-inner data-[state=checked]:bg-green/80"
id="ssl-reject-unauthorized"
thumbClassName="bg-mineshaft-800"
isChecked={value}
onCheckedChange={onChange}
>
<p className="w-38">
Reject Unauthorized
<Tooltip
className="max-w-md"
content={
<p>
If enabled, Infisical will only connect to the server if it has a valid,
trusted SSL certificate.
</p>
}
>
<FontAwesomeIcon icon={faQuestionCircle} size="sm" className="ml-1" />
</Tooltip>
</p>
</Switch>
</FormControl>
)}
/>
</div>
</div>
);