修复页面重叠的问题 & 网关状态转换

This commit is contained in:
Eamon
2026-04-21 17:05:19 +08:00
parent 69c8029b8b
commit 4b1d87bb14
4 changed files with 44 additions and 17 deletions

View File

@@ -31,9 +31,7 @@ import { toast } from "sonner"
import { createGateway } from "@/actions/gateway"
const schema = z.object({
mac: z.string().regex(/^([0-9A-Fa-f]{2}[:-]){5}[0-9A-Fa-f]{2}$/, {
message: "MAC地址格式不正确请使用如 00:11:22:AA:BB:CC 或 00-11-22-AA-BB-CC 的格式"
}),
mac: z.string(),
ip: z.string().regex(/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, {
message: "IP地址格式不正确请使用如 192.168.1.1 的格式"
}),
@@ -131,7 +129,7 @@ export default function CreatePage(props: { onSuccess?: () => void }) {
name="mac"
render={({ field, fieldState }) => (
<Field>
<FieldLabel htmlFor="gateway-create-mac">MAC地址:</FieldLabel>
<FieldLabel htmlFor="gateway-create-mac">:</FieldLabel>
<Input
id="gateway-create-mac"
placeholder="请输入MAC地址00:11:22:33:44:55"