fix: 多语言翻译问题
This commit is contained in:
1 parent
c380248502
commit
57ee1e522c
5 files changed
+515
-80
No files matched your search
+11
-11
@@ -20,17 +20,17 @@ export const config = {
|
||||
},
|
||||
admin: {
|
||||
modules: {
|
||||
dashboard: true,
|
||||
approvals: true,
|
||||
users: true,
|
||||
departments: true,
|
||||
agents: true,
|
||||
announcements: true,
|
||||
questions: true,
|
||||
wecom: true,
|
||||
permissions: true,
|
||||
requests: true,
|
||||
reports: true
|
||||
dashboard: true, // 仪表盘
|
||||
approvals: true, // 用户审批
|
||||
users: true, // 用户管理
|
||||
departments: true, // 部门管理
|
||||
agents: true, // 应用管理
|
||||
announcements: true, // 公告管理
|
||||
questions: true, // 常用问题
|
||||
wecom: true, // 企业微信
|
||||
permissions: true, // 应用权限
|
||||
requests: true, // 审批权限
|
||||
reports: true, // 数据报表
|
||||
}
|
||||
}
|
||||
};
|
||||
+437
-17
@@ -269,9 +269,13 @@ const messages = {
|
||||
},
|
||||
fields: {
|
||||
name: 'Name',
|
||||
namePlaceholder: 'e.g. IT Department',
|
||||
code: 'Code',
|
||||
codePlaceholder: 'e.g. DEPT-001',
|
||||
company: 'Company',
|
||||
description: 'Description'
|
||||
companyPlaceholder: 'e.g. HQ',
|
||||
description: 'Description',
|
||||
descriptionPlaceholder: 'Department description...'
|
||||
},
|
||||
confirmDelete: 'Delete this department?',
|
||||
msg: {
|
||||
@@ -296,6 +300,7 @@ const messages = {
|
||||
},
|
||||
fields: {
|
||||
name: 'Name',
|
||||
namePlaceholder: 'e.g. HR Assistant',
|
||||
type: 'Integration Type',
|
||||
types: {
|
||||
api: 'API Integration (Dify)',
|
||||
@@ -304,6 +309,7 @@ const messages = {
|
||||
appId: 'Dify App ID',
|
||||
apiKey: 'API Key',
|
||||
baseUrl: 'API Base URL (Optional)',
|
||||
baseUrlPlaceholder: 'Default: Dify Config',
|
||||
iframeUrl: 'Iframe URL',
|
||||
description: 'Description',
|
||||
descPlaceholder: 'Briefly describe what this agent does...'
|
||||
@@ -327,6 +333,7 @@ const messages = {
|
||||
},
|
||||
fields: {
|
||||
title: 'Title',
|
||||
titlePlaceholder: 'e.g. Write Report',
|
||||
targetAgent: 'Target Agent',
|
||||
sortOrder: 'Sort Order',
|
||||
content: 'Question Content',
|
||||
@@ -465,12 +472,102 @@ const messages = {
|
||||
title: 'Data Reports: {table}',
|
||||
subtitle: 'Raw data view and statistics',
|
||||
export: 'Export Excel',
|
||||
columnSettings: 'Column Settings',
|
||||
showSelection: 'Show Selection',
|
||||
hideSelection: 'Hide Selection',
|
||||
deleting: 'Deleting...',
|
||||
deleteSelected: 'Delete Selected ({count})',
|
||||
tableSettings: 'Table Settings',
|
||||
resetLayout: 'Reset Layout',
|
||||
wrapText: 'Wrap Text',
|
||||
wrapMaxHeightPx: 'Max Wrap Height (px)',
|
||||
advancedSortRules: 'Advanced Sort Rules (priority order)',
|
||||
addRule: 'Add Rule',
|
||||
noAdvancedSort: 'No advanced sort rules. Header click sorting will be used.',
|
||||
sortAsc: 'Ascending',
|
||||
sortDesc: 'Descending',
|
||||
moveUp: 'Move Up',
|
||||
moveDown: 'Move Down',
|
||||
remove: 'Remove',
|
||||
filterPlaceholder: 'Filter...',
|
||||
totalRows: 'Total: {total}',
|
||||
showingRange: 'Showing: {start}-{end} / {total}',
|
||||
paginationSummary: 'Total {total} rows, page {page} / {pages}',
|
||||
perPage: 'Per page',
|
||||
itemsUnit: 'rows',
|
||||
prevPage: 'Prev',
|
||||
nextPage: 'Next',
|
||||
enterFullscreen: 'Enter Fullscreen',
|
||||
exitFullscreen: 'Exit Fullscreen',
|
||||
noData: 'No data available for {table}',
|
||||
usage: 'Usage Analytics',
|
||||
byUser: 'Requests by User',
|
||||
byAgent: 'Requests by Agent'
|
||||
byAgent: 'Requests by Agent',
|
||||
columns: {
|
||||
id: 'ID',
|
||||
user_id: 'User ID',
|
||||
username: 'Username',
|
||||
real_name: 'Real Name',
|
||||
email: 'Email',
|
||||
phone_number: 'Phone',
|
||||
department: 'Department',
|
||||
employee_id: 'Employee ID',
|
||||
role: 'Role',
|
||||
status: 'Status',
|
||||
language: 'Language',
|
||||
default_agent_id: 'Default Agent ID',
|
||||
default_agent: 'Default Agent',
|
||||
created_at: 'Created At',
|
||||
updated_at: 'Updated At',
|
||||
last_login: 'Last Login',
|
||||
last_login_at: 'Last Login At',
|
||||
app_id: 'App ID',
|
||||
dify_app_id: 'Dify App ID',
|
||||
dify_api_key: 'Dify API Key',
|
||||
api_base_url: 'API Base URL',
|
||||
agent_id: 'Agent ID',
|
||||
agent_name: 'Agent Name',
|
||||
conversation_id: 'Conversation ID',
|
||||
session_id: 'Session ID',
|
||||
message_id: 'Message ID',
|
||||
question: 'Question',
|
||||
answer: 'Answer',
|
||||
response: 'Response',
|
||||
content: 'Content',
|
||||
description: 'Description',
|
||||
extra_config: 'Extra Config',
|
||||
icon_url: 'Icon URL',
|
||||
feedback: 'Feedback',
|
||||
rating: 'Rating',
|
||||
comment: 'Comment',
|
||||
model: 'Model',
|
||||
tokens: 'Tokens',
|
||||
tokens_prompt: 'Prompt Tokens',
|
||||
tokens_completion: 'Completion Tokens',
|
||||
total_tokens: 'Total Tokens',
|
||||
latency_ms: 'Latency (ms)',
|
||||
cost: 'Cost',
|
||||
ip: 'IP',
|
||||
user_agent: 'User Agent',
|
||||
source: 'Source',
|
||||
type: 'Type',
|
||||
title: 'Title',
|
||||
name: 'Name',
|
||||
code: 'Code',
|
||||
company: 'Company',
|
||||
theme_preference: 'Theme Preference',
|
||||
password_hash: 'Password Hash',
|
||||
reset_token: 'Reset Token',
|
||||
reset_token_expiry: 'Reset Token Expiry'
|
||||
},
|
||||
tables: {
|
||||
users: 'Users',
|
||||
chat_logs: 'Chat Logs',
|
||||
feedbacks: 'Feedbacks',
|
||||
departments: 'Departments',
|
||||
agents: 'Agents',
|
||||
permission_requests: 'Permission Requests'
|
||||
}
|
||||
},
|
||||
|
||||
// Batch Edit
|
||||
@@ -489,7 +586,8 @@ const messages = {
|
||||
// Common Messages
|
||||
role: {
|
||||
user: 'User',
|
||||
admin: 'Admin'
|
||||
admin: 'Admin',
|
||||
guest: 'Guest'
|
||||
},
|
||||
status: {
|
||||
active: 'Active',
|
||||
@@ -512,6 +610,7 @@ const messages = {
|
||||
},
|
||||
chat: {
|
||||
defaultTitle: 'Chat',
|
||||
assistantLabel: 'HXOPS AI Assistant',
|
||||
placeholder: 'Ask anything...',
|
||||
history: 'Chat History',
|
||||
noHistory: 'No history',
|
||||
@@ -538,9 +637,15 @@ const messages = {
|
||||
sent: 'Sent'
|
||||
}
|
||||
},
|
||||
profile: {
|
||||
title: 'Profile',
|
||||
personalInfo: 'Personal Information',
|
||||
profile: {
|
||||
title: 'Profile',
|
||||
personalInfo: 'Personal Information',
|
||||
department: 'Department',
|
||||
language: 'Language',
|
||||
roleAdmin: 'Administrator',
|
||||
roleUser: 'User',
|
||||
unsavedChanges: 'You have unsaved changes',
|
||||
editHint: 'Switch to edit mode to update profile details',
|
||||
security: 'Security',
|
||||
preferences: 'Preferences',
|
||||
edit: 'Edit',
|
||||
@@ -817,9 +922,13 @@ const messages = {
|
||||
},
|
||||
fields: {
|
||||
name: '名称',
|
||||
namePlaceholder: '例如:信息技术部',
|
||||
code: '编码',
|
||||
codePlaceholder: '例如:DEPT-001',
|
||||
company: '公司',
|
||||
description: '描述'
|
||||
companyPlaceholder: '例如:总部',
|
||||
description: '描述',
|
||||
descriptionPlaceholder: '请输入部门描述...'
|
||||
},
|
||||
confirmDelete: '确定删除该部门吗?',
|
||||
msg: {
|
||||
@@ -844,6 +953,7 @@ const messages = {
|
||||
},
|
||||
fields: {
|
||||
name: '名称',
|
||||
namePlaceholder: '例如:人事助手',
|
||||
type: '集成类型',
|
||||
types: {
|
||||
api: 'API 集成 (Dify)',
|
||||
@@ -851,7 +961,8 @@ const messages = {
|
||||
},
|
||||
appId: 'Dify App ID',
|
||||
apiKey: 'API Key',
|
||||
baseUrl: 'API Base URL (选填)',
|
||||
baseUrl: 'API 基础 URL(选填)',
|
||||
baseUrlPlaceholder: '默认:使用 Dify 配置',
|
||||
iframeUrl: 'Iframe URL',
|
||||
description: '描述',
|
||||
descPlaceholder: '简要描述该应用的功能...'
|
||||
@@ -875,6 +986,7 @@ const messages = {
|
||||
},
|
||||
fields: {
|
||||
title: '标题',
|
||||
titlePlaceholder: '例如:写日报',
|
||||
targetAgent: '目标应用',
|
||||
sortOrder: '排序',
|
||||
content: '问题内容',
|
||||
@@ -1013,12 +1125,102 @@ const messages = {
|
||||
title: '数据报表: {table}',
|
||||
subtitle: '原始数据与统计视图',
|
||||
export: '导出 Excel',
|
||||
columnSettings: '列设置',
|
||||
showSelection: '显示选择',
|
||||
hideSelection: '隐藏选择',
|
||||
deleting: '删除中...',
|
||||
deleteSelected: '删除所选({count})',
|
||||
tableSettings: '表格设置',
|
||||
resetLayout: '重置布局',
|
||||
wrapText: '自动换行',
|
||||
wrapMaxHeightPx: '换行最大高度(px)',
|
||||
advancedSortRules: '高级排序规则(按顺序优先)',
|
||||
addRule: '添加规则',
|
||||
noAdvancedSort: '未设置高级排序规则,将使用表头点击排序。',
|
||||
sortAsc: '升序',
|
||||
sortDesc: '降序',
|
||||
moveUp: '上移',
|
||||
moveDown: '下移',
|
||||
remove: '删除',
|
||||
filterPlaceholder: '筛选...',
|
||||
totalRows: '总数:{total}',
|
||||
showingRange: '显示:{start}-{end} / {total}',
|
||||
paginationSummary: '共 {total} 条,当前第 {page} / {pages} 页',
|
||||
perPage: '每页',
|
||||
itemsUnit: '条',
|
||||
prevPage: '上一页',
|
||||
nextPage: '下一页',
|
||||
enterFullscreen: '进入全屏',
|
||||
exitFullscreen: '退出全屏',
|
||||
noData: '暂无数据: {table}',
|
||||
usage: '使用分析',
|
||||
byUser: '按用户统计',
|
||||
byAgent: '按应用统计'
|
||||
byAgent: '按应用统计',
|
||||
columns: {
|
||||
id: 'ID',
|
||||
user_id: '用户 ID',
|
||||
username: '用户名',
|
||||
real_name: '真实姓名',
|
||||
email: '邮箱',
|
||||
phone_number: '手机号',
|
||||
department: '部门',
|
||||
employee_id: '工号',
|
||||
role: '角色',
|
||||
status: '状态',
|
||||
language: '语言',
|
||||
default_agent_id: '默认应用 ID',
|
||||
default_agent: '默认应用',
|
||||
created_at: '创建时间',
|
||||
updated_at: '更新时间',
|
||||
last_login: '最近登录',
|
||||
last_login_at: '最近登录时间',
|
||||
app_id: '应用 ID',
|
||||
dify_app_id: 'Dify 应用 ID',
|
||||
dify_api_key: 'Dify API 密钥',
|
||||
api_base_url: 'API 基础 URL',
|
||||
agent_id: '应用 ID',
|
||||
agent_name: '应用名称',
|
||||
conversation_id: '会话 ID',
|
||||
session_id: '会话 ID',
|
||||
message_id: '消息 ID',
|
||||
question: '问题',
|
||||
answer: '回答',
|
||||
response: '回复',
|
||||
content: '内容',
|
||||
description: '描述',
|
||||
extra_config: '扩展配置',
|
||||
icon_url: '图标 URL',
|
||||
feedback: '反馈',
|
||||
rating: '评分',
|
||||
comment: '评论',
|
||||
model: '模型',
|
||||
tokens: 'Token 数',
|
||||
tokens_prompt: '提示词 Token',
|
||||
tokens_completion: '补全 Token',
|
||||
total_tokens: '总 Token',
|
||||
latency_ms: '延迟(毫秒)',
|
||||
cost: '费用',
|
||||
ip: 'IP',
|
||||
user_agent: '用户代理',
|
||||
source: '来源',
|
||||
type: '类型',
|
||||
title: '标题',
|
||||
name: '名称',
|
||||
code: '编码',
|
||||
company: '公司',
|
||||
theme_preference: '主题偏好',
|
||||
password_hash: '密码哈希',
|
||||
reset_token: '重置令牌',
|
||||
reset_token_expiry: '重置令牌过期时间'
|
||||
},
|
||||
tables: {
|
||||
users: '用户',
|
||||
chat_logs: '聊天日志',
|
||||
feedbacks: '反馈',
|
||||
departments: '部门',
|
||||
agents: '应用',
|
||||
permission_requests: '权限申请'
|
||||
}
|
||||
},
|
||||
|
||||
// Batch Edit
|
||||
@@ -1037,7 +1239,8 @@ const messages = {
|
||||
// Common Messages
|
||||
role: {
|
||||
user: '普通用户',
|
||||
admin: '管理员'
|
||||
admin: '管理员',
|
||||
guest: '访客'
|
||||
},
|
||||
status: {
|
||||
active: '启用',
|
||||
@@ -1060,6 +1263,7 @@ const messages = {
|
||||
},
|
||||
chat: {
|
||||
defaultTitle: '对话',
|
||||
assistantLabel: '和信 AI 助手',
|
||||
placeholder: '请输入问题...',
|
||||
history: '历史记录',
|
||||
noHistory: '暂无历史记录',
|
||||
@@ -1089,6 +1293,12 @@ const messages = {
|
||||
profile: {
|
||||
title: '个人资料',
|
||||
personalInfo: '基本信息',
|
||||
department: '部门',
|
||||
language: '语言',
|
||||
roleAdmin: '管理员',
|
||||
roleUser: '普通用户',
|
||||
unsavedChanges: '您有未保存的更改',
|
||||
editHint: '切换到编辑模式以更新个人资料',
|
||||
security: '安全设置',
|
||||
preferences: '偏好设置',
|
||||
edit: '编辑',
|
||||
@@ -1347,9 +1557,13 @@ const messages = {
|
||||
},
|
||||
fields: {
|
||||
name: '名稱',
|
||||
namePlaceholder: '例如:資訊技術部',
|
||||
code: '編碼',
|
||||
codePlaceholder: '例如:DEPT-001',
|
||||
company: '公司',
|
||||
description: '描述'
|
||||
companyPlaceholder: '例如:總部',
|
||||
description: '描述',
|
||||
descriptionPlaceholder: '請輸入部門描述...'
|
||||
},
|
||||
confirmDelete: '確定刪除該部門嗎?',
|
||||
msg: {
|
||||
@@ -1374,6 +1588,7 @@ const messages = {
|
||||
},
|
||||
fields: {
|
||||
name: '名稱',
|
||||
namePlaceholder: '例如:人事助手',
|
||||
type: '集成類型',
|
||||
types: {
|
||||
api: 'API 集成 (Dify)',
|
||||
@@ -1381,7 +1596,8 @@ const messages = {
|
||||
},
|
||||
appId: 'Dify App ID',
|
||||
apiKey: 'API Key',
|
||||
baseUrl: 'API Base URL (選填)',
|
||||
baseUrl: 'API 基礎 URL(選填)',
|
||||
baseUrlPlaceholder: '預設:使用 Dify 配置',
|
||||
iframeUrl: 'Iframe URL',
|
||||
description: '描述',
|
||||
descPlaceholder: '簡要描述該應用的功能...'
|
||||
@@ -1405,6 +1621,7 @@ const messages = {
|
||||
},
|
||||
fields: {
|
||||
title: '標題',
|
||||
titlePlaceholder: '例如:寫日報',
|
||||
targetAgent: '目標應用',
|
||||
sortOrder: '排序',
|
||||
content: '問題內容',
|
||||
@@ -1543,12 +1760,102 @@ const messages = {
|
||||
title: '數據報表: {table}',
|
||||
subtitle: '原始數據與統計視圖',
|
||||
export: '導出 Excel',
|
||||
columnSettings: '列設置',
|
||||
showSelection: '顯示選擇',
|
||||
hideSelection: '隱藏選擇',
|
||||
deleting: '刪除中...',
|
||||
deleteSelected: '刪除所選({count})',
|
||||
tableSettings: '表格設置',
|
||||
resetLayout: '重置佈局',
|
||||
wrapText: '自動換行',
|
||||
wrapMaxHeightPx: '換行最大高度(px)',
|
||||
advancedSortRules: '高級排序規則(按順序優先)',
|
||||
addRule: '添加規則',
|
||||
noAdvancedSort: '未設置高級排序規則,將使用表頭點擊排序。',
|
||||
sortAsc: '升序',
|
||||
sortDesc: '降序',
|
||||
moveUp: '上移',
|
||||
moveDown: '下移',
|
||||
remove: '刪除',
|
||||
filterPlaceholder: '篩選...',
|
||||
totalRows: '總數:{total}',
|
||||
showingRange: '顯示:{start}-{end} / {total}',
|
||||
paginationSummary: '共 {total} 條,當前第 {page} / {pages} 頁',
|
||||
perPage: '每頁',
|
||||
itemsUnit: '條',
|
||||
prevPage: '上一頁',
|
||||
nextPage: '下一頁',
|
||||
enterFullscreen: '進入全屏',
|
||||
exitFullscreen: '退出全屏',
|
||||
noData: '暫無數據: {table}',
|
||||
usage: '使用分析',
|
||||
byUser: '按用戶統計',
|
||||
byAgent: '按應用統計'
|
||||
byAgent: '按應用統計',
|
||||
columns: {
|
||||
id: 'ID',
|
||||
user_id: '用戶 ID',
|
||||
username: '用戶名',
|
||||
real_name: '真實姓名',
|
||||
email: '郵箱',
|
||||
phone_number: '手機號',
|
||||
department: '部門',
|
||||
employee_id: '工號',
|
||||
role: '角色',
|
||||
status: '狀態',
|
||||
language: '語言',
|
||||
default_agent_id: '默認應用 ID',
|
||||
default_agent: '默認應用',
|
||||
created_at: '創建時間',
|
||||
updated_at: '更新時間',
|
||||
last_login: '最近登錄',
|
||||
last_login_at: '最近登錄時間',
|
||||
app_id: '應用 ID',
|
||||
dify_app_id: 'Dify 應用 ID',
|
||||
dify_api_key: 'Dify API 金鑰',
|
||||
api_base_url: 'API 基礎 URL',
|
||||
agent_id: '應用 ID',
|
||||
agent_name: '應用名稱',
|
||||
conversation_id: '會話 ID',
|
||||
session_id: '會話 ID',
|
||||
message_id: '消息 ID',
|
||||
question: '問題',
|
||||
answer: '回答',
|
||||
response: '回覆',
|
||||
content: '內容',
|
||||
description: '描述',
|
||||
extra_config: '擴展配置',
|
||||
icon_url: '圖示 URL',
|
||||
feedback: '反饋',
|
||||
rating: '評分',
|
||||
comment: '評論',
|
||||
model: '模型',
|
||||
tokens: 'Token 數',
|
||||
tokens_prompt: '提示詞 Token',
|
||||
tokens_completion: '補全 Token',
|
||||
total_tokens: '總 Token',
|
||||
latency_ms: '延遲(毫秒)',
|
||||
cost: '費用',
|
||||
ip: 'IP',
|
||||
user_agent: '用戶代理',
|
||||
source: '來源',
|
||||
type: '類型',
|
||||
title: '標題',
|
||||
name: '名稱',
|
||||
code: '編碼',
|
||||
company: '公司',
|
||||
theme_preference: '主題偏好',
|
||||
password_hash: '密碼雜湊',
|
||||
reset_token: '重置令牌',
|
||||
reset_token_expiry: '重置令牌過期時間'
|
||||
},
|
||||
tables: {
|
||||
users: '用戶',
|
||||
chat_logs: '聊天日誌',
|
||||
feedbacks: '反饋',
|
||||
departments: '部門',
|
||||
agents: '應用',
|
||||
permission_requests: '權限申請'
|
||||
}
|
||||
},
|
||||
|
||||
// Batch Edit
|
||||
@@ -1567,7 +1874,8 @@ const messages = {
|
||||
// Common Messages
|
||||
role: {
|
||||
user: '普通用戶',
|
||||
admin: '管理員'
|
||||
admin: '管理員',
|
||||
guest: '訪客'
|
||||
},
|
||||
status: {
|
||||
active: '啟用',
|
||||
@@ -1590,6 +1898,7 @@ const messages = {
|
||||
},
|
||||
chat: {
|
||||
defaultTitle: '對話',
|
||||
assistantLabel: 'HXOPS AI 助手',
|
||||
placeholder: '請輸入問題...',
|
||||
history: '歷史記錄',
|
||||
noHistory: '暫無歷史記錄',
|
||||
@@ -1619,6 +1928,12 @@ const messages = {
|
||||
profile: {
|
||||
title: '個人資料',
|
||||
personalInfo: '基本信息',
|
||||
department: '部門',
|
||||
language: '語言',
|
||||
roleAdmin: '管理員',
|
||||
roleUser: '用戶',
|
||||
unsavedChanges: '您有尚未保存的變更',
|
||||
editHint: '切換到編輯模式以更新個人資料',
|
||||
security: '安全設置',
|
||||
preferences: '偏好設置',
|
||||
edit: '編輯',
|
||||
@@ -1877,9 +2192,13 @@ const messages = {
|
||||
},
|
||||
fields: {
|
||||
name: 'ชื่อ',
|
||||
namePlaceholder: 'เช่น แผนกไอที',
|
||||
code: 'รหัส',
|
||||
codePlaceholder: 'เช่น DEPT-001',
|
||||
company: 'บริษัท',
|
||||
description: 'คำอธิบาย'
|
||||
companyPlaceholder: 'เช่น สำนักงานใหญ่',
|
||||
description: 'คำอธิบาย',
|
||||
descriptionPlaceholder: 'กรอกรายละเอียดแผนก...'
|
||||
},
|
||||
confirmDelete: 'ลบแผนกนี้หรือไม่?',
|
||||
msg: {
|
||||
@@ -1904,6 +2223,7 @@ const messages = {
|
||||
},
|
||||
fields: {
|
||||
name: 'ชื่อ',
|
||||
namePlaceholder: 'เช่น ผู้ช่วยฝ่ายบุคคล',
|
||||
type: 'ประเภทการรวม',
|
||||
types: {
|
||||
api: 'การรวม API (Dify)',
|
||||
@@ -1912,6 +2232,7 @@ const messages = {
|
||||
appId: 'Dify App ID',
|
||||
apiKey: 'API Key',
|
||||
baseUrl: 'API Base URL (ไม่บังคับ)',
|
||||
baseUrlPlaceholder: 'ค่าเริ่มต้น: ใช้การตั้งค่า Dify',
|
||||
iframeUrl: 'Iframe URL',
|
||||
description: 'คำอธิบาย',
|
||||
descPlaceholder: 'อธิบายสั้นๆ เกี่ยวกับตัวแทนนี้...'
|
||||
@@ -1935,6 +2256,7 @@ const messages = {
|
||||
},
|
||||
fields: {
|
||||
title: 'หัวข้อ',
|
||||
titlePlaceholder: 'เช่น เขียนรายงาน',
|
||||
targetAgent: 'ตัวแทนเป้าหมาย',
|
||||
sortOrder: 'ลำดับการเรียง',
|
||||
content: 'เนื้อหาคำถาม',
|
||||
@@ -2073,12 +2395,102 @@ const messages = {
|
||||
title: 'รายงานข้อมูล: {table}',
|
||||
subtitle: 'มุมมองข้อมูลดิบและสถิติ',
|
||||
export: 'ส่งออก Excel',
|
||||
columnSettings: 'ตั้งค่าคอลัมน์',
|
||||
showSelection: 'แสดงการเลือก',
|
||||
hideSelection: 'ซ่อนการเลือก',
|
||||
deleting: 'กำลังลบ...',
|
||||
deleteSelected: 'ลบที่เลือก ({count})',
|
||||
tableSettings: 'ตั้งค่าตาราง',
|
||||
resetLayout: 'รีเซ็ตเลย์เอาต์',
|
||||
wrapText: 'ตัดบรรทัดอัตโนมัติ',
|
||||
wrapMaxHeightPx: 'ความสูงสูงสุดของการตัดบรรทัด (px)',
|
||||
advancedSortRules: 'กฎการเรียงลำดับขั้นสูง (เรียงตามลำดับความสำคัญ)',
|
||||
addRule: 'เพิ่มกฎ',
|
||||
noAdvancedSort: 'ยังไม่มีกฎการเรียงขั้นสูง จะใช้การคลิกหัวตารางเพื่อเรียงลำดับ',
|
||||
sortAsc: 'จากน้อยไปมาก',
|
||||
sortDesc: 'จากมากไปน้อย',
|
||||
moveUp: 'เลื่อนขึ้น',
|
||||
moveDown: 'เลื่อนลง',
|
||||
remove: 'ลบ',
|
||||
filterPlaceholder: 'กรอง...',
|
||||
totalRows: 'ทั้งหมด: {total}',
|
||||
showingRange: 'แสดง: {start}-{end} / {total}',
|
||||
paginationSummary: 'ทั้งหมด {total} รายการ, หน้า {page} / {pages}',
|
||||
perPage: 'ต่อหน้า',
|
||||
itemsUnit: 'รายการ',
|
||||
prevPage: 'ก่อนหน้า',
|
||||
nextPage: 'ถัดไป',
|
||||
enterFullscreen: 'เต็มหน้าจอ',
|
||||
exitFullscreen: 'ออกจากเต็มหน้าจอ',
|
||||
noData: 'ไม่มีข้อมูลสำหรับ {table}',
|
||||
usage: 'การวิเคราะห์การใช้งาน',
|
||||
byUser: 'ตามผู้ใช้',
|
||||
byAgent: 'ตามตัวแทน'
|
||||
byAgent: 'ตามตัวแทน',
|
||||
columns: {
|
||||
id: 'ID',
|
||||
user_id: 'รหัสผู้ใช้',
|
||||
username: 'ชื่อผู้ใช้',
|
||||
real_name: 'ชื่อจริง',
|
||||
email: 'อีเมล',
|
||||
phone_number: 'เบอร์โทร',
|
||||
department: 'แผนก',
|
||||
employee_id: 'รหัสพนักงาน',
|
||||
role: 'บทบาท',
|
||||
status: 'สถานะ',
|
||||
language: 'ภาษา',
|
||||
default_agent_id: 'รหัสตัวแทนเริ่มต้น',
|
||||
default_agent: 'ตัวแทนเริ่มต้น',
|
||||
created_at: 'เวลาสร้าง',
|
||||
updated_at: 'เวลาอัปเดต',
|
||||
last_login: 'เข้าสู่ระบบล่าสุด',
|
||||
last_login_at: 'เวลาเข้าสู่ระบบล่าสุด',
|
||||
app_id: 'รหัสแอป',
|
||||
dify_app_id: 'Dify App ID',
|
||||
dify_api_key: 'Dify API Key',
|
||||
api_base_url: 'API Base URL',
|
||||
agent_id: 'รหัสตัวแทน',
|
||||
agent_name: 'ชื่อตัวแทน',
|
||||
conversation_id: 'รหัสบทสนทนา',
|
||||
session_id: 'รหัสเซสชัน',
|
||||
message_id: 'รหัสข้อความ',
|
||||
question: 'คำถาม',
|
||||
answer: 'คำตอบ',
|
||||
response: 'การตอบกลับ',
|
||||
content: 'เนื้อหา',
|
||||
description: 'คำอธิบาย',
|
||||
extra_config: 'การตั้งค่าเพิ่มเติม',
|
||||
icon_url: 'URL ไอคอน',
|
||||
feedback: 'ข้อเสนอแนะ',
|
||||
rating: 'คะแนน',
|
||||
comment: 'ความคิดเห็น',
|
||||
model: 'โมเดล',
|
||||
tokens: 'โทเค็น',
|
||||
tokens_prompt: 'โทเค็นพรอมป์ต์',
|
||||
tokens_completion: 'โทเค็นผลลัพธ์',
|
||||
total_tokens: 'โทเค็นรวม',
|
||||
latency_ms: 'ความหน่วง (ms)',
|
||||
cost: 'ค่าใช้จ่าย',
|
||||
ip: 'IP',
|
||||
user_agent: 'User Agent',
|
||||
source: 'แหล่งที่มา',
|
||||
type: 'ประเภท',
|
||||
title: 'หัวข้อ',
|
||||
name: 'ชื่อ',
|
||||
code: 'รหัส',
|
||||
company: 'บริษัท',
|
||||
theme_preference: 'ค่ากำหนดธีม',
|
||||
password_hash: 'แฮชรหัสผ่าน',
|
||||
reset_token: 'โทเค็นรีเซ็ต',
|
||||
reset_token_expiry: 'เวลาหมดอายุโทเค็นรีเซ็ต'
|
||||
},
|
||||
tables: {
|
||||
users: 'ผู้ใช้',
|
||||
chat_logs: 'บันทึกแชท',
|
||||
feedbacks: 'ข้อเสนอแนะ',
|
||||
departments: 'แผนก',
|
||||
agents: 'ตัวแทน',
|
||||
permission_requests: 'คำขอสิทธิ์'
|
||||
}
|
||||
},
|
||||
|
||||
// Batch Edit
|
||||
@@ -2097,7 +2509,8 @@ const messages = {
|
||||
// Common Messages
|
||||
role: {
|
||||
user: 'ผู้ใช้ทั่วไป',
|
||||
admin: 'ผู้ดูแลระบบ'
|
||||
admin: 'ผู้ดูแลระบบ',
|
||||
guest: 'ผู้เยี่ยมชม'
|
||||
},
|
||||
status: {
|
||||
active: 'ใช้งาน',
|
||||
@@ -2120,6 +2533,7 @@ const messages = {
|
||||
},
|
||||
chat: {
|
||||
defaultTitle: 'แชท',
|
||||
assistantLabel: 'ผู้ช่วย AI ของ HXOPS',
|
||||
placeholder: 'ถามอะไรก็ได้...',
|
||||
history: 'ประวัติการแชท',
|
||||
noHistory: 'ไม่มีประวัติ',
|
||||
@@ -2149,6 +2563,12 @@ const messages = {
|
||||
profile: {
|
||||
title: 'โปรไฟล์',
|
||||
personalInfo: 'ข้อมูลส่วนตัว',
|
||||
department: 'แผนก',
|
||||
language: 'ภาษา',
|
||||
roleAdmin: 'ผู้ดูแลระบบ',
|
||||
roleUser: 'ผู้ใช้',
|
||||
unsavedChanges: 'คุณมีการเปลี่ยนแปลงที่ยังไม่ได้บันทึก',
|
||||
editHint: 'สลับไปที่โหมดแก้ไขเพื่ออัปเดตรายละเอียดโปรไฟล์',
|
||||
security: 'ความปลอดภัย',
|
||||
preferences: 'การตั้งค่า',
|
||||
edit: 'แก้ไข',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
@@ -233,7 +233,7 @@ const openEditUserModal = (user: UserRow) => {
|
||||
email: user.email,
|
||||
department: user.department || '',
|
||||
role: user.role,
|
||||
password: '', // 留空表示不修改
|
||||
password: '', // Keep empty unless user updates password.
|
||||
real_name: user.real_name || '',
|
||||
employee_id: user.employee_id || '',
|
||||
phone_number: user.phone_number || '',
|
||||
@@ -416,7 +416,7 @@ const openReportTab = (table: string) => {
|
||||
} else {
|
||||
const newTab: ReportTab = {
|
||||
id: Date.now().toString(),
|
||||
label: table.replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase()),
|
||||
label: getReportTableLabel(table),
|
||||
type: 'table',
|
||||
table: table,
|
||||
filter: {}
|
||||
@@ -1492,6 +1492,18 @@ const visibleReportKeys = computed(() => {
|
||||
if (chatLogsColumns.value.length === 0) return Object.keys(tableData.value[0] || {});
|
||||
return chatLogsColumns.value.filter((c) => c.visible).map((c) => c.key);
|
||||
});
|
||||
const getReportColumnLabel = (key: string) => {
|
||||
const i18nKey = `admin.report.columns.${key}`;
|
||||
const translated = t(i18nKey);
|
||||
if (translated && translated !== i18nKey) return translated;
|
||||
return key.replace(/_/g, ' ').replace(/\b\w/g, (m) => m.toUpperCase());
|
||||
};
|
||||
const getReportTableLabel = (table: string) => {
|
||||
const i18nKey = `admin.report.tables.${table}`;
|
||||
const translated = t(i18nKey);
|
||||
if (translated && translated !== i18nKey) return translated;
|
||||
return table.replace(/_/g, ' ').replace(/\b\w/g, (m) => m.toUpperCase());
|
||||
};
|
||||
const getReportRowId = (row: any) => Number(row?.id);
|
||||
const allReportRowsSelected = computed(() => {
|
||||
if (!isChatLogsTable.value || paginatedSortedTableData.value.length === 0) return false;
|
||||
@@ -1595,7 +1607,7 @@ const onReportHeaderClick = (key: string) => {
|
||||
};
|
||||
const getHeaderSortMark = (key: string) => {
|
||||
if (reportHeaderSort.value?.key !== key) return '';
|
||||
return reportHeaderSort.value.direction === 'asc' ? '▲' : '▼';
|
||||
return reportHeaderSort.value.direction === 'asc' ? '↑' : '↓';
|
||||
};
|
||||
const addChatLogsSortRule = () => {
|
||||
const keys = visibleReportKeys.value;
|
||||
@@ -2019,7 +2031,7 @@ const handlePermissionImport = async (event: Event) => {
|
||||
:class="(activeModule === 'reports' && currentTable === table) ? 'bg-brand-50 text-brand-700' : 'text-slate-500 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-slate-100'"
|
||||
>
|
||||
<div class="w-1.5 h-1.5 rounded-full" :class="(activeModule === 'reports' && currentTable === table) ? 'bg-brand-600' : 'bg-slate-300'"></div>
|
||||
{{ table.replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase()) }}
|
||||
{{ getReportTableLabel(table) }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2044,7 +2056,7 @@ const handlePermissionImport = async (event: Event) => {
|
||||
<div class="p-3 bg-brand-50 rounded-xl group-hover:bg-brand-100 transition-colors">
|
||||
<Bot class="w-6 h-6 text-brand-600" />
|
||||
</div>
|
||||
<span class="text-xs font-medium text-green-600 bg-green-50 px-2 py-1 rounded-full">+2 new</span>
|
||||
<span class="text-xs font-medium text-green-600 bg-green-50 px-2 py-1 rounded-full">+2 {{ t('admin.dash.new') }}</span>
|
||||
</div>
|
||||
<div class="text-3xl font-bold text-slate-900 dark:text-slate-100 mb-1">{{ agents.length }}</div>
|
||||
<div class="text-sm text-slate-500 dark:text-slate-400 font-medium">{{ t('admin.dash.activeAgents') }}</div>
|
||||
@@ -2317,19 +2329,19 @@ const handlePermissionImport = async (event: Event) => {
|
||||
<div class="space-y-4">
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-xs font-semibold text-gray-500 uppercase">{{ t('admin.dept.fields.name') }}</label>
|
||||
<input v-model="editingDept.name" class="w-full px-3 py-2 border rounded-xl text-sm focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 outline-none" placeholder="e.g. IT Department" />
|
||||
<input v-model="editingDept.name" class="w-full px-3 py-2 border rounded-xl text-sm focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 outline-none" :placeholder="t('admin.dept.fields.namePlaceholder')" />
|
||||
</div>
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-xs font-semibold text-gray-500 uppercase">{{ t('admin.dept.fields.code') }}</label>
|
||||
<input v-model="editingDept.code" class="w-full px-3 py-2 border rounded-xl text-sm focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 outline-none" placeholder="e.g. DEPT-001" />
|
||||
<input v-model="editingDept.code" class="w-full px-3 py-2 border rounded-xl text-sm focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 outline-none" :placeholder="t('admin.dept.fields.codePlaceholder')" />
|
||||
</div>
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-xs font-semibold text-gray-500 uppercase">{{ t('admin.dept.fields.company') }}</label>
|
||||
<input v-model="editingDept.company" class="w-full px-3 py-2 border rounded-xl text-sm focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 outline-none" placeholder="e.g. HQ" />
|
||||
<input v-model="editingDept.company" class="w-full px-3 py-2 border rounded-xl text-sm focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 outline-none" :placeholder="t('admin.dept.fields.companyPlaceholder')" />
|
||||
</div>
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-xs font-semibold text-gray-500 uppercase">{{ t('admin.dept.fields.description') }}</label>
|
||||
<textarea v-model="editingDept.description" rows="3" class="w-full px-3 py-2 border rounded-xl text-sm focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 outline-none" placeholder="Department description..."></textarea>
|
||||
<textarea v-model="editingDept.description" rows="3" class="w-full px-3 py-2 border rounded-xl text-sm focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 outline-none" :placeholder="t('admin.dept.fields.descriptionPlaceholder')"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-2 pt-2">
|
||||
@@ -2404,7 +2416,7 @@ const handlePermissionImport = async (event: Event) => {
|
||||
v-model="newAgent.name"
|
||||
type="text"
|
||||
class="w-full border-gray-200 rounded-xl px-4 py-3 text-base focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 outline-none transition-all shadow-sm"
|
||||
placeholder="e.g. HR Assistant"
|
||||
:placeholder="t('admin.agent.fields.namePlaceholder')"
|
||||
/>
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
@@ -2438,7 +2450,7 @@ const handlePermissionImport = async (event: Event) => {
|
||||
v-model="newAgent.api_base_url"
|
||||
type="text"
|
||||
class="w-full border-gray-200 rounded-xl px-4 py-3 text-sm font-mono bg-white focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 outline-none shadow-sm"
|
||||
placeholder="Default: Dify Config"
|
||||
:placeholder="t('admin.agent.fields.baseUrlPlaceholder')"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -2620,7 +2632,7 @@ const handlePermissionImport = async (event: Event) => {
|
||||
<div class="space-y-4">
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-xs font-semibold text-gray-500 uppercase">{{ t('admin.question.fields.title') }}</label>
|
||||
<input v-model="newQuestion.title" class="w-full px-3 py-2 border rounded-xl text-sm focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 outline-none" placeholder="e.g. Write Report" />
|
||||
<input v-model="newQuestion.title" class="w-full px-3 py-2 border rounded-xl text-sm focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 outline-none" :placeholder="t('admin.question.fields.titlePlaceholder')" />
|
||||
</div>
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-xs font-semibold text-gray-500 uppercase">{{ t('admin.question.fields.targetAgent') }}</label>
|
||||
@@ -2992,17 +3004,17 @@ const handlePermissionImport = async (event: Event) => {
|
||||
<span class="inline-flex h-8 w-8 items-center justify-center rounded-xl bg-gradient-to-br from-sky-600 to-cyan-500 shadow-md shadow-cyan-200/70">
|
||||
<BarChart2 class="w-4 h-4 text-white" />
|
||||
</span>
|
||||
{{ t('admin.report.title', { table: currentTable.replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase()) }) }}
|
||||
{{ t('admin.report.title', { table: getReportTableLabel(currentTable) }) }}
|
||||
</h2>
|
||||
<div class="flex flex-wrap items-center gap-2 text-xs">
|
||||
<span class="inline-flex items-center rounded-full border border-slate-200 bg-slate-50 px-3 py-1 font-medium text-slate-600">
|
||||
{{ t('admin.report.subtitle') }}
|
||||
</span>
|
||||
<span v-if="isChatLogsTable" class="inline-flex items-center rounded-full border border-cyan-200 bg-cyan-50 px-3 py-1 font-semibold text-cyan-700">
|
||||
Total: {{ chatLogsTotal }}
|
||||
{{ t('admin.report.totalRows', { total: chatLogsTotal }) }}
|
||||
</span>
|
||||
<span class="inline-flex items-center rounded-full border border-indigo-200 bg-indigo-50 px-3 py-1 font-semibold text-indigo-700">
|
||||
Showing: {{ reportRangeStart }}-{{ reportRangeEnd }} / {{ reportTotalRows }}
|
||||
{{ t('admin.report.showingRange', { start: reportRangeStart, end: reportRangeEnd, total: reportTotalRows }) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3010,17 +3022,17 @@ const handlePermissionImport = async (event: Event) => {
|
||||
<button
|
||||
@click="showChatLogsColumnPanel = !showChatLogsColumnPanel"
|
||||
class="inline-flex items-center gap-2 px-5 py-2.5 rounded-xl text-sm font-semibold text-slate-700 border border-slate-300 bg-white hover:bg-slate-50 hover:border-slate-400 transition-colors"
|
||||
title="Column Settings"
|
||||
:title="t('admin.report.columnSettings')"
|
||||
>
|
||||
<Settings2 class="w-4 h-4" />
|
||||
<span>Column Settings</span>
|
||||
<span>{{ t('admin.report.columnSettings') }}</span>
|
||||
</button>
|
||||
<button
|
||||
v-if="isChatLogsTable"
|
||||
@click="showChatLogsSelection = !showChatLogsSelection"
|
||||
class="px-3 py-2 border border-slate-300 rounded-xl text-xs font-medium text-slate-600 hover:bg-slate-50"
|
||||
>
|
||||
{{ showChatLogsSelection ? 'Hide Selection' : 'Show Selection' }}
|
||||
{{ showChatLogsSelection ? t('admin.report.hideSelection') : t('admin.report.showSelection') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="isChatLogsTable && showChatLogsSelection"
|
||||
@@ -3028,7 +3040,7 @@ const handlePermissionImport = async (event: Event) => {
|
||||
:disabled="selectedReportRowIds.length === 0 || isDeletingChatLogs"
|
||||
class="flex items-center gap-2 px-4 py-2 bg-rose-600 text-white text-sm font-medium rounded-xl hover:bg-rose-700 transition-all shadow-md shadow-rose-200 active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
>
|
||||
{{ isDeletingChatLogs ? 'Deleting...' : `Delete Selected (${selectedReportRowIds.length})` }}
|
||||
{{ isDeletingChatLogs ? t('admin.report.deleting') : t('admin.report.deleteSelected', { count: selectedReportRowIds.length }) }}
|
||||
</button>
|
||||
|
||||
<button
|
||||
@@ -3056,21 +3068,21 @@ const handlePermissionImport = async (event: Event) => {
|
||||
class="p-4 md:p-5 rounded-2xl border border-slate-200 bg-white/90 shadow-sm"
|
||||
>
|
||||
<div class="flex items-center justify-between mb-3">
|
||||
<div class="text-sm font-semibold text-slate-800">Table Settings</div>
|
||||
<div class="text-sm font-semibold text-slate-800">{{ t('admin.report.tableSettings') }}</div>
|
||||
<button
|
||||
@click="resetChatLogsColumns"
|
||||
class="text-xs px-3 py-1.5 rounded-lg bg-slate-50 border border-slate-200 hover:bg-slate-100 text-slate-700"
|
||||
>
|
||||
Reset Layout
|
||||
{{ t('admin.report.resetLayout') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-3 mb-3">
|
||||
<label class="flex items-center gap-2 px-3 py-2 bg-slate-50 rounded-lg border border-slate-200 text-xs text-slate-700">
|
||||
<input type="checkbox" v-model="chatLogsWrapEnabled" class="w-4 h-4 rounded text-blue-600 focus:ring-blue-500" />
|
||||
<span>换行</span>
|
||||
<span>{{ t('admin.report.wrapText') }}</span>
|
||||
</label>
|
||||
<label class="flex items-center gap-2 px-3 py-2 bg-slate-50 rounded-lg border border-slate-200 text-xs text-slate-700">
|
||||
<span>换行最大高度(px)</span>
|
||||
<span>{{ t('admin.report.wrapMaxHeightPx') }}</span>
|
||||
<input
|
||||
v-model.number="chatLogsWrapMaxHeight"
|
||||
type="number"
|
||||
@@ -3081,15 +3093,15 @@ const handlePermissionImport = async (event: Event) => {
|
||||
</div>
|
||||
<div class="mb-3 p-3 bg-slate-50 rounded-xl border border-slate-200">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<span class="text-xs font-semibold text-slate-700">高级排序规则(按顺序优先)</span>
|
||||
<span class="text-xs font-semibold text-slate-700">{{ t('admin.report.advancedSortRules') }}</span>
|
||||
<button
|
||||
@click="addChatLogsSortRule"
|
||||
class="text-xs px-2 py-1 rounded border border-slate-300 hover:bg-white text-slate-700"
|
||||
>
|
||||
+ 添加规则
|
||||
+ {{ t('admin.report.addRule') }}
|
||||
</button>
|
||||
</div>
|
||||
<div v-if="chatLogsSortRules.length === 0" class="text-xs text-slate-500">未设置高级排序,将使用列头点击排序。</div>
|
||||
<div v-if="chatLogsSortRules.length === 0" class="text-xs text-slate-500">{{ t('admin.report.noAdvancedSort') }}</div>
|
||||
<div v-else class="space-y-2">
|
||||
<div
|
||||
v-for="(rule, ridx) in chatLogsSortRules"
|
||||
@@ -3098,16 +3110,16 @@ const handlePermissionImport = async (event: Event) => {
|
||||
>
|
||||
<span class="col-span-1 text-slate-500">{{ ridx + 1 }}.</span>
|
||||
<select v-model="rule.key" class="col-span-4 px-2 py-1 border border-slate-300 rounded">
|
||||
<option v-for="k in Object.keys(tableData[0] || {})" :key="`rule-key-${k}`" :value="k">{{ k }}</option>
|
||||
<option v-for="k in Object.keys(tableData[0] || {})" :key="`rule-key-${k}`" :value="k">{{ getReportColumnLabel(k) }}</option>
|
||||
</select>
|
||||
<select v-model="rule.direction" class="col-span-3 px-2 py-1 border border-slate-300 rounded">
|
||||
<option value="asc">正序</option>
|
||||
<option value="desc">倒序</option>
|
||||
<option value="asc">{{ t('admin.report.sortAsc') }}</option>
|
||||
<option value="desc">{{ t('admin.report.sortDesc') }}</option>
|
||||
</select>
|
||||
<div class="col-span-4 flex items-center justify-end gap-1">
|
||||
<button @click="moveChatLogsSortRule(ridx, -1)" class="px-2 py-1 rounded border border-slate-300 hover:bg-slate-50">上移</button>
|
||||
<button @click="moveChatLogsSortRule(ridx, 1)" class="px-2 py-1 rounded border border-slate-300 hover:bg-slate-50">下移</button>
|
||||
<button @click="removeChatLogsSortRule(ridx)" class="px-2 py-1 rounded border border-red-200 text-red-600 hover:bg-red-50">删除</button>
|
||||
<button @click="moveChatLogsSortRule(ridx, -1)" class="px-2 py-1 rounded border border-slate-300 hover:bg-slate-50">{{ t('admin.report.moveUp') }}</button>
|
||||
<button @click="moveChatLogsSortRule(ridx, 1)" class="px-2 py-1 rounded border border-slate-300 hover:bg-slate-50">{{ t('admin.report.moveDown') }}</button>
|
||||
<button @click="removeChatLogsSortRule(ridx)" class="px-2 py-1 rounded border border-red-200 text-red-600 hover:bg-red-50">{{ t('admin.report.remove') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3120,11 +3132,11 @@ const handlePermissionImport = async (event: Event) => {
|
||||
>
|
||||
<label class="flex items-center gap-2 min-w-0">
|
||||
<input type="checkbox" v-model="col.visible" class="w-4 h-4 rounded text-blue-600 focus:ring-blue-500" />
|
||||
<span class="text-xs text-slate-700 truncate">{{ col.key }}</span>
|
||||
<span class="text-xs text-slate-700 truncate">{{ getReportColumnLabel(col.key) }}</span>
|
||||
</label>
|
||||
<div class="flex items-center gap-1">
|
||||
<button @click="moveChatLogsColumn(col.key, -1)" class="text-xs px-1.5 py-0.5 rounded border border-slate-300 hover:bg-white">◀</button>
|
||||
<button @click="moveChatLogsColumn(col.key, 1)" class="text-xs px-1.5 py-0.5 rounded border border-slate-300 hover:bg-white">▶</button>
|
||||
<button @click="moveChatLogsColumn(col.key, -1)" class="text-xs px-1.5 py-0.5 rounded border border-slate-300 hover:bg-white"><</button>
|
||||
<button @click="moveChatLogsColumn(col.key, 1)" class="text-xs px-1.5 py-0.5 rounded border border-slate-300 hover:bg-white">></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3161,14 +3173,14 @@ const handlePermissionImport = async (event: Event) => {
|
||||
@click="onReportHeaderClick(String(key))"
|
||||
class="text-left hover:text-blue-700 transition-colors"
|
||||
>
|
||||
{{ key }} <span class="text-[10px] text-blue-600">{{ getHeaderSortMark(String(key)) }}</span>
|
||||
{{ getReportColumnLabel(String(key)) }} <span class="text-[10px] text-blue-600">{{ getHeaderSortMark(String(key)) }}</span>
|
||||
</button>
|
||||
<input
|
||||
v-model="columnFilters[key]"
|
||||
@input="handleFilterChange"
|
||||
type="text"
|
||||
class="w-full px-2 py-1 text-xs border border-slate-300 rounded focus:ring-1 focus:ring-sky-500 outline-none font-normal normal-case bg-white/95"
|
||||
placeholder="Filter..."
|
||||
:placeholder="t('admin.report.filterPlaceholder')"
|
||||
/>
|
||||
</div>
|
||||
<span
|
||||
@@ -3206,11 +3218,11 @@ const handlePermissionImport = async (event: Event) => {
|
||||
|
||||
<div v-if="tableData.length > 0" class="flex flex-col gap-3 rounded-2xl border border-slate-200 bg-white/80 px-4 py-3 md:flex-row md:items-center md:justify-between">
|
||||
<div class="text-sm text-slate-600">
|
||||
共 {{ reportTotalRows }} 条,当前第 {{ reportCurrentPage }} / {{ reportTotalPages }} 页
|
||||
{{ t('admin.report.paginationSummary', { total: reportTotalRows, page: reportCurrentPage, pages: reportTotalPages }) }}
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<label class="flex items-center gap-2 text-xs text-slate-600">
|
||||
<span>每页</span>
|
||||
<span>{{ t('admin.report.perPage') }}</span>
|
||||
<span class="relative inline-flex items-center">
|
||||
<select
|
||||
v-model.number="reportPageSize"
|
||||
@@ -3222,14 +3234,14 @@ const handlePermissionImport = async (event: Event) => {
|
||||
<path fill-rule="evenodd" d="M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.168l3.71-3.938a.75.75 0 1 1 1.08 1.04l-4.25 4.5a.75.75 0 0 1-1.08 0l-4.25-4.5a.75.75 0 0 1 .02-1.06Z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</span>
|
||||
<span>条</span>
|
||||
<span>{{ t('admin.report.itemsUnit') }}</span>
|
||||
</label>
|
||||
<button
|
||||
@click="prevReportPage"
|
||||
:disabled="reportCurrentPage <= 1"
|
||||
class="rounded-lg border border-slate-300 px-2.5 py-1.5 text-xs text-slate-700 hover:bg-slate-50 disabled:opacity-40 disabled:cursor-not-allowed"
|
||||
>
|
||||
上一页
|
||||
{{ t('admin.report.prevPage') }}
|
||||
</button>
|
||||
<button
|
||||
v-for="btn in reportPageButtons"
|
||||
@@ -3250,17 +3262,17 @@ const handlePermissionImport = async (event: Event) => {
|
||||
:disabled="reportCurrentPage >= reportTotalPages"
|
||||
class="rounded-lg border border-slate-300 px-2.5 py-1.5 text-xs text-slate-700 hover:bg-slate-50 disabled:opacity-40 disabled:cursor-not-allowed"
|
||||
>
|
||||
下一页
|
||||
{{ t('admin.report.nextPage') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Statistics Charts -->
|
||||
<div v-if="currentTable === 'chat_logs' && usageReport" class="mt-10 border-t border-slate-200 pt-10">
|
||||
<h3 class="font-bold text-lg mb-6 text-slate-900">Usage Analytics</h3>
|
||||
<h3 class="font-bold text-lg mb-6 text-slate-900">{{ t('admin.report.usage') }}</h3>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
||||
<div class="bg-white border border-slate-200 rounded-2xl p-6 shadow-sm">
|
||||
<h4 class="text-sm font-bold text-slate-500 uppercase tracking-wider mb-4">Requests by User</h4>
|
||||
<h4 class="text-sm font-bold text-slate-500 uppercase tracking-wider mb-4">{{ t('admin.report.byUser') }}</h4>
|
||||
<div class="space-y-3">
|
||||
<div v-for="u in usageReport.by_user" :key="u.username" class="flex items-center justify-between p-3 bg-slate-50 rounded-xl">
|
||||
<span class="font-medium text-slate-700">{{ u.username }}</span>
|
||||
@@ -3269,7 +3281,7 @@ const handlePermissionImport = async (event: Event) => {
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white border border-slate-200 rounded-2xl p-6 shadow-sm">
|
||||
<h4 class="text-sm font-bold text-slate-500 uppercase tracking-wider mb-4">Requests by Agent</h4>
|
||||
<h4 class="text-sm font-bold text-slate-500 uppercase tracking-wider mb-4">{{ t('admin.report.byAgent') }}</h4>
|
||||
<div class="space-y-3">
|
||||
<div v-for="a in usageReport.by_agent" :key="a.agent" class="flex items-center justify-between p-3 bg-slate-50 rounded-xl">
|
||||
<span class="font-medium text-slate-700">{{ a.agent }}</span>
|
||||
@@ -3654,3 +3666,4 @@ const handlePermissionImport = async (event: Event) => {
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -290,7 +290,7 @@ onMounted(() => {
|
||||
<h2 class="text-xl font-bold text-slate-900 dark:text-slate-100">{{ user.real_name || user.username }}</h2>
|
||||
<p class="text-slate-500 dark:text-slate-400 text-sm mt-1">{{ user.email }}</p>
|
||||
<div class="mt-4 inline-flex items-center px-3 py-1 rounded-full bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-300 text-xs font-medium">
|
||||
{{ user.role === 'admin' ? 'Administrator' : 'User' }}
|
||||
{{ user.role === 'admin' ? ($t('profile.roleAdmin') || 'Administrator') : ($t('profile.roleUser') || 'User') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -315,7 +315,7 @@ onMounted(() => {
|
||||
{{ isEditing ? ($t('profile.edit') || 'Edit') : ($t('profile.personalInfo') || 'Personal Information') }}
|
||||
</div>
|
||||
<div class="text-xs text-slate-500 dark:text-slate-400">
|
||||
{{ isEditing ? 'You have unsaved changes' : 'Switch to edit mode to update profile details' }}
|
||||
{{ isEditing ? ($t('profile.unsavedChanges') || 'You have unsaved changes') : ($t('profile.editHint') || 'Switch to edit mode to update profile details') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
@@ -379,7 +379,7 @@ onMounted(() => {
|
||||
|
||||
<div>
|
||||
<label class="text-xs font-medium text-slate-500 uppercase flex items-center gap-1.5 mb-1.5">
|
||||
<Building class="w-3.5 h-3.5" /> {{ $t('admin.user.dept') || 'Department' }}
|
||||
<Building class="w-3.5 h-3.5" /> {{ $t('profile.department') || 'Department' }}
|
||||
</label>
|
||||
<input v-if="isEditing" v-model="user.department" type="text" class="input-field" />
|
||||
<div v-else class="p-2.5 bg-slate-50 dark:bg-slate-800 rounded-lg text-slate-700 dark:text-slate-300 border border-slate-200 dark:border-slate-700 text-sm font-medium">
|
||||
@@ -418,7 +418,7 @@ onMounted(() => {
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<label class="text-xs font-medium text-slate-500 uppercase mb-1.5 block">Language</label>
|
||||
<label class="text-xs font-medium text-slate-500 uppercase mb-1.5 block">{{ $t('profile.language') || 'Language' }}</label>
|
||||
<select
|
||||
v-model="user.language"
|
||||
:disabled="!isEditing"
|
||||
|
||||
@@ -791,6 +791,7 @@ onMounted(async () => {
|
||||
<div class="w-full max-w-6xl grid grid-cols-1 lg:grid-cols-2 gap-12 items-center p-4">
|
||||
<!-- Hero Section -->
|
||||
<div class="hidden lg:block space-y-8 animate-slide-up">
|
||||
<!--
|
||||
<div class="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-brand-50 text-brand-600 text-sm font-medium border border-brand-100">
|
||||
<span class="relative flex h-2 w-2">
|
||||
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-brand-400 opacity-75"></span>
|
||||
@@ -798,6 +799,7 @@ onMounted(async () => {
|
||||
</span>
|
||||
{{ $t('title') }}
|
||||
</div>
|
||||
-->
|
||||
<h1 class="text-5xl font-bold text-slate-900 leading-tight">
|
||||
{{ $t('landing.hero.prefix') }} <br/>
|
||||
<span class="text-transparent bg-clip-text bg-gradient-to-r from-brand-600 to-purple-600">{{ $t('landing.hero.highlight') }}</span>
|
||||
@@ -825,7 +827,7 @@ onMounted(async () => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div v-if="isLoggedIn" class="grid grid-cols-2 gap-4">
|
||||
<div v-for="agent in publicAgents.slice(0, 4)" :key="agent.id"
|
||||
class="bg-white dark:bg-slate-900 p-4 rounded-xl border border-slate-100 dark:border-slate-700 shadow-sm flex items-center gap-3">
|
||||
<div class="w-10 h-10 bg-brand-50 rounded-lg flex items-center justify-center text-brand-600 shrink-0">
|
||||
@@ -892,7 +894,7 @@ onMounted(async () => {
|
||||
</div>
|
||||
|
||||
<!-- Public Agents Showcase Mobile -->
|
||||
<div v-if="publicAgents.length > 0" class="mt-8 pt-6 border-t border-slate-100 lg:hidden">
|
||||
<div v-if="isLoggedIn && publicAgents.length > 0" class="mt-8 pt-6 border-t border-slate-100 lg:hidden">
|
||||
<div class="grid grid-cols-4 gap-3">
|
||||
<div v-for="agent in publicAgents.slice(0, 4)" :key="agent.id"
|
||||
class="flex flex-col items-center">
|
||||
|
||||
Reference in new issue
Block a user