first fixes

This commit is contained in:
Lokowitz
2025-05-17 18:17:22 +00:00
parent 731ec1da69
commit eff812eaa8
27 changed files with 80 additions and 114 deletions

View File

@@ -67,8 +67,6 @@ import {
import { SwitchInput } from "@app/components/SwitchInput";
import { useTranslations } from "next-intl";
const t = useTranslations();
const GeneralFormSchema = z
.object({
subdomain: z.string().optional(),
@@ -91,7 +89,7 @@ const GeneralFormSchema = z
return true;
},
{
message: t('proxyErrorInvalidPort'),
message: "Invalid port number",
path: ["proxyPort"]
}
)
@@ -103,7 +101,7 @@ const GeneralFormSchema = z
return true;
},
{
message: t('subdomainErrorInvalid'),
message: "Invalid subdomain",
path: ["subdomain"]
}
);
@@ -121,6 +119,7 @@ export default function GeneralForm() {
const { resource, updateResource } = useResourceContext();
const { org } = useOrgContext();
const router = useRouter();
const t = useTranslations();
const { env } = useEnvContext();
@@ -178,10 +177,7 @@ export default function GeneralForm() {
toast({
variant: "destructive",
title: t('domainErrorFetch'),
description: formatAxiosError(
e,
t('domainErrorFetchDescription')
)
description: formatAxiosError(e, t('domainErrorFetchDescription'))
});
});
@@ -220,10 +216,7 @@ export default function GeneralForm() {
toast({
variant: "destructive",
title: t('resourceErrorUpdate'),
description: formatAxiosError(
e,
t('resourceErrorUpdateDescription')
)
description: formatAxiosError(e, t('resourceErrorUpdateDescription'))
});
});
@@ -259,9 +252,7 @@ export default function GeneralForm() {
toast({
variant: "destructive",
title: t('resourceErrorTransfer'),
description: formatAxiosError(
e,
t('resourceErrorTransferDescription')
description: formatAxiosError(e, t('resourceErrorTransferDescription')
)
});
});

View File

@@ -93,8 +93,6 @@ type LocalTarget = Omit<
"protocol"
>;
const t = useTranslations();
const proxySettingsSchema = z.object({
setHostHeader: z
.string()
@@ -107,7 +105,7 @@ const proxySettingsSchema = z.object({
return true;
},
{
message: t('proxyErrorInvalidHeader')
message: "Invalid custom Host Header value. Use domain name format, or save empty to unset custom Host Header."
}
)
});
@@ -125,7 +123,7 @@ const tlsSettingsSchema = z.object({
return true;
},
{
message: t('proxyErrorTls')
message: "Invalid TLS Server Name. Use domain name format, or save empty to remove the TLS Server Name."
}
)
});
@@ -138,6 +136,7 @@ export default function ReverseProxyTargets(props: {
params: Promise<{ resourceId: number }>;
}) {
const params = use(props.params);
const t = useTranslations();
const { resource, updateResource } = useResourceContext();