mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-02 08:46:38 +00:00
update resolver
This commit is contained in:
@@ -138,12 +138,12 @@ export default function ResourceAuthenticationPage() {
|
||||
const [isSetPasswordOpen, setIsSetPasswordOpen] = useState(false);
|
||||
const [isSetPincodeOpen, setIsSetPincodeOpen] = useState(false);
|
||||
|
||||
const usersRolesForm = useForm<z.infer<typeof UsersRolesFormSchema>>({
|
||||
const usersRolesForm = useForm({
|
||||
resolver: zodResolver(UsersRolesFormSchema),
|
||||
defaultValues: { roles: [], users: [] }
|
||||
});
|
||||
|
||||
const whitelistForm = useForm<z.infer<typeof whitelistSchema>>({
|
||||
const whitelistForm = useForm({
|
||||
resolver: zodResolver(whitelistSchema),
|
||||
defaultValues: { emails: [] }
|
||||
});
|
||||
|
||||
@@ -119,7 +119,7 @@ export default function GeneralForm() {
|
||||
|
||||
type GeneralFormValues = z.infer<typeof GeneralFormSchema>;
|
||||
|
||||
const form = useForm<GeneralFormValues>({
|
||||
const form = useForm({
|
||||
resolver: zodResolver(GeneralFormSchema),
|
||||
defaultValues: {
|
||||
enabled: resource.enabled,
|
||||
|
||||
@@ -260,7 +260,7 @@ export default function ReverseProxyTargets(props: {
|
||||
port: "" as any as number,
|
||||
path: null,
|
||||
pathMatchType: null
|
||||
} as z.infer<typeof addTargetSchema>
|
||||
}
|
||||
});
|
||||
|
||||
const watchedIp = addTargetForm.watch("ip");
|
||||
@@ -274,7 +274,7 @@ export default function ReverseProxyTargets(props: {
|
||||
}
|
||||
};
|
||||
|
||||
const tlsSettingsForm = useForm<TlsSettingsValues>({
|
||||
const tlsSettingsForm = useForm({
|
||||
resolver: zodResolver(tlsSettingsSchema),
|
||||
defaultValues: {
|
||||
ssl: resource.ssl,
|
||||
@@ -282,7 +282,7 @@ export default function ReverseProxyTargets(props: {
|
||||
}
|
||||
});
|
||||
|
||||
const proxySettingsForm = useForm<ProxySettingsValues>({
|
||||
const proxySettingsForm = useForm({
|
||||
resolver: zodResolver(proxySettingsSchema),
|
||||
defaultValues: {
|
||||
setHostHeader: resource.setHostHeader || "",
|
||||
@@ -290,7 +290,7 @@ export default function ReverseProxyTargets(props: {
|
||||
}
|
||||
});
|
||||
|
||||
const targetsSettingsForm = useForm<TargetsSettingsValues>({
|
||||
const targetsSettingsForm = useForm({
|
||||
resolver: zodResolver(targetsSettingsSchema),
|
||||
defaultValues: {
|
||||
stickySession: resource.stickySession
|
||||
|
||||
@@ -114,7 +114,7 @@ export default function ResourceRules(props: {
|
||||
CIDR: t('ipAddressRange')
|
||||
} as const;
|
||||
|
||||
const addRuleForm = useForm<z.infer<typeof addRuleSchema>>({
|
||||
const addRuleForm = useForm({
|
||||
resolver: zodResolver(addRuleSchema),
|
||||
defaultValues: {
|
||||
action: "ACCEPT",
|
||||
|
||||
@@ -211,7 +211,7 @@ export default function Page() {
|
||||
])
|
||||
];
|
||||
|
||||
const baseForm = useForm<BaseResourceFormValues>({
|
||||
const baseForm = useForm({
|
||||
resolver: zodResolver(baseResourceFormSchema),
|
||||
defaultValues: {
|
||||
name: "",
|
||||
@@ -219,12 +219,12 @@ export default function Page() {
|
||||
}
|
||||
});
|
||||
|
||||
const httpForm = useForm<HttpResourceFormValues>({
|
||||
const httpForm = useForm({
|
||||
resolver: zodResolver(httpResourceFormSchema),
|
||||
defaultValues: {}
|
||||
});
|
||||
|
||||
const tcpUdpForm = useForm<TcpUdpResourceFormValues>({
|
||||
const tcpUdpForm = useForm({
|
||||
resolver: zodResolver(tcpUdpResourceFormSchema),
|
||||
defaultValues: {
|
||||
protocol: "tcp",
|
||||
@@ -241,7 +241,7 @@ export default function Page() {
|
||||
port: "" as any as number,
|
||||
path: null,
|
||||
pathMatchType: null
|
||||
} as z.infer<typeof addTargetSchema>
|
||||
}
|
||||
});
|
||||
|
||||
const watchedIp = addTargetForm.watch("ip");
|
||||
|
||||
Reference in New Issue
Block a user