diff --git a/frontend/src/components/monitor/log-center/LogRBAC.tsx b/frontend/src/components/monitor/log-center/LogRBAC.tsx index 191a46e..99294a1 100644 --- a/frontend/src/components/monitor/log-center/LogRBAC.tsx +++ b/frontend/src/components/monitor/log-center/LogRBAC.tsx @@ -22,7 +22,7 @@ import i18n from '@/i18n'; const ROLE_LABEL: Record = { viewer: i18n.t('pipeline.viewer'), - analyst: i18n.t('分析者'), + analyst: i18n.t('monitor.logRbac.analyst'), }; const ENGINE_LABEL: Record = { @@ -108,7 +108,7 @@ export default function LogRBAC() { const handleCreate = async () => { if (!newName.trim() || !newCode.trim() || !newPattern.trim()) { - toast.error(i18n.t('请填写名称、标识与正则')); return; + toast.error(i18n.t('monitor.logRbac.fillRequired')); return; } setSaving(true); try { @@ -147,8 +147,8 @@ export default function LogRBAC() { const handleDelete = async (role: LogScopeRole) => { const ok = await _confirm({ - title: i18n.t('删除权限'), - description: `确定删除「${role.name}」?将影响 ${matchCount[role.id]?.length || 0} 个示例范围`, + title: i18n.t('monitor.logRbac.deletePermission'), + description: i18n.t('monitor.logRbac.deleteConfirm', { name: role.name, count: matchCount[role.id]?.length || 0 }), variant: 'destructive', }); if (!ok) return; @@ -165,7 +165,7 @@ export default function LogRBAC() { }; const handleAssign = async () => { - if (!selectedUserId || !assignRoleId) { toast.error(i18n.t('请选择用户和权限')); return; } + if (!selectedUserId || !assignRoleId) { toast.error(i18n.t('monitor.logRbac.selectUserAndPermission')); return; } setAssignLoading(true); try { await logRbacApi.assignRole(Number(selectedUserId), { @@ -189,8 +189,8 @@ export default function LogRBAC() { const selectedUser = users.find((u) => String(u.id) === selectedUserId); const pageTabs = [ - { id: 'roles', label: i18n.t('权限策略'), badge: roles.length || undefined }, - { id: 'users', label: i18n.t('用户授权') }, + { id: 'roles', label: i18n.t('monitor.logRbac.permissionPolicy'), badge: roles.length || undefined }, + { id: 'users', label: i18n.t('monitor.logRbac.userAssignment') }, { id: 'preview', label: i18n.t('pipeline.matchPreview') }, ]; @@ -206,7 +206,7 @@ export default function LogRBAC() { onTabChange={setActiveTab} actions={( )} contentClassName="space-y-4" @@ -215,8 +215,8 @@ export default function LogRBAC() { roles.length === 0 ? ( } - title={i18n.t('暂无日志权限策略')} - description={i18n.t('创建策略并分配给用户后,将按正则限制可查询的索引与 Label 范围')} + title={i18n.t('monitor.logRbac.noPolicies')} + description={i18n.t('monitor.logRbac.noPoliciesDesc')} action={} /> ) : ( @@ -243,7 +243,7 @@ export default function LogRBAC() { className="text-[10px] cursor-pointer border-[var(--dg-border)]" onClick={() => { setActiveTab('preview'); setPreviewRoleId(role.id); }} > - {matchCount[role.id]?.length || 0} 个范围 + {i18n.t('monitor.logRbac.scopeCount', { count: matchCount[role.id]?.length || 0 })}

@@ -259,7 +259,7 @@ export default function LogRBAC() { {i18n.t('pipeline.viewer')} - {i18n.t('分析者')} + {i18n.t('monitor.logRbac.analyst')} @@ -285,7 +285,7 @@ export default function LogRBAC() {

- 用户未分配任何策略时不拦截(向后兼容);分配后仅允许命中策略的查询。 + {i18n.t('monitor.logRbac.userPolicyHint')}

@@ -302,7 +302,7 @@ export default function LogRBAC() {
- +