From 5b03ce87ff712de58e323621677a3a192522fbd2 Mon Sep 17 00:00:00 2001 From: Misaka Master <78672197+Alex-WU-Gen-9-png@users.noreply.github.com> Date: Wed, 18 Feb 2026 18:01:18 +0800 Subject: [PATCH] =?UTF-8?q?feat(tunnel):=20=E6=94=AF=E6=8C=81=200~1=20?= =?UTF-8?q?=E6=B5=AE=E7=82=B9=E5=80=8D=E7=8E=87=E8=BE=93=E5=85=A5=20(#137)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ZJU-Inno-WMX --- vite-frontend/src/pages/tunnel.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vite-frontend/src/pages/tunnel.tsx b/vite-frontend/src/pages/tunnel.tsx index 6e4e9f9..7ee23a0 100644 --- a/vite-frontend/src/pages/tunnel.tsx +++ b/vite-frontend/src/pages/tunnel.tsx @@ -256,8 +256,8 @@ export default function TunnelPage() { } } - if (form.trafficRatio < 0.0 || form.trafficRatio > 100.0) { - newErrors.trafficRatio = "流量倍率必须在0.0-100.0之间"; + if (form.trafficRatio <= 0 || form.trafficRatio > 100.0) { + newErrors.trafficRatio = "流量倍率须大于0,支持小数(如 0.5)"; } // 隧道转发时的验证 @@ -1280,8 +1280,11 @@ export default function TunnelPage() { errorMessage={errors.trafficRatio} isInvalid={!!errors.trafficRatio} label="流量倍率" - placeholder="请输入流量倍率" + placeholder="例如:0.5 或 1 或 2" type="number" + step="any" + min={0.01} + max={100} value={form.trafficRatio.toString()} variant="bordered" onChange={(e) =>