Skip to content

Commit bb288c5

Browse files
authored
Fix and update (#139)
* refactor(ui): 统一组件引用类型为ComponentRef 更新所有UI组件中的forwardRef类型,从ElementRef改为ComponentRef以保持一致性 迁移postcss配置至mjs格式并更新依赖版本 * refactor: 优化表单类型定义和验证逻辑 移除自定义的 asOptionalField 工具函数,直接使用 Zod 的 optional() 方法,并明确定义表单数据类型。 * style: 更新UI主题配置和样式变量 将主题风格从default切换为new-york,并重构CSS变量使用OKLCH色彩空间。同时添加tailwindcss-animate插件支持。 * style: 统一页面头部按钮组样式 优化多个页面头部按钮组的布局样式,增加响应式设计和flex-wrap支持 * fix(server): 修复对话框交互问题并优化SWR配置 修复对话框关闭逻辑并阻止外部交互,同时禁用SWR的自动重新验证功能以提升性能。 * feat: 添加日历组件及账单相关国际化 实现基于 react-day-picker 的日历组件,并添加账单管理相关的多语言支持 * style(components): 统一按钮样式并格式化代码 为删除和禁用按钮添加text-white类名,同时调整ServerCard组件中的代码缩进格式。 * perf(build): 优化Vite打包配置与代码分割策略 调整Vite构建配置,改进第三方依赖的分组逻辑并添加UUID支持到安装命令组件 * fix: 修正页面标题翻译不一致问题 将CronPage和ServicePage的标题从"Server"分别改为"Task"和"Service",并优化NotificationGroupPage的按钮组布局。 * fix(auth): 改进登录错误处理和国际化支持 优化登录错误提示,添加多语言支持并移除控制台错误日志。同时修复头部组件透明度样式问题。 * feat: 添加服务器操作下拉菜单 为服务器卡片添加统一的下拉菜单操作入口,整合终端、配置和安装命令功能。 * feat[alert-rule]: 优化告警规则组件性能 重构告警规则组件代码结构,提升渲染效率并减少内存占用。 * docs(i18n): 新增翻译字段 为界面添加"Add"、"Delete"、"AdvancedJSON"和"Save"等关键操作的翻译字段,支持中英文双语显示。 * perf(vite): 优化分包策略以提升构建性能 重构 manualChunks 逻辑,按功能类别分组依赖项,并增加大型库的独立分包规则。 * style: 统一危险操作按钮的文字颜色 在所有确认操作的弹窗按钮中添加白色文字样式,保持视觉一致性。 * fix(components): 调整下拉菜单对齐方式 根据菜单项状态动态设置下拉菜单的对齐方向和起始位置。 * fix(types): 修复在线用户API分页类型 添加ModelOnlineUserApi接口类型,包含分页信息,并移除index.ts中重复的类型定义。 * chore: auto-fix linting and formatting issues * feat(locales): 添加无过期相关翻译项 为英文和中文翻译文件添加"NoExpiry"、"SetNoExpiry"等无过期相关字段的翻译。 fix(components): 移除重复的图标按钮选项 从IconButton组件中删除重复的"more"图标选项。 * feat(ServerCard): 优化日期选择器并添加下拉提示 为日期选择器添加下拉布局和年份范围限制,并在公共笔记区域增加下拉项生效提示文本。 * chore: auto-fix linting and formatting issues * style: 优化多个组件的UI交互细节 统一按钮悬停样式并简化国际化文本调用,移除冗余的单位显示和空值判断逻辑。 * refactor(ServerCard): 移除网络路由相关代码 删除 ServerCard 组件中与 plan.networkRoute 相关的字段验证和错误显示逻辑。 * chore: auto-fix linting and formatting issues * feat(ui): 添加Switch组件并改进服务器表单交互 - 新增Radix UI Switch组件依赖及实现 - 将IPv4/IPv6输入改为开关控件,优化用户体验 - 添加"按量付费"选项和新的翻译字段 - 改进网络路由和备注输入的占位提示 - 修复暗黑模式下的按钮背景色 * style(components): 为禁止按钮添加白色文本样式 * chore: auto-fix linting and formatting issues * fix(ServerCard): 修复日期选择器样式和滚动问题 调整日期选择器的宽度和高度限制,添加滚动容器以解决内容溢出问题 * refactor(server-config): 简化复选框checked属性的布尔转换 使用!!操作符简化controllerField.value的布尔值转换,使代码更简洁 * feat(国际化): 添加告警规则和搜索框的国际化支持 为告警规则组件添加多语言支持,包括服务器监控选项、忽略提示和示例文本。同时将搜索框的占位文本替换为国际化字段。 * chore: auto-fix linting and formatting issues * fix(switch): 修正 Switch 组件 ref 类型定义错误 --------- Co-authored-by: Guccen <[email protected]>
1 parent 875750d commit bb288c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2214
-446
lines changed

bun.lockb

-203 KB
Binary file not shown.

components.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
"cssVariables": true,
1111
"prefix": ""
1212
},
13+
"iconLibrary": "lucide",
1314
"aliases": {
1415
"components": "@/components",
1516
"utils": "@/lib/utils",
1617
"ui": "@/components/ui",
1718
"lib": "@/lib",
1819
"hooks": "@/hooks"
19-
}
20+
},
21+
"registries": {}
2022
}

package.json

Lines changed: 54 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -13,68 +13,72 @@
1313
"preview": "vite preview"
1414
},
1515
"dependencies": {
16-
"@hookform/resolvers": "^3.10.0",
17-
"@radix-ui/react-alert-dialog": "^1.1.5",
18-
"@radix-ui/react-avatar": "^1.1.2",
19-
"@radix-ui/react-checkbox": "^1.1.3",
20-
"@radix-ui/react-dialog": "^1.1.5",
21-
"@radix-ui/react-dropdown-menu": "^2.1.5",
22-
"@radix-ui/react-label": "^2.1.1",
23-
"@radix-ui/react-navigation-menu": "^1.2.4",
24-
"@radix-ui/react-popover": "^1.1.5",
25-
"@radix-ui/react-scroll-area": "^1.2.2",
26-
"@radix-ui/react-select": "^2.1.5",
27-
"@radix-ui/react-separator": "^1.1.1",
28-
"@radix-ui/react-slot": "^1.1.1",
29-
"@radix-ui/react-tabs": "^1.1.2",
30-
"@tanstack/react-table": "^8.20.6",
16+
"@hookform/resolvers": "^5.2.2",
17+
"@radix-ui/react-alert-dialog": "^1.1.15",
18+
"@radix-ui/react-avatar": "^1.1.10",
19+
"@radix-ui/react-checkbox": "^1.3.3",
20+
"@radix-ui/react-dialog": "^1.1.15",
21+
"@radix-ui/react-dropdown-menu": "^2.1.16",
22+
"@radix-ui/react-label": "^2.1.7",
23+
"@radix-ui/react-navigation-menu": "^1.2.14",
24+
"@radix-ui/react-popover": "^1.1.15",
25+
"@radix-ui/react-scroll-area": "^1.2.10",
26+
"@radix-ui/react-select": "^2.2.6",
27+
"@radix-ui/react-separator": "^1.1.7",
28+
"@radix-ui/react-slot": "^1.2.3",
29+
"@radix-ui/react-switch": "^1.2.6",
30+
"@radix-ui/react-tabs": "^1.1.13",
31+
"@tailwindcss/postcss": "^4.1.13",
32+
"@tanstack/react-table": "^8.21.3",
3133
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
32-
"@types/luxon": "^3.4.2",
34+
"@types/luxon": "^3.7.1",
3335
"@xterm/addon-attach": "^0.11.0",
3436
"@xterm/addon-fit": "^0.10.0",
3537
"@xterm/xterm": "^5.5.0",
3638
"class-variance-authority": "^0.7.1",
3739
"clsx": "^2.1.1",
38-
"cmdk": "^1.0.4",
40+
"cmdk": "^1.1.1",
3941
"copy-to-clipboard": "^3.3.3",
40-
"framer-motion": "^11.18.2",
41-
"i18next": "^24.2.2",
42-
"i18next-browser-languagedetector": "^8.0.2",
42+
"date-fns": "^4.1.0",
43+
"framer-motion": "^12.23.22",
44+
"i18next": "^25.5.2",
45+
"i18next-browser-languagedetector": "^8.2.0",
4346
"jotai-zustand": "^0.6.0",
44-
"lucide-react": "^0.454.0",
45-
"luxon": "^3.5.0",
47+
"lucide-react": "^0.544.0",
48+
"luxon": "^3.7.2",
4649
"next-themes": "^0.4.6",
47-
"prettier-plugin-tailwindcss": "^0.6.11",
48-
"react": "^19.0.0",
49-
"react-dom": "^19.0.0",
50-
"react-hook-form": "^7.54.2",
51-
"react-i18next": "^15.4.0",
52-
"react-router-dom": "^7.1.5",
53-
"react-virtuoso": "^4.12.3",
54-
"sonner": "^1.7.4",
55-
"swr": "^2.3.0",
56-
"tailwind-merge": "^2.6.0",
50+
"prettier-plugin-tailwindcss": "^0.6.14",
51+
"react": "^19.1.1",
52+
"react-day-picker": "^9.11.0",
53+
"react-dom": "^19.1.1",
54+
"react-hook-form": "^7.63.0",
55+
"react-i18next": "^16.0.0",
56+
"react-router-dom": "^7.9.3",
57+
"react-virtuoso": "^4.14.1",
58+
"sonner": "^2.0.7",
59+
"swr": "^2.3.6",
60+
"tailwind-merge": "^3.3.1",
5761
"tailwindcss-animate": "^1.0.7",
5862
"vaul": "^1.1.2",
59-
"zod": "^3.24.1",
60-
"zustand": "^5.0.3"
63+
"zod": "^4.1.11",
64+
"zustand": "^5.0.8"
6165
},
6266
"devDependencies": {
63-
"@eslint/js": "^9.19.0",
64-
"@types/node": "^22.13.0",
65-
"@types/react": "^18.3.18",
66-
"@types/react-dom": "^18.3.5",
67-
"@vitejs/plugin-react": "^4.3.4",
68-
"autoprefixer": "^10.4.20",
69-
"eslint": "^9.19.0",
70-
"eslint-plugin-react-hooks": "^5.1.0",
71-
"eslint-plugin-react-refresh": "^0.4.18",
72-
"globals": "^15.14.0",
73-
"postcss": "^8.5.1",
74-
"swagger-typescript-api": "^13.0.23",
75-
"tailwindcss": "^3.4.17",
76-
"typescript": "~5.6.3",
77-
"typescript-eslint": "^8.22.0",
78-
"vite": "^6.0.11"
67+
"@eslint/js": "^9.36.0",
68+
"@types/node": "^24.5.2",
69+
"@types/react": "^19.1.15",
70+
"@types/react-dom": "^19.1.9",
71+
"@vitejs/plugin-react": "^5.0.4",
72+
"autoprefixer": "^10.4.21",
73+
"eslint": "^9.36.0",
74+
"eslint-plugin-react-hooks": "^5.2.0",
75+
"eslint-plugin-react-refresh": "^0.4.22",
76+
"globals": "^16.4.0",
77+
"postcss": "^8.5.6",
78+
"swagger-typescript-api": "^13.2.13",
79+
"tailwindcss": "^4.1.13",
80+
"typescript": "~5.9.2",
81+
"typescript-eslint": "^8.44.1",
82+
"vite": "^7.1.7"
7983
}
8084
}

postcss.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

postcss.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
plugins: {
3+
"@tailwindcss/postcss": {},
4+
},
5+
}

src/components/action-button-group.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function ActionButtonGroup<E, U>({
4949
{children}
5050
<AlertDialog>
5151
<AlertDialogTrigger asChild>
52-
<IconButton variant="destructive" icon="trash" />
52+
<IconButton variant="destructive" icon="trash" className="text-white" />
5353
</AlertDialogTrigger>
5454
<AlertDialogContent className="sm:max-w-lg">
5555
<AlertDialogHeader>
@@ -61,7 +61,10 @@ export function ActionButtonGroup<E, U>({
6161
<AlertDialogFooter>
6262
<AlertDialogCancel>{t("Close")}</AlertDialogCancel>
6363
<AlertDialogAction
64-
className={buttonVariants({ variant: "destructive" })}
64+
className={buttonVariants({
65+
variant: "destructive",
66+
className: "text-white",
67+
})}
6568
onClick={handleDelete}
6669
>
6770
{t("Confirm")}
@@ -95,7 +98,7 @@ export function BlockButtonGroup<E, U>({
9598
{children}
9699
<AlertDialog>
97100
<AlertDialogTrigger asChild>
98-
<IconButton variant="destructive" icon="ban" />
101+
<IconButton variant="destructive" icon="ban" className="text-white" />
99102
</AlertDialogTrigger>
100103
<AlertDialogContent className="sm:max-w-lg">
101104
<AlertDialogHeader>
@@ -107,7 +110,10 @@ export function BlockButtonGroup<E, U>({
107110
<AlertDialogFooter>
108111
<AlertDialogCancel>{t("Close")}</AlertDialogCancel>
109112
<AlertDialogAction
110-
className={buttonVariants({ variant: "destructive" })}
113+
className={buttonVariants({
114+
variant: "destructive",
115+
className: "text-white",
116+
})}
111117
onClick={handleBlock}
112118
>
113119
{t("Confirm")}

0 commit comments

Comments
 (0)