diff --git a/vite-frontend/src/components/animated-page.tsx b/vite-frontend/src/components/animated-page.tsx index 5a49781..583a730 100644 --- a/vite-frontend/src/components/animated-page.tsx +++ b/vite-frontend/src/components/animated-page.tsx @@ -6,21 +6,21 @@ import React from "react"; * Use this as the outermost wrapper inside each page component. */ export const AnimatedPage = ({ - children, - className, + children, + className, }: { - children: React.ReactNode; - className?: string; + children: React.ReactNode; + className?: string; }) => ( - - {children} - + + {children} + ); /** @@ -28,26 +28,26 @@ export const AnimatedPage = ({ * Children should use `staggerItem` as their `variants` prop. */ export const staggerContainer = { - hidden: { opacity: 0 }, - show: { - opacity: 1, - transition: { - staggerChildren: 0.05, - delayChildren: 0.05, - }, + hidden: { opacity: 0 }, + show: { + opacity: 1, + transition: { + staggerChildren: 0.05, + delayChildren: 0.05, }, + }, }; /** * Individual stagger item variant — fade-in + slide-up. */ export const staggerItem = { - hidden: { opacity: 0, y: 12 }, - show: { - opacity: 1, - y: 0, - transition: { duration: 0.25, ease: [0.25, 0.46, 0.45, 0.94] }, - }, + hidden: { opacity: 0, y: 12 }, + show: { + opacity: 1, + y: 0, + transition: { duration: 0.25, ease: [0.25, 0.46, 0.45, 0.94] }, + }, }; /** @@ -55,47 +55,47 @@ export const staggerItem = { * Renders a `motion.div` (or `motion.ul/motion.tbody`) with stagger behaviour. */ export const StaggerList = ({ - children, - className, - as = "div", + children, + className, + as = "div", }: { - children: React.ReactNode; - className?: string; - as?: "div" | "ul" | "tbody"; + children: React.ReactNode; + className?: string; + as?: "div" | "ul" | "tbody"; }) => { - const Component = motion[as] as React.ElementType; + const Component = motion[as] as React.ElementType; - return ( - - {children} - - ); + return ( + + {children} + + ); }; /** * Individual animated item for use inside StaggerList. */ export const StaggerItem = ({ - children, - className, - as = "div", + children, + className, + as = "div", }: { - children: React.ReactNode; - className?: string; - as?: "div" | "li" | "tr"; + children: React.ReactNode; + className?: string; + as?: "div" | "li" | "tr"; }) => { - const Component = motion[as] as React.ElementType; + const Component = motion[as] as React.ElementType; - return ( - - {children} - - ); + return ( + + {children} + + ); }; /** @@ -103,20 +103,20 @@ export const StaggerItem = ({ * Uses opacity + translateY to avoid font blurriness caused by scale transforms. */ export const FadeIn = ({ - children, - delay = 0, - className, + children, + delay = 0, + className, }: { - children: React.ReactNode; - delay?: number; - className?: string; + children: React.ReactNode; + delay?: number; + className?: string; }) => ( - - {children} - + + {children} + ); diff --git a/vite-frontend/src/components/search-bar.tsx b/vite-frontend/src/components/search-bar.tsx index 478d855..2a333c6 100644 --- a/vite-frontend/src/components/search-bar.tsx +++ b/vite-frontend/src/components/search-bar.tsx @@ -5,97 +5,97 @@ import { Input } from "@/shadcn-bridge/heroui/input"; import { SearchIcon } from "@/components/icons"; interface SearchBarProps { - isVisible: boolean; - value: string; - placeholder?: string; - onOpen: () => void; - onClose: () => void; - onChange: (value: string) => void; + isVisible: boolean; + value: string; + placeholder?: string; + onOpen: () => void; + onClose: () => void; + onChange: (value: string) => void; } export function SearchBar({ - isVisible, - value, - placeholder = "搜索", - onOpen, - onClose, - onChange, + isVisible, + value, + placeholder = "搜索", + onOpen, + onClose, + onChange, }: SearchBarProps) { - return ( - // Fixed h-8 so the container never changes height — eliminates the vertical jitter -
- - {!isVisible ? ( - - - - ) : ( - - onChange(e.target.value)} - /> - - - )} - -
- ); + return ( + // Fixed h-8 so the container never changes height — eliminates the vertical jitter +
+ + {!isVisible ? ( + + + + ) : ( + + onChange(e.target.value)} + /> + + + )} + +
+ ); } diff --git a/vite-frontend/src/components/ui/select.tsx b/vite-frontend/src/components/ui/select.tsx index 4654bd5..6c677cb 100644 --- a/vite-frontend/src/components/ui/select.tsx +++ b/vite-frontend/src/components/ui/select.tsx @@ -92,7 +92,7 @@ function SelectContent({ className={cn( "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-default-200 bg-white text-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=top]:slide-in-from-bottom-2 data-[side=bottom]:slide-in-from-top-2 dark:bg-default-50", position === "popper" && - "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", + "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className, )} data-slot="select-content" @@ -104,7 +104,7 @@ function SelectContent({ className={cn( "p-1", position === "popper" && - "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]", + "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]", )} > {children} diff --git a/vite-frontend/src/layouts/admin.tsx b/vite-frontend/src/layouts/admin.tsx index b28c143..846301e 100644 --- a/vite-frontend/src/layouts/admin.tsx +++ b/vite-frontend/src/layouts/admin.tsx @@ -340,10 +340,11 @@ export default function AdminLayout({ className={` w-full flex items-center gap-3 px-4 py-3 rounded-lg text-left relative min-h-[44px] - ${isActive - ? "text-primary-600 dark:text-primary-300" - : "text-gray-700 dark:text-gray-200" - } + ${ + isActive + ? "text-primary-600 dark:text-primary-300" + : "text-gray-700 dark:text-gray-200" + } `} transition={{ duration: 0.15 }} onClick={() => handleMenuClick(item.path)} @@ -352,7 +353,11 @@ export default function AdminLayout({ )} {!isActive && ( @@ -362,8 +367,12 @@ export default function AdminLayout({ whileHover={{ opacity: 1 }} /> )} -
{item.icon}
- {item.label} +
+ {item.icon} +
+ + {item.label} + ); diff --git a/vite-frontend/src/pages/config.tsx b/vite-frontend/src/pages/config.tsx index e9682f2..113f148 100644 --- a/vite-frontend/src/pages/config.tsx +++ b/vite-frontend/src/pages/config.tsx @@ -1,5 +1,7 @@ import { useState, useEffect, useRef } from "react"; import { useNavigate } from "react-router-dom"; +import toast from "react-hot-toast"; + import { Button } from "@/shadcn-bridge/heroui/button"; import { Card, CardBody, CardHeader } from "@/shadcn-bridge/heroui/card"; import { Input } from "@/shadcn-bridge/heroui/input"; @@ -16,8 +18,6 @@ import { ModalFooter, ModalHeader, } from "@/shadcn-bridge/heroui/modal"; -import toast from "react-hot-toast"; - import { updateConfigs, exportBackup, @@ -149,7 +149,7 @@ const getInitialConfigs = (): Record => { initialConfigs[key] = cachedValue; } }); - } catch { } + } catch {} return initialConfigs; }; @@ -528,10 +528,11 @@ export default function ConfigPage() { @@ -1391,10 +1459,11 @@ export default function ForwardPage() {
{viewMode === "direct" && (
{node.connectionStatus === "online" && - node.systemInfo + node.systemInfo ? formatSpeed( - node.systemInfo.downloadSpeed, - ) + node.systemInfo.downloadSpeed, + ) : "-"}
@@ -1400,10 +1402,10 @@ export default function NodePage() {
{node.connectionStatus === "online" && - node.systemInfo + node.systemInfo ? formatTraffic( - node.systemInfo.uploadTraffic, - ) + node.systemInfo.uploadTraffic, + ) : "-"}
@@ -1413,10 +1415,10 @@ export default function NodePage() {
{node.connectionStatus === "online" && - node.systemInfo + node.systemInfo ? formatTraffic( - node.systemInfo.downloadTraffic, - ) + node.systemInfo.downloadTraffic, + ) : "-"}
diff --git a/vite-frontend/src/pages/panel-sharing.tsx b/vite-frontend/src/pages/panel-sharing.tsx index b0dab1c..aeacbba 100644 --- a/vite-frontend/src/pages/panel-sharing.tsx +++ b/vite-frontend/src/pages/panel-sharing.tsx @@ -416,7 +416,8 @@ export default function PanelSharingPage() { Provider 共享

- 将本地节点分享给其他面板,统一管理 Token、端口范围和到期策略。 + 将本地节点分享给其他面板,统一管理 + Token、端口范围和到期策略。