mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-24 22:06:38 +00:00
update resolver
This commit is contained in:
@@ -63,7 +63,7 @@ export default function AccessControlsPage() {
|
||||
autoProvisioned: z.boolean()
|
||||
});
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
const form = useForm({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
username: user.username!,
|
||||
|
||||
@@ -161,7 +161,7 @@ export default function Page() {
|
||||
{ hours: 168, name: t("day", { count: 7 }) }
|
||||
];
|
||||
|
||||
const internalForm = useForm<z.infer<typeof internalFormSchema>>({
|
||||
const internalForm = useForm({
|
||||
resolver: zodResolver(internalFormSchema),
|
||||
defaultValues: {
|
||||
email: "",
|
||||
@@ -170,7 +170,7 @@ export default function Page() {
|
||||
}
|
||||
});
|
||||
|
||||
const googleAzureForm = useForm<z.infer<typeof googleAzureFormSchema>>({
|
||||
const googleAzureForm = useForm({
|
||||
resolver: zodResolver(googleAzureFormSchema),
|
||||
defaultValues: {
|
||||
email: "",
|
||||
@@ -179,7 +179,7 @@ export default function Page() {
|
||||
}
|
||||
});
|
||||
|
||||
const genericOidcForm = useForm<z.infer<typeof genericOidcFormSchema>>({
|
||||
const genericOidcForm = useForm({
|
||||
resolver: zodResolver(genericOidcFormSchema),
|
||||
defaultValues: {
|
||||
username: "",
|
||||
|
||||
@@ -91,14 +91,14 @@ export default function Page() {
|
||||
|
||||
type CopiedFormValues = z.infer<typeof copiedFormSchema>;
|
||||
|
||||
const form = useForm<CreateFormValues>({
|
||||
const form = useForm({
|
||||
resolver: zodResolver(createFormSchema),
|
||||
defaultValues: {
|
||||
name: ""
|
||||
}
|
||||
});
|
||||
|
||||
const copiedForm = useForm<CopiedFormValues>({
|
||||
const copiedForm = useForm({
|
||||
resolver: zodResolver(copiedFormSchema),
|
||||
defaultValues: {
|
||||
copied: true
|
||||
|
||||
@@ -58,7 +58,7 @@ export default function GeneralPage() {
|
||||
const [clientSites, setClientSites] = useState<Tag[]>([]);
|
||||
const [activeSitesTagIndex, setActiveSitesTagIndex] = useState<number | null>(null);
|
||||
|
||||
const form = useForm<GeneralFormValues>({
|
||||
const form = useForm({
|
||||
resolver: zodResolver(GeneralFormSchema),
|
||||
defaultValues: {
|
||||
name: client?.name,
|
||||
|
||||
@@ -265,7 +265,7 @@ export default function Page() {
|
||||
}
|
||||
};
|
||||
|
||||
const form = useForm<CreateClientFormValues>({
|
||||
const form = useForm({
|
||||
resolver: zodResolver(createClientFormSchema),
|
||||
defaultValues: {
|
||||
name: "",
|
||||
|
||||
@@ -59,7 +59,7 @@ export default function GeneralPage() {
|
||||
const [loadingDelete, setLoadingDelete] = useState(false);
|
||||
const [loadingSave, setLoadingSave] = useState(false);
|
||||
|
||||
const form = useForm<GeneralFormValues>({
|
||||
const form = useForm({
|
||||
resolver: zodResolver(GeneralFormSchema),
|
||||
defaultValues: {
|
||||
name: org?.org.name,
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -64,7 +64,7 @@ export default function GeneralPage() {
|
||||
const router = useRouter();
|
||||
const t = useTranslations();
|
||||
|
||||
const form = useForm<GeneralFormValues>({
|
||||
const form = useForm({
|
||||
resolver: zodResolver(GeneralFormSchema),
|
||||
defaultValues: {
|
||||
name: site?.name,
|
||||
|
||||
@@ -425,7 +425,7 @@ WantedBy=default.target`
|
||||
}
|
||||
};
|
||||
|
||||
const form = useForm<CreateSiteFormValues>({
|
||||
const form = useForm({
|
||||
resolver: zodResolver(createSiteFormSchema),
|
||||
defaultValues: {
|
||||
name: "",
|
||||
|
||||
Reference in New Issue
Block a user