fix(i18n): 回退到稳定的 32% 覆盖率状态 (tsc + Vite 构建通过)
批量转换脚本引入的语法错误已回退,保留稳定的 i18n 转换: - 翻译词典: 22 namespaces, 3600+ keys - 已接入: 145+ 文件 (Dashboard/Login/K8s 主页面/Monitor/System/Deploy) - 语言切换器在 Header 中可用 (🇨🇳/🇺🇸) - tsc 零错误, Vite 构建成功
This commit is contained in:
1 parent
ecec73989b
commit
72bfb0e12d
191 files changed
+5057
-7592
No files matched your search
@@ -11,6 +11,7 @@ import {
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog';
|
||||
import { Key, Edit, User as UserIcon } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
interface UserDetailDialogProps {
|
||||
selectedUser: any | null;
|
||||
@@ -28,6 +29,7 @@ export function UserDetailDialog({
|
||||
openEdit,
|
||||
onResetPassword,
|
||||
}: UserDetailDialogProps) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Dialog open={!!selectedUser} onOpenChange={() => setSelectedUser(null)}>
|
||||
<DialogContent className="dg-card">
|
||||
@@ -44,27 +46,27 @@ export function UserDetailDialog({
|
||||
<div className="space-y-4">
|
||||
<div className="grid grid-cols-2 gap-4 p-4 rounded-lg bg-[var(--dg-bg-tertiary)]/50">
|
||||
<div>
|
||||
<p className="text-xs dg-text-muted mb-1">用户名</p>
|
||||
<p className="text-xs dg-text-muted mb-1">{t('system.userName')}</p>
|
||||
<p className="text-sm text-[var(--dg-text-primary)]">{selectedUser?.username}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-xs dg-text-muted mb-1">昵称</p>
|
||||
<p className="text-xs dg-text-muted mb-1">{t('system.userNickname')}</p>
|
||||
<p className="text-sm text-[var(--dg-text-primary)]">{selectedUser?.nickname}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-xs dg-text-muted mb-1">邮箱</p>
|
||||
<p className="text-xs dg-text-muted mb-1">{t('system.userEmail')}</p>
|
||||
<p className="text-sm text-[var(--dg-text-primary)]">{selectedUser?.email}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-xs dg-text-muted mb-1">手机号</p>
|
||||
<p className="text-xs dg-text-muted mb-1">{t('system.userPhone')}</p>
|
||||
<p className="text-sm text-[var(--dg-text-primary)]">{selectedUser?.phone || '--'}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-xs dg-text-muted mb-1">状态</p>
|
||||
<p className="text-xs dg-text-muted mb-1">{t('system.userStatus')}</p>
|
||||
<p className="text-sm text-[var(--dg-text-primary)]">{selectedUser && getUserStatusBadge(selectedUser.status)}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-xs dg-text-muted mb-1">创建时间</p>
|
||||
<p className="text-xs dg-text-muted mb-1">{t('system.userCreatedAt')}</p>
|
||||
<p className="text-sm text-[var(--dg-text-primary)]">
|
||||
{selectedUser && selectedUser.createdAt ? new Date(selectedUser.createdAt).toLocaleDateString() : '--'}
|
||||
</p>
|
||||
@@ -72,7 +74,7 @@ export function UserDetailDialog({
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-[var(--dg-text-secondary)] mb-2">角色</h4>
|
||||
<h4 className="text-sm font-medium text-[var(--dg-text-secondary)] mb-2">{t('system.userRole')}</h4>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{selectedUser?.roles.map((role: string) => (
|
||||
<Badge key={role} variant="outline" className="border-[var(--dg-border)] dg-text-secondary">
|
||||
@@ -91,7 +93,7 @@ export function UserDetailDialog({
|
||||
onClick={() => selectedUser && onResetPassword?.(selectedUser)}
|
||||
>
|
||||
<Key className="h-4 w-4 mr-2" />
|
||||
重置密码
|
||||
{t('system.resetPassword')}
|
||||
</Button>
|
||||
<Button
|
||||
className="bg-blue-600 hover:bg-blue-700 text-white"
|
||||
@@ -103,7 +105,7 @@ export function UserDetailDialog({
|
||||
}}
|
||||
>
|
||||
<Edit className="h-4 w-4 mr-2" />
|
||||
编辑
|
||||
{t('common.edit')}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
|
||||
Reference in new issue
Block a user