mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-25 19:55:41 +02:00
Fixes for build (#124)
This commit is contained in:
parent
dba5a73e0e
commit
dc6fafba41
3 changed files with 7 additions and 5 deletions
|
@ -928,6 +928,8 @@ function isIPInSubnet(subnet: string, ip: string): boolean {
|
||||||
const [subnetIP, maskBits] = subnet.split("/");
|
const [subnetIP, maskBits] = subnet.split("/");
|
||||||
const mask = parseInt(maskBits);
|
const mask = parseInt(maskBits);
|
||||||
|
|
||||||
|
const t = useTranslations();
|
||||||
|
|
||||||
if (mask < 0 || mask > 32) {
|
if (mask < 0 || mask > 32) {
|
||||||
throw new Error(t('subnetMaskErrorInvalid'));
|
throw new Error(t('subnetMaskErrorInvalid'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ export default function ResourceRules(props: {
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
|
|
||||||
|
|
||||||
RuleAction = {
|
const RuleAction = {
|
||||||
ACCEPT: t('alwaysAllow'),
|
ACCEPT: t('alwaysAllow'),
|
||||||
DROP: t('alwaysDeny')
|
DROP: t('alwaysDeny')
|
||||||
} as const;
|
} as const;
|
||||||
|
|
|
@ -78,6 +78,8 @@ export default function CreateSiteForm({
|
||||||
privateKey: string;
|
privateKey: string;
|
||||||
} | null>(null);
|
} | null>(null);
|
||||||
|
|
||||||
|
const t = useTranslations();
|
||||||
|
|
||||||
const createSiteFormSchema = z.object({
|
const createSiteFormSchema = z.object({
|
||||||
name: z
|
name: z
|
||||||
.string()
|
.string()
|
||||||
|
@ -115,8 +117,6 @@ export default function CreateSiteForm({
|
||||||
const nameField = form.watch("name");
|
const nameField = form.watch("name");
|
||||||
const methodField = form.watch("method");
|
const methodField = form.watch("method");
|
||||||
|
|
||||||
const t = useTranslations();
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const nameIsValid = nameField?.length >= 2 && nameField?.length <= 30;
|
const nameIsValid = nameField?.length >= 2 && nameField?.length <= 30;
|
||||||
const isFormValid = methodField === "local" || isChecked;
|
const isFormValid = methodField === "local" || isChecked;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue