Skip to content

A modern and elegant dashboard for network traffic visualization and analysis.

fix: Optimized login dialog dark theme and auto-focus, and refined dashboard transition state detection.

luolei540804019c86
diff --git a/CHANGELOG.en.md b/CHANGELOG.en.md
index e4e50cf..31f9535 100644
--- a/CHANGELOG.en.md
+++ b/CHANGELOG.en.md
@@ -7,11 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [1.2.5] - 2026-02-13
+
### Added
+- Added transition progress bar to dashboard header for smoother data switching experience
+- Implemented skeleton loading states for dashboard data widgets
+- Introduced `ClientOnly` component for optimized client-side rendering
+- New API hooks for devices, traffic, rules, and proxies with unified data fetching logic
- Time range restrictions for showcase mode stats display
- Backend switching capability in showcase mode
- Enhanced rule chain flow visualization with zero-traffic chain merging
+### Changed
+- Optimized database batch upserts using sub-transactions for better performance
+- Enhanced GeoIP service reliability with failure cooldowns and queue limits
+- Implemented WebSocket summary caching to reduce redundant data transmission
+- Enhanced i18n support for settings and theme options
+- Improved API error handling mechanism
+
+### Fixed
+- Optimized login dialog dark theme styling
+- Fixed login dialog auto-focus issue
+- Refined transition state detection logic
+
## [1.2.0] - 2026-02-12
### Added
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 12b93e5..aba6055 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,11 +7,29 @@
## [未发布]
+## [1.2.5] - 2026-02-13
+
### 新增
+- 仪表板头部添加过渡进度条,提升数据切换体验
+- 为数据部件实现骨架屏加载状态
+- 新增 `ClientOnly` 组件,优化客户端渲染
+- 新的 API hooks(devices、traffic、rules、proxies),统一数据获取逻辑
- 展示模式下的时间范围限制
- 展示模式下支持后端切换
- 增强规则链流可视化,支持合并零流量链
+### 优化
+- 数据库批量 upserts 使用子事务优化性能
+- GeoIP 服务可靠性增强,添加失败冷却和队列限制
+- 实现 WebSocket 摘要缓存,减少重复数据传输
+- 增强设置和主题选项的国际化(i18n)支持
+- 改进 API 错误处理机制
+
+### 修复
+- 登录对话框暗黑主题样式优化
+- 修复登录对话框自动聚焦问题
+- 优化过渡状态判断逻辑
+
## [1.2.0] - 2026-02-12
### 新增
diff --git a/apps/web/app/[locale]/dashboard/components/content/index.tsx b/apps/web/app/[locale]/dashboard/components/content/index.tsx
index 7a9538c..0651513 100644
--- a/apps/web/app/[locale]/dashboard/components/content/index.tsx
+++ b/apps/web/app/[locale]/dashboard/components/content/index.tsx
@@ -404,10 +404,7 @@ export function Content({
};
return (
- <div className={cn(
- "transition-opacity duration-200",
- isTransitioning && "opacity-50 pointer-events-none"
- )}>
+ <div>
{renderContent()}
</div>
);
diff --git a/apps/web/app/[locale]/dashboard/hooks/use-dashboard.ts b/apps/web/app/[locale]/dashboard/hooks/use-dashboard.ts
index 036d37c..ad94113 100644
--- a/apps/web/app/[locale]/dashboard/hooks/use-dashboard.ts
+++ b/apps/web/app/[locale]/dashboard/hooks/use-dashboard.ts
@@ -369,7 +369,7 @@ export function useDashboard(): UseDashboardReturn {
wsConnected,
wsRealtimeActive,
isLoading: summaryQuery.isLoading || (backendsQuery.isLoading && !backends.length),
- isTransitioning: summaryQuery.isPlaceholderData === true,
+ isTransitioning: summaryQuery.isPlaceholderData === true || summaryQuery.isLoading,
// Actions
setActiveTab,
diff --git a/apps/web/components/features/auth/login-dialog.tsx b/apps/web/components/features/auth/login-dialog.tsx
index 89a9593..1760cb4 100644
--- a/apps/web/components/features/auth/login-dialog.tsx
+++ b/apps/web/components/features/auth/login-dialog.tsx
@@ -71,6 +71,7 @@ export function LoginDialog({ open, onOpenChange, onLogin }: LoginDialogProps) {
className="sm:max-w-md overflow-visible bg-transparent shadow-none border-none p-0"
showCloseButton={!isSuccess}
aria-describedby={undefined}
+ onOpenAutoFocus={(e) => e.preventDefault()}
>
<AnimatePresence mode="wait">
{isSuccess ? (
@@ -153,7 +154,7 @@ export function LoginDialog({ open, onOpenChange, onLogin }: LoginDialogProps) {
</div>
{/* Card Content - In front of the cat */}
- <div className="relative z-10 bg-background border shadow-lg rounded-lg p-6 pt-10">
+ <div className="relative z-10 bg-background border shadow-lg rounded-lg p-6 pt-10 dark:bg-[#1a1a2e] dark:border-white/15 dark:shadow-[0_0_60px_-4px_rgba(100,130,255,0.12)]">
<DialogTitle className="sr-only">
{t("loginTitle")}
</DialogTitle>
@@ -170,12 +171,11 @@ export function LoginDialog({ open, onOpenChange, onLogin }: LoginDialogProps) {
onFocus={() => setIsFocused(true)}
onBlur={() => setIsFocused(false)}
className={cn(
- "pl-10 pr-10",
+ "pl-10 pr-10 dark:border-white/20",
error && "border-destructive focus-visible:ring-destructive"
)}
disabled={isLoading}
autoComplete="off"
- autoFocus
/>
<button
type="button"
diff --git a/apps/web/components/ui/dialog.tsx b/apps/web/components/ui/dialog.tsx
index 5e422b8..1011f74 100644
--- a/apps/web/components/ui/dialog.tsx
+++ b/apps/web/components/ui/dialog.tsx
@@ -1,34 +1,34 @@
-"use client"
+"use client";
-import * as React from "react"
-import { XIcon } from "lucide-react"
-import { Dialog as DialogPrimitive } from "radix-ui"
+import * as React from "react";
+import { XIcon } from "lucide-react";
+import { Dialog as DialogPrimitive } from "radix-ui";
-import { cn } from "@/lib/utils"
-import { Button } from "@/components/ui/button"
+import { cn } from "@/lib/utils";
+import { Button } from "@/components/ui/button";
function Dialog({
...props
}: React.ComponentProps<typeof DialogPrimitive.Root>) {
- return <DialogPrimitive.Root data-slot="dialog" {...props} />
+ return <DialogPrimitive.Root data-slot="dialog" {...props} />;
}
function DialogTrigger({
...props
}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
- return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
+ return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
}
function DialogPortal({
...props
}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
- return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
+ return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
}
function DialogClose({
...props
}: React.ComponentProps<typeof DialogPrimitive.Close>) {
- return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
+ return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
}
function DialogOverlay({
@@ -39,12 +39,12 @@ function DialogOverlay({
<DialogPrimitive.Overlay
data-slot="dialog-overlay"
className={cn(
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 backdrop-blur-sm transition-all duration-300",
- className
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 backdrop-blur-sm transition-all duration-300",
+ className,
)}
{...props}
/>
- )
+ );
}
function DialogContent({
@@ -53,7 +53,7 @@ function DialogContent({
showCloseButton = true,
...props
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
- showCloseButton?: boolean
+ showCloseButton?: boolean;
}) {
return (
<DialogPortal data-slot="dialog-portal">
@@ -62,23 +62,21 @@ function DialogContent({
data-slot="dialog-content"
className={cn(
"bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",
- className
+ className,
)}
- {...props}
- >
+ {...props}>
{children}
{showCloseButton && (
<DialogPrimitive.Close
data-slot="dialog-close"
- className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
- >
+ className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
<XIcon />
<span className="sr-only">Close</span>
</DialogPrimitive.Close>
)}
</DialogPrimitive.Content>
</DialogPortal>
- )
+ );
}
function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
@@ -88,7 +86,7 @@ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
{...props}
/>
- )
+ );
}
function DialogFooter({
@@ -97,17 +95,16 @@ function DialogFooter({
children,
...props
}: React.ComponentProps<"div"> & {
- showCloseButton?: boolean
+ showCloseButton?: boolean;
}) {
return (
<div
data-slot="dialog-footer"
className={cn(
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
- className
+ className,
)}
- {...props}
- >
+ {...props}>
{children}
{showCloseButton && (
<DialogPrimitive.Close asChild>
@@ -115,7 +112,7 @@ function DialogFooter({
</DialogPrimitive.Close>
)}
</div>
- )
+ );
}
function DialogTitle({
@@ -128,7 +125,7 @@ function DialogTitle({
className={cn("text-lg leading-none font-semibold", className)}
{...props}
/>
- )
+ );
}
function DialogDescription({
@@ -141,7 +138,7 @@ function DialogDescription({
className={cn("text-muted-foreground text-sm", className)}
{...props}
/>
- )
+ );
}
export {
@@ -155,4 +152,4 @@ export {
DialogPortal,
DialogTitle,
DialogTrigger,
-}
+};