From e30565d931711a979b761893c9605baf69220c96 Mon Sep 17 00:00:00 2001 From: qixinbo Date: Sun, 29 Mar 2026 17:54:59 +0800 Subject: [PATCH] fix: i18n update --- frontend/src/i18n/locales/zh.json | 1 + frontend/src/pages/Users.tsx | 36 ++++++++++++++++++++----------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/frontend/src/i18n/locales/zh.json b/frontend/src/i18n/locales/zh.json index d9e45a6..eb89a0e 100644 --- a/frontend/src/i18n/locales/zh.json +++ b/frontend/src/i18n/locales/zh.json @@ -145,6 +145,7 @@ "failedToSaveSettings": "保存设置失败", "accountInfo": "账号信息", "modifyLoginEmailAndPassword": "修改您的登录邮箱和密码", + "avatar": "头像", "username": "用户名", "usernameCannotBeModified": "用户名不可修改", "emailAddress": "邮箱地址", diff --git a/frontend/src/pages/Users.tsx b/frontend/src/pages/Users.tsx index 8cce4cf..374cc85 100644 --- a/frontend/src/pages/Users.tsx +++ b/frontend/src/pages/Users.tsx @@ -6,13 +6,14 @@ import { Label } from "@/components/ui/label"; import { Switch } from "@/components/ui/switch"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger, DialogFooter } from "@/components/ui/dialog"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; -import { Pencil, Trash2, Plus, Users as UsersIcon, Loader2 } from "lucide-react"; +import { Pencil, Trash2, Plus, User as UserIcon, Users as UsersIcon, Loader2 } from "lucide-react"; import { api } from "@/lib/api"; interface User { id: number; username: string; email: string; + avatar?: string | null; is_active: boolean; is_admin: boolean; created_at: string; @@ -117,12 +118,12 @@ export function Users() {
- 用户管理 + {t('userManagement')}
handleOpenDialog()}> - 添加用户 + {t('addUser')}
@@ -202,27 +203,38 @@ export function Users() { - {t('id')} - {t('username')} - {t('email')} - {t('status')} - {t('role')} - {t('createdAt')} - {t('actions')} + {t('id', 'ID')} + {t('username', 'Username')} + {t('email', 'Email')} + {t('status', 'Status')} + {t('role', 'Role')} + {t('createdAt', 'Created At')} + {t('actions', 'Actions')} {users.length === 0 ? ( - 暂无用户数据 + {t('noUserData', 'No User Data')} ) : ( users.map((user) => ( {user.id} - {user.username} + +
+ {user.avatar ? ( + avatar + ) : ( +
+ +
+ )} + {user.username} +
+
{user.email}