fix(ui): 隱藏操作紀錄中的密碼並中文化帳號欄位

- 在 ActivityDetailDialog 中將 password 欄位顯示為 ******

- 將 username 欄位名稱從 Username 翻譯為 登入帳號
This commit is contained in:
2026-01-19 16:01:27 +08:00
parent b29278aa12
commit f6167fdaec

View File

@@ -45,6 +45,7 @@ interface Props {
const fieldLabels: Record<string, string> = { const fieldLabels: Record<string, string> = {
name: '名稱', name: '名稱',
code: '代碼', code: '代碼',
username: '登入帳號',
description: '描述', description: '描述',
price: '價格', price: '價格',
cost: '成本', cost: '成本',
@@ -146,8 +147,6 @@ export default function ActivityDetailDialog({ open, onOpenChange, activity }: P
return a.localeCompare(b); return a.localeCompare(b);
}); });
// Helper to check if a key is a snapshot name field
// Helper to check if a key is a snapshot name field // Helper to check if a key is a snapshot name field
const isSnapshotField = (key: string) => { const isSnapshotField = (key: string) => {
return [ return [
@@ -176,6 +175,9 @@ export default function ActivityDetailDialog({ open, onOpenChange, activity }: P
}; };
const formatValue = (key: string, value: any) => { const formatValue = (key: string, value: any) => {
// Mask password
if (key === 'password') return '******';
if (value === null || value === undefined) return '-'; if (value === null || value === undefined) return '-';
if (typeof value === 'boolean') return value ? '是' : '否'; if (typeof value === 'boolean') return value ? '是' : '否';
if (key === 'is_active') return value ? '啟用' : '停用'; if (key === 'is_active') return value ? '啟用' : '停用';