feat(shared): add UI components, hooks, form fields, and action utils

- Add UI components: confirm-delete-dialog, empty-table-row, list-pagination, pagination, status-badge

- Add form-fields directory for reusable form field components

- Add hooks: use-action-mutation, use-action-query for server action integration

- Add action-utils lib for action state helpers

- Update a11y components, charts, global-search, onboarding-gate, question components

- Update UI components: chip-nav, filter-bar, page-header, stat-card, stat-item, switch, table

- Update hooks: use-action-with-toast, use-aria-live, use-debounce, use-local-storage, use-media-query, use-permission

- Update lib: a11y, ai, audit-logger, auth-guard, bcrypt-utils, change-logger, download, excel, file-storage, http-utils, login-logger, password-policy, password-security-service, permissions, rate-limit, role-utils, search-params, session, storage-provider

- Update types: action-state, permissions

- Update i18n messages (en, zh-CN) for dashboard, diagnostic, grades, lesson-preparation, settings
This commit is contained in:
SpecialX
2026-06-23 17:38:14 +08:00
parent 9ceb2b7b67
commit c4d3433cc9
25 changed files with 1986 additions and 28 deletions

View File

@@ -11,6 +11,18 @@
"profile": {
"title": "个人信息",
"description": "更新您的个人资料。",
"avatar": {
"upload": "上传头像",
"remove": "移除",
"hint": "支持 JPG、PNG、WebP、GIF最大 2MB",
"uploadSuccess": "头像更新成功",
"uploadFailure": "头像上传失败",
"removeSuccess": "头像已移除",
"removeFailure": "移除头像失败",
"invalidType": "仅支持 JPG、PNG、WebP、GIF 格式",
"tooLarge": "文件大小不能超过 2MB",
"tooLongName": "文件名过长,请重命名后再上传(最多 255 字符)"
},
"fields": {
"name": "姓名",
"namePlaceholder": "您的姓名",
@@ -68,7 +80,10 @@
"save": "保存偏好",
"saving": "保存中...",
"success": "通知偏好已更新",
"failure": "通知偏好更新失败"
"failure": "通知偏好更新失败",
"test": "测试",
"testSuccess": "测试通知已发送",
"testFailure": "测试通知发送失败"
},
"appearance": {
"theme": {
@@ -120,6 +135,63 @@
"tip2": "避免使用常见词汇、姓名或连续模式。",
"tip3": "定期更换密码。",
"tip4": "多次登录失败后账户将被临时锁定。"
},
"center": {
"title": "安全中心",
"description": "管理两步验证和查看登录活动。",
"twoFactor": {
"title": "两步验证2FA",
"description": "启用后,登录时需要输入手机验证器生成的一次性码。",
"enabled": "已启用",
"hint": "启用 2FA 可显著提升账户安全性,防止密码泄露导致的未授权访问。",
"enable": "启用",
"disable": "关闭",
"enableSuccess": "两步验证已启用",
"disableSuccess": "两步验证已关闭",
"toggleFailure": "操作失败,请稍后重试",
"setupFailure": "生成二维码失败,请稍后重试",
"verifyFailure": "验证失败,请稍后重试",
"disableFailure": "关闭失败,请稍后重试",
"regenerateFailure": "重新生成备份码失败,请稍后重试",
"regenerateSuccess": "备份码已重新生成",
"invalidCode": "验证码无效,请重新输入",
"scanQr": "使用验证器 App如 Google Authenticator、Microsoft Authenticator扫描上方二维码",
"manualEntry": "无法扫码?手动输入此密钥",
"enterCode": "输入验证器显示的 6 位数字",
"enterCodeDisable": "输入一次性码或备份码以确认关闭 2FA",
"enterCodeRegen": "输入当前的一次性码以重新生成备份码",
"verify": "验证并启用",
"cancel": "取消",
"done": "完成",
"backupCodes": "备份码",
"backupHint": "无法访问验证器时用于恢复账户",
"backupRemaining": "剩余 {count} 个备份码",
"backupWarning": "请妥善保存这些备份码。每个备份码只能使用一次。丢失后无法找回,只能重新生成。",
"copy": "复制全部",
"copied": "已复制",
"regenerate": "重新生成",
"disableTitle": "关闭两步验证",
"disableDescription": "关闭后,登录将不再需要一次性码。为确认是本人操作,请输入当前的一次性码或备份码。",
"regenerateTitle": "重新生成备份码",
"regenerateDescription": "此操作将使所有旧备份码失效,并生成 10 个新备份码。请输入当前的一次性码以确认。"
},
"recentLogins": {
"title": "最近登录",
"showingLatest": "最近 {count} 条记录",
"empty": "暂无登录记录",
"failed": "失败",
"current": "当前会话",
"revokeAll": "登出所有其他会话",
"revoking": "处理中...",
"revokeSuccess": "已登出 {count} 个会话",
"revokeSuccessEmpty": "无其他活跃会话需要登出",
"revokeFailure": "登出会话失败,请稍后重试",
"actions": {
"signin": "登录",
"signout": "退出",
"signup": "注册"
}
}
}
},
"ai": {