From 975948dcf6011252f22c6a012aa68d71b8bec84c Mon Sep 17 00:00:00 2001 From: sagitchu Date: Fri, 27 Feb 2026 19:53:19 +0800 Subject: [PATCH] fix(frontend): simplify speed limit selector UX --- vite-frontend/src/pages/user.tsx | 62 +++++++++++++++----------------- 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/vite-frontend/src/pages/user.tsx b/vite-frontend/src/pages/user.tsx index f28b1be..67e6a90 100644 --- a/vite-frontend/src/pages/user.tsx +++ b/vite-frontend/src/pages/user.tsx @@ -1170,7 +1170,7 @@ export default function UserPage() { classNames={{ trigger: "min-h-10 h-10", }} - placeholder="请选择限速规则" + placeholder="不限速" selectedKeys={ batchTunnelSelections.get(tunnel.id) !== null && @@ -1181,32 +1181,29 @@ export default function UserPage() { .get(tunnel.id)! .toString(), ] - : ["null"] + : [] } size="sm" onClick={(e) => e.stopPropagation()} onSelectionChange={(keys) => { - const value = Array.from(keys)[0] as string; + const selectedKey = Array.from(keys)[0] as + | string + | undefined; updateTunnelSpeedLimit( tunnel.id, - value === "null" ? null : Number(value), + selectedKey ? Number(selectedKey) : null, ); }} > - {[ - - 不限速 - , - ...tunnelSpeedLimits.map((sl) => ( - - {sl.name} - - )), - ]} + {tunnelSpeedLimits.map((sl) => ( + + {sl.name} + + ))} )} @@ -1429,38 +1426,35 @@ export default function UserPage() {