feat(mining-admin-web): 审计日志页面补全操作类型标签和资源名称中文映射
新增缺失的操作类型 label(含颜色区分): - LOGOUT 登出(灰色) - ENABLE 启用(翠绿) - DISABLE 禁用(橙色) - UNLOCK 解锁(黄色) - ACTIVATE 激活挖矿(蓝绿) - DEACTIVATE 停用挖矿(玫红) - INIT 初始化(浅灰) 新增 resourceLabels 映射,resource 列改为显示中文: AUTH→认证 / CONFIG→系统配置 / MINING→挖矿 / CAPABILITY→用户能力 / PRE_PLANTING_SELL_RESTRICTION→预种卖出限制 / MANUAL_MINING→手工补发 / BATCH_MINING→批量补发 过滤下拉框补全所有操作类型选项,与后端实际写入的 action 值对齐。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
991bc77db8
commit
9f73adc999
|
|
@ -27,11 +27,29 @@ interface AuditLog {
|
||||||
}
|
}
|
||||||
|
|
||||||
const actionLabels: Record<string, { label: string; className: string }> = {
|
const actionLabels: Record<string, { label: string; className: string }> = {
|
||||||
CREATE: { label: '创建', className: 'bg-green-100 text-green-700' },
|
CREATE: { label: '创建', className: 'bg-green-100 text-green-700' },
|
||||||
UPDATE: { label: '更新', className: 'bg-blue-100 text-blue-700' },
|
UPDATE: { label: '更新', className: 'bg-blue-100 text-blue-700' },
|
||||||
DELETE: { label: '删除', className: 'bg-red-100 text-red-700' },
|
DELETE: { label: '删除', className: 'bg-red-100 text-red-700' },
|
||||||
LOGIN: { label: '登录', className: 'bg-purple-100 text-purple-700' },
|
LOGIN: { label: '登录', className: 'bg-purple-100 text-purple-700' },
|
||||||
LOGOUT: { label: '登出', className: 'bg-gray-100 text-gray-600' },
|
LOGOUT: { label: '登出', className: 'bg-gray-100 text-gray-600' },
|
||||||
|
ENABLE: { label: '启用', className: 'bg-emerald-100 text-emerald-700' },
|
||||||
|
DISABLE: { label: '禁用', className: 'bg-orange-100 text-orange-700' },
|
||||||
|
UNLOCK: { label: '解锁', className: 'bg-yellow-100 text-yellow-700' },
|
||||||
|
ACTIVATE: { label: '激活挖矿', className: 'bg-teal-100 text-teal-700' },
|
||||||
|
DEACTIVATE: { label: '停用挖矿', className: 'bg-rose-100 text-rose-700' },
|
||||||
|
INIT: { label: '初始化', className: 'bg-slate-100 text-slate-600' },
|
||||||
|
};
|
||||||
|
|
||||||
|
const resourceLabels: Record<string, string> = {
|
||||||
|
AUTH: '认证',
|
||||||
|
CONFIG: '系统配置',
|
||||||
|
MINING: '挖矿',
|
||||||
|
CAPABILITY: '用户能力',
|
||||||
|
PRE_PLANTING_SELL_RESTRICTION: '预种卖出限制',
|
||||||
|
MANUAL_MINING: '手工补发',
|
||||||
|
BATCH_MINING: '批量补发',
|
||||||
|
USER: '用户管理',
|
||||||
|
SYSTEM_ACCOUNT: '系统账户',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function AuditLogsPage() {
|
export default function AuditLogsPage() {
|
||||||
|
|
@ -74,10 +92,16 @@ export default function AuditLogsPage() {
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="all">全部</SelectItem>
|
<SelectItem value="all">全部</SelectItem>
|
||||||
|
<SelectItem value="LOGIN">登录</SelectItem>
|
||||||
|
<SelectItem value="LOGOUT">登出</SelectItem>
|
||||||
<SelectItem value="CREATE">创建</SelectItem>
|
<SelectItem value="CREATE">创建</SelectItem>
|
||||||
<SelectItem value="UPDATE">更新</SelectItem>
|
<SelectItem value="UPDATE">更新</SelectItem>
|
||||||
<SelectItem value="DELETE">删除</SelectItem>
|
<SelectItem value="DELETE">删除</SelectItem>
|
||||||
<SelectItem value="LOGIN">登录</SelectItem>
|
<SelectItem value="ENABLE">启用</SelectItem>
|
||||||
|
<SelectItem value="DISABLE">禁用</SelectItem>
|
||||||
|
<SelectItem value="UNLOCK">解锁</SelectItem>
|
||||||
|
<SelectItem value="ACTIVATE">激活挖矿</SelectItem>
|
||||||
|
<SelectItem value="DEACTIVATE">停用挖矿</SelectItem>
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
<Button onClick={() => setPage(1)}>搜索</Button>
|
<Button onClick={() => setPage(1)}>搜索</Button>
|
||||||
|
|
@ -130,7 +154,7 @@ export default function AuditLogsPage() {
|
||||||
{actionInfo.label}
|
{actionInfo.label}
|
||||||
</span>
|
</span>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>{log.resource}</TableCell>
|
<TableCell>{resourceLabels[log.resource] || log.resource}</TableCell>
|
||||||
<TableCell className="font-mono text-xs">{log.resourceId || '-'}</TableCell>
|
<TableCell className="font-mono text-xs">{log.resourceId || '-'}</TableCell>
|
||||||
<TableCell className="max-w-[200px] truncate" title={log.details || ''}>
|
<TableCell className="max-w-[200px] truncate" title={log.details || ''}>
|
||||||
{log.details || '-'}
|
{log.details || '-'}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue