@liujitcn/kratos-admin-system 0.0.31 → 0.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/README.md +34 -20
  2. package/dist/package/declarations/src/api/base/{notification.d.ts → v1/notification.d.ts} +3 -1
  3. package/dist/package/declarations/src/api/system/admin/v1/base_api_log.d.ts +10 -0
  4. package/dist/package/declarations/src/api/system/{base_area.d.ts → admin/v1/base_area.d.ts} +1 -1
  5. package/dist/package/declarations/src/api/system/{base_config.d.ts → admin/v1/base_config.d.ts} +5 -1
  6. package/dist/package/declarations/src/api/system/admin/v1/base_data_access_log.d.ts +10 -0
  7. package/dist/package/declarations/src/api/system/admin/v1/base_dict.d.ts +20 -0
  8. package/dist/package/declarations/src/api/system/admin/v1/base_dict_item.d.ts +18 -0
  9. package/dist/package/declarations/src/api/system/{base_job.d.ts → admin/v1/base_job.d.ts} +4 -5
  10. package/dist/package/declarations/src/api/system/admin/v1/base_job_log.d.ts +9 -0
  11. package/dist/package/declarations/src/api/system/{base_language.d.ts → admin/v1/base_language.d.ts} +3 -3
  12. package/dist/package/declarations/src/api/system/admin/v1/base_log.d.ts +8 -0
  13. package/dist/package/declarations/src/api/system/admin/v1/base_login_log.d.ts +10 -0
  14. package/dist/package/declarations/src/api/system/admin/v1/base_login_policy.d.ts +19 -0
  15. package/dist/package/declarations/src/api/system/admin/v1/base_operation_log.d.ts +10 -0
  16. package/dist/package/declarations/src/api/system/admin/v1/base_permission_log.d.ts +10 -0
  17. package/dist/package/declarations/src/api/system/admin/v1/base_policy_evaluation_log.d.ts +10 -0
  18. package/dist/package/declarations/src/api/system/admin/v1/base_table_archive.d.ts +20 -0
  19. package/dist/package/declarations/src/api/system/admin/v1/base_table_archive_record.d.ts +11 -0
  20. package/dist/package/declarations/src/api/system/admin/v1/base_table_archive_restore.d.ts +14 -0
  21. package/dist/package/declarations/src/api/system/admin/v1/base_table_backup.d.ts +20 -0
  22. package/dist/package/declarations/src/api/system/admin/v1/base_table_backup_record.d.ts +11 -0
  23. package/dist/package/declarations/src/api/system/admin/v1/base_table_backup_restore.d.ts +14 -0
  24. package/dist/package/declarations/src/api/system/admin/v1/base_table_source.d.ts +11 -0
  25. package/dist/package/declarations/src/api/system/admin/v1/cache.d.ts +7 -0
  26. package/dist/package/declarations/src/api/system/base_redact_field.d.ts +20 -0
  27. package/dist/package/declarations/src/api/system/base_redact_policy.d.ts +19 -0
  28. package/dist/package/declarations/src/api/system/base_redact_rule.d.ts +22 -0
  29. package/dist/package/declarations/src/components/ChangePasswordForm.vue.d.ts +3 -0
  30. package/dist/package/declarations/src/components/DynamicI18nCell.vue.d.ts +5 -1
  31. package/dist/package/declarations/src/components/ForcedPasswordDialog.vue.d.ts +3 -0
  32. package/dist/package/declarations/src/components/{AuditLogTable.vue.d.ts → LogTable.vue.d.ts} +14 -7
  33. package/dist/package/declarations/src/components/dynamicI18n.d.ts +4 -7
  34. package/dist/package/declarations/src/components/log.d.ts +20 -0
  35. package/dist/package/declarations/src/config/base-log-fallback.d.ts +7 -0
  36. package/dist/package/declarations/src/config/database-backup.d.ts +12 -0
  37. package/dist/package/declarations/src/config/index.d.ts +7 -0
  38. package/dist/package/declarations/src/config/types.d.ts +56 -0
  39. package/dist/package/declarations/src/locales/generated.d.ts +1084 -500
  40. package/dist/package/declarations/src/rpc/base/v1/login.d.ts +5 -3
  41. package/dist/package/declarations/src/rpc/base/v1/notification.d.ts +25 -0
  42. package/dist/package/declarations/src/rpc/system/admin/v1/auth.d.ts +13 -0
  43. package/dist/package/declarations/src/rpc/system/admin/v1/base_api.d.ts +2 -0
  44. package/dist/package/declarations/src/rpc/system/admin/v1/base_api_log.d.ts +84 -0
  45. package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +38 -0
  46. package/dist/package/declarations/src/rpc/system/admin/v1/base_data_access_log.d.ts +112 -0
  47. package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +0 -101
  48. package/dist/package/declarations/src/rpc/system/admin/v1/base_dict_item.d.ts +107 -0
  49. package/dist/package/declarations/src/rpc/system/admin/v1/base_job.d.ts +5 -56
  50. package/dist/package/declarations/src/rpc/system/admin/v1/base_job_log.d.ts +60 -0
  51. package/dist/package/declarations/src/rpc/system/admin/v1/base_log.d.ts +77 -0
  52. package/dist/package/declarations/src/rpc/system/admin/v1/base_login_log.d.ts +92 -0
  53. package/dist/package/declarations/src/rpc/system/admin/v1/base_login_policy.d.ts +169 -41
  54. package/dist/package/declarations/src/rpc/system/admin/v1/base_operation_log.d.ts +106 -0
  55. package/dist/package/declarations/src/rpc/system/admin/v1/base_permission_log.d.ts +118 -0
  56. package/dist/package/declarations/src/rpc/system/admin/v1/base_policy_evaluation_log.d.ts +119 -0
  57. package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_common.d.ts +9 -0
  58. package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_field.d.ts +161 -0
  59. package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_policy.d.ts +150 -0
  60. package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_rule.d.ts +111 -0
  61. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_archive.d.ts +90 -0
  62. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_archive_record.d.ts +82 -0
  63. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_archive_restore.d.ts +76 -0
  64. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_backup.d.ts +74 -0
  65. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_backup_record.d.ts +69 -0
  66. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_backup_restore.d.ts +76 -0
  67. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_source.d.ts +16 -0
  68. package/dist/package/declarations/src/rpc/system/admin/v1/base_user.d.ts +15 -0
  69. package/dist/package/declarations/src/rpc/system/admin/v1/cache.d.ts +47 -0
  70. package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_column.d.ts +2 -0
  71. package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_table.d.ts +8 -0
  72. package/dist/package/declarations/src/rpc/system/common/v1/common.d.ts +26 -0
  73. package/dist/package/declarations/src/rpc/system/config/v1/system_config.d.ts +8 -0
  74. package/dist/package/declarations/src/{api/system → utils}/code_gen_i18n.d.ts +1 -2
  75. package/dist/package/declarations/src/{api/system → utils}/code_gen_sse.d.ts +1 -1
  76. package/dist/package/declarations/src/utils/notification-response.d.ts +5 -0
  77. package/dist/package/declarations/src/{api/system → utils}/ops_monitoring_sse.d.ts +1 -1
  78. package/dist/package/declarations/src/{api/system → utils}/runtime_log_sse.d.ts +1 -1
  79. package/dist/package/declarations/src/views/base/backup-management/archive-config/index.vue.d.ts +3 -0
  80. package/dist/package/declarations/src/views/base/backup-management/archive-record/index.vue.d.ts +3 -0
  81. package/dist/package/declarations/src/views/base/backup-management/archive-restore/index.vue.d.ts +3 -0
  82. package/dist/package/declarations/src/views/base/backup-management/backup-config/index.vue.d.ts +3 -0
  83. package/dist/package/declarations/src/views/base/backup-management/backup-record/index.vue.d.ts +3 -0
  84. package/dist/package/declarations/src/views/base/backup-management/backup-restore/index.vue.d.ts +3 -0
  85. package/dist/package/declarations/src/views/base/login-policy/format.d.ts +2 -0
  86. package/dist/package/declarations/src/views/base/redact-field/index.vue.d.ts +3 -0
  87. package/dist/package/declarations/src/views/base/redact-policy/index.vue.d.ts +3 -0
  88. package/dist/package/declarations/src/views/base/redact-rule/index.vue.d.ts +3 -0
  89. package/dist/package/declarations/src/views/base/runtime-config/index.vue.d.ts +3 -0
  90. package/dist/package/declarations/src/views/tool/cache/index.vue.d.ts +3 -0
  91. package/dist/package/src/api/base/v1/notification.ts +99 -0
  92. package/dist/package/src/api/system/admin/v1/base_api_log.ts +33 -0
  93. package/dist/package/src/api/system/{base_area.ts → admin/v1/base_area.ts} +1 -1
  94. package/dist/package/src/api/system/{base_config.ts → admin/v1/base_config.ts} +20 -0
  95. package/dist/package/src/api/system/admin/v1/base_data_access_log.ts +33 -0
  96. package/dist/package/src/api/system/{base_dict.ts → admin/v1/base_dict.ts} +0 -60
  97. package/dist/package/src/api/system/admin/v1/base_dict_item.ts +72 -0
  98. package/dist/package/src/api/system/{base_job.ts → admin/v1/base_job.ts} +11 -22
  99. package/dist/package/src/api/system/admin/v1/base_job_log.ts +32 -0
  100. package/dist/package/src/api/system/{base_language.ts → admin/v1/base_language.ts} +3 -3
  101. package/dist/package/src/api/system/admin/v1/base_log.ts +23 -0
  102. package/dist/package/src/api/system/admin/v1/base_login_log.ts +33 -0
  103. package/dist/package/src/api/system/admin/v1/base_login_policy.ts +67 -0
  104. package/dist/package/src/api/system/{base_message.ts → admin/v1/base_message.ts} +29 -9
  105. package/dist/package/src/api/system/{base_message_category.ts → admin/v1/base_message_category.ts} +30 -7
  106. package/dist/package/src/api/system/admin/v1/base_operation_log.ts +33 -0
  107. package/dist/package/src/api/system/admin/v1/base_permission_log.ts +33 -0
  108. package/dist/package/src/api/system/admin/v1/base_policy_evaluation_log.ts +33 -0
  109. package/dist/package/src/api/system/admin/v1/base_table_archive.ts +70 -0
  110. package/dist/package/src/api/system/admin/v1/base_table_archive_record.ts +33 -0
  111. package/dist/package/src/api/system/admin/v1/base_table_archive_restore.ts +44 -0
  112. package/dist/package/src/api/system/admin/v1/base_table_backup.ts +70 -0
  113. package/dist/package/src/api/system/admin/v1/base_table_backup_record.ts +33 -0
  114. package/dist/package/src/api/system/admin/v1/base_table_backup_restore.ts +44 -0
  115. package/dist/package/src/api/system/admin/v1/base_table_source.ts +33 -0
  116. package/dist/package/src/api/system/admin/v1/cache.ts +22 -0
  117. package/dist/package/src/api/system/{code_gen_column.ts → admin/v1/code_gen_column.ts} +19 -3
  118. package/dist/package/src/api/system/{code_gen_table.ts → admin/v1/code_gen_table.ts} +13 -4
  119. package/dist/package/src/api/system/base_redact_field.ts +25 -0
  120. package/dist/package/src/api/system/base_redact_policy.ts +24 -0
  121. package/dist/package/src/api/system/base_redact_rule.ts +27 -0
  122. package/dist/package/src/components/Ai.vue +1 -1
  123. package/dist/package/src/components/ChangePasswordForm.vue +143 -0
  124. package/dist/package/src/components/DynamicI18nCell.vue +28 -8
  125. package/dist/package/src/components/DynamicI18nEditor.vue +1 -1
  126. package/dist/package/src/components/ForcedPasswordDialog.vue +40 -0
  127. package/dist/package/src/components/LogTable.vue +190 -0
  128. package/dist/package/src/components/Notification.vue +112 -7
  129. package/dist/package/src/components/dynamicI18n.ts +5 -9
  130. package/dist/package/src/components/log.ts +87 -0
  131. package/dist/package/src/config/base-log-fallback.ts +26 -0
  132. package/dist/package/src/config/database-backup.ts +57 -0
  133. package/dist/package/src/config/index.ts +26 -0
  134. package/dist/package/src/config/types.ts +59 -0
  135. package/dist/package/src/locales/README.md +2 -1
  136. package/dist/package/src/locales/en-US.json +285 -127
  137. package/dist/package/src/locales/ja-JP.json +285 -127
  138. package/dist/package/src/locales/zh-CN.json +285 -127
  139. package/dist/package/src/locales/zh-TW.json +285 -127
  140. package/dist/package/src/module.ts +3 -1
  141. package/dist/package/src/rpc/base/v1/login.ts +4 -2
  142. package/dist/package/src/rpc/base/v1/notification.ts +28 -0
  143. package/dist/package/src/rpc/system/admin/v1/auth.ts +13 -0
  144. package/dist/package/src/rpc/system/admin/v1/base_api.ts +2 -0
  145. package/dist/package/src/rpc/system/admin/v1/base_api_log.ts +102 -0
  146. package/dist/package/src/rpc/system/admin/v1/base_config.ts +42 -0
  147. package/dist/package/src/rpc/system/admin/v1/base_data_access_log.ts +135 -0
  148. package/dist/package/src/rpc/system/admin/v1/base_dict.ts +0 -112
  149. package/dist/package/src/rpc/system/admin/v1/base_dict_item.ts +126 -0
  150. package/dist/package/src/rpc/system/admin/v1/base_job.ts +5 -62
  151. package/dist/package/src/rpc/system/admin/v1/base_job_log.ts +75 -0
  152. package/dist/package/src/rpc/system/admin/v1/base_log.ts +90 -0
  153. package/dist/package/src/rpc/system/admin/v1/base_login_log.ts +113 -0
  154. package/dist/package/src/rpc/system/admin/v1/base_login_policy.ts +191 -42
  155. package/dist/package/src/rpc/system/admin/v1/base_operation_log.ts +127 -0
  156. package/dist/package/src/rpc/system/admin/v1/base_permission_log.ts +142 -0
  157. package/dist/package/src/rpc/system/admin/v1/base_policy_evaluation_log.ts +143 -0
  158. package/dist/package/src/rpc/system/admin/v1/base_redact_common.ts +17 -0
  159. package/dist/package/src/rpc/system/admin/v1/base_redact_field.ts +182 -0
  160. package/dist/package/src/rpc/system/admin/v1/base_redact_policy.ts +174 -0
  161. package/dist/package/src/rpc/system/admin/v1/base_redact_rule.ts +131 -0
  162. package/dist/package/src/rpc/system/admin/v1/base_table_archive.ts +109 -0
  163. package/dist/package/src/rpc/system/admin/v1/base_table_archive_record.ts +95 -0
  164. package/dist/package/src/rpc/system/admin/v1/base_table_archive_restore.ts +93 -0
  165. package/dist/package/src/rpc/system/admin/v1/base_table_backup.ts +91 -0
  166. package/dist/package/src/rpc/system/admin/v1/base_table_backup_record.ts +82 -0
  167. package/dist/package/src/rpc/system/admin/v1/base_table_backup_restore.ts +91 -0
  168. package/dist/package/src/rpc/system/admin/v1/base_table_source.ts +26 -0
  169. package/dist/package/src/rpc/system/admin/v1/base_user.ts +15 -0
  170. package/dist/package/src/rpc/system/admin/v1/cache.ts +59 -0
  171. package/dist/package/src/rpc/system/admin/v1/code_gen_column.ts +2 -0
  172. package/dist/package/src/rpc/system/admin/v1/code_gen_table.ts +8 -0
  173. package/dist/package/src/rpc/system/common/v1/common.ts +35 -0
  174. package/dist/package/src/rpc/system/config/v1/system_config.ts +16 -0
  175. package/dist/package/src/{api/system → utils}/code_gen_i18n.ts +1 -1
  176. package/dist/package/src/{api/system → utils}/code_gen_sse.ts +1 -1
  177. package/dist/package/src/utils/notification-response.ts +22 -0
  178. package/dist/package/src/{api/system → utils}/ops_monitoring_sse.ts +1 -1
  179. package/dist/package/src/{api/system → utils}/runtime_log_sse.ts +1 -1
  180. package/dist/package/src/views/ai/chat/components/AiMarkdown.vue +1 -1
  181. package/dist/package/src/views/ai/chat/components/ChatPanel.vue +2 -4
  182. package/dist/package/src/views/ai/chat/components/XSender.vue +1 -1
  183. package/dist/package/src/views/ai/chat/index.vue +3 -3
  184. package/dist/package/src/views/ai/chat/message.ts +3 -8
  185. package/dist/package/src/views/base/api/index.vue +4 -4
  186. package/dist/package/src/views/base/api-log/index.vue +56 -45
  187. package/dist/package/src/views/base/area/index.vue +1 -1
  188. package/dist/package/src/views/base/backup-management/archive-config/index.vue +151 -0
  189. package/dist/package/src/views/base/backup-management/archive-record/index.vue +44 -0
  190. package/dist/package/src/views/base/backup-management/archive-restore/index.vue +59 -0
  191. package/dist/package/src/views/base/backup-management/backup-config/index.vue +119 -0
  192. package/dist/package/src/views/base/backup-management/backup-record/index.vue +41 -0
  193. package/dist/package/src/views/base/backup-management/backup-restore/index.vue +66 -0
  194. package/dist/package/src/views/base/config/index.vue +16 -25
  195. package/dist/package/src/views/base/dashboard/index.vue +68 -66
  196. package/dist/package/src/views/base/data-access-log/index.vue +64 -52
  197. package/dist/package/src/views/base/dept/index.vue +11 -11
  198. package/dist/package/src/views/base/dict/index.vue +5 -5
  199. package/dist/package/src/views/base/dict/item.vue +12 -12
  200. package/dist/package/src/views/base/file/index.vue +220 -16
  201. package/dist/package/src/views/base/job/index.vue +5 -5
  202. package/dist/package/src/views/base/job/log.vue +38 -11
  203. package/dist/package/src/views/base/language/index.vue +1 -1
  204. package/dist/package/src/views/base/login-log/index.vue +49 -45
  205. package/dist/package/src/views/base/login-policy/format.ts +4 -0
  206. package/dist/package/src/views/base/login-policy/index.vue +496 -185
  207. package/dist/package/src/views/base/menu/index.vue +17 -17
  208. package/dist/package/src/views/base/message/index.vue +149 -19
  209. package/dist/package/src/views/base/message-category/index.vue +41 -10
  210. package/dist/package/src/views/base/migration/index.vue +2 -2
  211. package/dist/package/src/views/base/oauth-client/index.vue +19 -9
  212. package/dist/package/src/views/base/operation-log/index.vue +54 -50
  213. package/dist/package/src/views/base/permission-log/index.vue +57 -52
  214. package/dist/package/src/views/base/policy-evaluation-log/index.vue +61 -50
  215. package/dist/package/src/views/base/post/index.vue +11 -11
  216. package/dist/package/src/views/base/redact-field/index.vue +59 -0
  217. package/dist/package/src/views/base/redact-policy/index.vue +92 -0
  218. package/dist/package/src/views/base/redact-rule/index.vue +51 -0
  219. package/dist/package/src/views/base/role/index.vue +9 -9
  220. package/dist/package/src/views/base/runtime-config/index.vue +479 -0
  221. package/dist/package/src/views/base/tenant/index.vue +9 -9
  222. package/dist/package/src/views/base/user/components/dept-tree.vue +1 -1
  223. package/dist/package/src/views/base/user/index.vue +86 -47
  224. package/dist/package/src/views/message/inbox/index.vue +38 -11
  225. package/dist/package/src/views/profile/components/base.vue +84 -8
  226. package/dist/package/src/views/profile/components/password.vue +2 -228
  227. package/dist/package/src/views/profile/components/security.vue +3 -3
  228. package/dist/package/src/views/profile/components/session.vue +10 -2
  229. package/dist/package/src/views/profile/index.vue +10 -9
  230. package/dist/package/src/views/tool/api-doc/index.vue +3 -3
  231. package/dist/package/src/views/tool/cache/index.vue +352 -0
  232. package/dist/package/src/views/tool/code-gen/code-preview/index.vue +4 -4
  233. package/dist/package/src/views/tool/code-gen/columns/index.vue +16 -16
  234. package/dist/package/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue +2 -2
  235. package/dist/package/src/views/tool/code-gen/components/CodeGenProgressDialog.vue +2 -2
  236. package/dist/package/src/views/tool/code-gen/config.ts +2 -0
  237. package/dist/package/src/views/tool/code-gen/preview/index.vue +9 -9
  238. package/dist/package/src/views/tool/code-gen/proto/index.vue +10 -12
  239. package/dist/package/src/views/tool/code-gen/table/index.vue +71 -15
  240. package/dist/package/src/views/tool/ops-monitoring/index.vue +31 -96
  241. package/dist/package/src/views/tool/project-doc/index.vue +2 -2
  242. package/dist/package/src/views/tool/runtime-log/index.vue +6 -6
  243. package/package.json +7 -2
  244. package/dist/package/declarations/src/api/system/base_audit_log.d.ts +0 -55
  245. package/dist/package/declarations/src/api/system/base_dict.d.ts +0 -32
  246. package/dist/package/declarations/src/api/system/base_login_policy.d.ts +0 -10
  247. package/dist/package/declarations/src/components/auditLog.d.ts +0 -9
  248. package/dist/package/declarations/src/rpc/system/admin/v1/base_audit_log.d.ts +0 -640
  249. package/dist/package/src/api/base/notification.ts +0 -69
  250. package/dist/package/src/api/system/base_audit_log.ts +0 -168
  251. package/dist/package/src/api/system/base_login_policy.ts +0 -32
  252. package/dist/package/src/components/AuditLogTable.vue +0 -105
  253. package/dist/package/src/components/auditLog.ts +0 -46
  254. package/dist/package/src/rpc/system/admin/v1/base_audit_log.ts +0 -737
  255. /package/dist/package/declarations/src/api/base/{ai_message.d.ts → v1/ai_message.d.ts} +0 -0
  256. /package/dist/package/declarations/src/api/base/{ai_session.d.ts → v1/ai_session.d.ts} +0 -0
  257. /package/dist/package/declarations/src/api/base/{ai_tool.d.ts → v1/ai_tool.d.ts} +0 -0
  258. /package/dist/package/declarations/src/api/base/{oauth.d.ts → v1/oauth.d.ts} +0 -0
  259. /package/dist/package/declarations/src/api/base/{sse.d.ts → v1/sse.d.ts} +0 -0
  260. /package/dist/package/declarations/src/api/system/{auth.d.ts → admin/v1/auth.d.ts} +0 -0
  261. /package/dist/package/declarations/src/api/system/{base_api.d.ts → admin/v1/base_api.d.ts} +0 -0
  262. /package/dist/package/declarations/src/api/system/{base_dashboard.d.ts → admin/v1/base_dashboard.d.ts} +0 -0
  263. /package/dist/package/declarations/src/api/system/{base_dept.d.ts → admin/v1/base_dept.d.ts} +0 -0
  264. /package/dist/package/declarations/src/api/system/{base_file.d.ts → admin/v1/base_file.d.ts} +0 -0
  265. /package/dist/package/declarations/src/api/system/{base_i18n.d.ts → admin/v1/base_i18n.d.ts} +0 -0
  266. /package/dist/package/declarations/src/api/system/{base_menu.d.ts → admin/v1/base_menu.d.ts} +0 -0
  267. /package/dist/package/declarations/src/api/system/{base_message.d.ts → admin/v1/base_message.d.ts} +0 -0
  268. /package/dist/package/declarations/src/api/system/{base_message_category.d.ts → admin/v1/base_message_category.d.ts} +0 -0
  269. /package/dist/package/declarations/src/api/system/{base_migration.d.ts → admin/v1/base_migration.d.ts} +0 -0
  270. /package/dist/package/declarations/src/api/system/{base_post.d.ts → admin/v1/base_post.d.ts} +0 -0
  271. /package/dist/package/declarations/src/api/system/{base_role.d.ts → admin/v1/base_role.d.ts} +0 -0
  272. /package/dist/package/declarations/src/api/system/{base_session.d.ts → admin/v1/base_session.d.ts} +0 -0
  273. /package/dist/package/declarations/src/api/system/{base_tenant.d.ts → admin/v1/base_tenant.d.ts} +0 -0
  274. /package/dist/package/declarations/src/api/system/{base_user.d.ts → admin/v1/base_user.d.ts} +0 -0
  275. /package/dist/package/declarations/src/api/system/{code_gen.d.ts → admin/v1/code_gen.d.ts} +0 -0
  276. /package/dist/package/declarations/src/api/system/{code_gen_column.d.ts → admin/v1/code_gen_column.d.ts} +0 -0
  277. /package/dist/package/declarations/src/api/system/{code_gen_proto.d.ts → admin/v1/code_gen_proto.d.ts} +0 -0
  278. /package/dist/package/declarations/src/api/system/{code_gen_table.d.ts → admin/v1/code_gen_table.d.ts} +0 -0
  279. /package/dist/package/declarations/src/api/system/{oauth_client.d.ts → admin/v1/oauth_client.d.ts} +0 -0
  280. /package/dist/package/declarations/src/api/system/{ops_monitoring.d.ts → admin/v1/ops_monitoring.d.ts} +0 -0
  281. /package/dist/package/declarations/src/api/system/{project_document.d.ts → admin/v1/project_document.d.ts} +0 -0
  282. /package/dist/package/declarations/src/api/system/{runtime_log.d.ts → admin/v1/runtime_log.d.ts} +0 -0
  283. /package/dist/package/src/api/base/{ai_message.ts → v1/ai_message.ts} +0 -0
  284. /package/dist/package/src/api/base/{ai_session.ts → v1/ai_session.ts} +0 -0
  285. /package/dist/package/src/api/base/{ai_tool.ts → v1/ai_tool.ts} +0 -0
  286. /package/dist/package/src/api/base/{oauth.ts → v1/oauth.ts} +0 -0
  287. /package/dist/package/src/api/base/{sse.ts → v1/sse.ts} +0 -0
  288. /package/dist/package/src/api/system/{auth.ts → admin/v1/auth.ts} +0 -0
  289. /package/dist/package/src/api/system/{base_api.ts → admin/v1/base_api.ts} +0 -0
  290. /package/dist/package/src/api/system/{base_dashboard.ts → admin/v1/base_dashboard.ts} +0 -0
  291. /package/dist/package/src/api/system/{base_dept.ts → admin/v1/base_dept.ts} +0 -0
  292. /package/dist/package/src/api/system/{base_file.ts → admin/v1/base_file.ts} +0 -0
  293. /package/dist/package/src/api/system/{base_i18n.ts → admin/v1/base_i18n.ts} +0 -0
  294. /package/dist/package/src/api/system/{base_menu.ts → admin/v1/base_menu.ts} +0 -0
  295. /package/dist/package/src/api/system/{base_migration.ts → admin/v1/base_migration.ts} +0 -0
  296. /package/dist/package/src/api/system/{base_post.ts → admin/v1/base_post.ts} +0 -0
  297. /package/dist/package/src/api/system/{base_role.ts → admin/v1/base_role.ts} +0 -0
  298. /package/dist/package/src/api/system/{base_session.ts → admin/v1/base_session.ts} +0 -0
  299. /package/dist/package/src/api/system/{base_tenant.ts → admin/v1/base_tenant.ts} +0 -0
  300. /package/dist/package/src/api/system/{base_user.ts → admin/v1/base_user.ts} +0 -0
  301. /package/dist/package/src/api/system/{code_gen.ts → admin/v1/code_gen.ts} +0 -0
  302. /package/dist/package/src/api/system/{code_gen_proto.ts → admin/v1/code_gen_proto.ts} +0 -0
  303. /package/dist/package/src/api/system/{oauth_client.ts → admin/v1/oauth_client.ts} +0 -0
  304. /package/dist/package/src/api/system/{ops_monitoring.ts → admin/v1/ops_monitoring.ts} +0 -0
  305. /package/dist/package/src/api/system/{project_document.ts → admin/v1/project_document.ts} +0 -0
  306. /package/dist/package/src/api/system/{runtime_log.ts → admin/v1/runtime_log.ts} +0 -0
@@ -0,0 +1,190 @@
1
+ <template>
2
+ <div class="table-box">
3
+ <ProTable ref="proTable" row-key="id" :columns="resolvedColumns" :request-api="requestTable" />
4
+
5
+ <ProDialog v-model="dialog.visible" :title="config.detailTitle" width="1280px" @close="handleCloseDialog">
6
+ <el-descriptions border :column="2" class="detail-container">
7
+ <el-descriptions-item v-for="field in config.detailFields" :key="field.key" :label="field.label" :span="field.span ?? 1">
8
+ <pre v-if="field.code" class="code-block">{{ formatField(field) }}</pre>
9
+ <span v-else>{{ formatField(field) }}</span>
10
+ </el-descriptions-item>
11
+ </el-descriptions>
12
+
13
+ <section v-if="config.trace && (traceLoading || traceItems.length > 0)" class="trace-section">
14
+ <h3>{{ t("system.base.log.trace.title") }}</h3>
15
+ <el-table v-loading="traceLoading" :data="traceItems" max-height="300" border>
16
+ <el-table-column :label="t('system.base.log.trace.log_type')" width="130">
17
+ <template #default="scope">{{ formatLogType(scope.row.log_type) }}</template>
18
+ </el-table-column>
19
+ <el-table-column prop="resource" :label="t('system.base.log.trace.resource')" min-width="280" show-overflow-tooltip />
20
+ <el-table-column prop="user_name" :label="t('system.base.log.field.user_name')" width="130" />
21
+ <el-table-column :label="t('system.base.log.field.result')" width="100">
22
+ <template #default="scope">{{ formatResult(scope.row.result) }}</template>
23
+ </el-table-column>
24
+ <el-table-column :label="t('system.base.log.trace.duration')" width="110" align="right">
25
+ <template #default="scope">{{ formatDuration(scope.row.duration_ms) }}</template>
26
+ </el-table-column>
27
+ <el-table-column prop="occurred_at" :label="t('system.base.log.field.occurred_at')" width="190" />
28
+ </el-table>
29
+ </section>
30
+
31
+ <template #footer>
32
+ <el-button @click="handleCloseDialog">{{ config.closeText }}</el-button>
33
+ </template>
34
+ </ProDialog>
35
+ </div>
36
+ </template>
37
+
38
+ <script setup lang="ts">
39
+ import { computed, reactive, ref, unref } from "vue";
40
+ import type { ColumnProps, EnumProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
41
+ import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
42
+ import ProDialog from "@liujitcn/kratos-admin-core/components/Dialog/ProDialog.vue";
43
+ import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
44
+ import { formatJson } from "@liujitcn/kratos-admin-core/format";
45
+ import { t } from "@liujitcn/kratos-admin-core";
46
+ import { BaseLogType, BaseLogResult } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_log";
47
+ import type { BaseLogTraceItem } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_log";
48
+ import { logEnumLabel } from "./log";
49
+
50
+ /** 审计详情字段配置。 */
51
+ export interface LogDetailField {
52
+ /** 详情对象中对应的字段名。 */
53
+ key: string;
54
+ /** 字段在详情弹窗中的显示名称。 */
55
+ label: string;
56
+ /** 字段占用的描述列数,未设置时使用一列。 */
57
+ span?: number;
58
+ /** 是否按格式化 JSON 的代码块展示。 */
59
+ code?: boolean;
60
+ /** 字段对应的枚举字典选项。 */
61
+ enum?: EnumProps[];
62
+ /** 字段自定义格式化函数。 */
63
+ format?: (value: unknown) => string;
64
+ }
65
+
66
+ /** 审计列表页面配置。 */
67
+ export interface LogTableConfig {
68
+ /** 审计列表表格的列定义。 */
69
+ columns: ColumnProps[];
70
+ /** 详情弹窗标题。 */
71
+ detailTitle: string;
72
+ /** 详情弹窗关闭按钮文案。 */
73
+ closeText: string;
74
+ /** 详情字段和展示格式定义。 */
75
+ detailFields: LogDetailField[];
76
+ /** 分页查询函数,返回列表和总数。 */
77
+ request: (params: Record<string, unknown>) => Promise<{ list: Record<string, unknown>[]; total: number }>;
78
+ /** 按日志编号读取详情。 */
79
+ get: (id: string) => Promise<Record<string, unknown>>;
80
+ /** 按请求编号和链路编号读取关联审计时间线。 */
81
+ trace?: (requestID: string, traceID: string) => Promise<BaseLogTraceItem[]>;
82
+ }
83
+
84
+ const props = defineProps<{ config: LogTableConfig }>();
85
+ const proTable = ref<ProTableInstance>();
86
+ const detail = reactive<Record<string, unknown>>({});
87
+ const dialog = reactive({ visible: false });
88
+ const traceItems = ref<BaseLogTraceItem[]>([]);
89
+ const traceLoading = ref(false);
90
+ const resolvedColumns = computed(() => unref(props.config.columns));
91
+
92
+ /** 请求审计日志分页数据。 */
93
+ async function requestTable(params: Record<string, unknown>) {
94
+ const result = await props.config.request(buildPageRequest(params));
95
+ return { data: { list: result.list, total: result.total } };
96
+ }
97
+
98
+ /** 打开审计详情弹窗。 */
99
+ async function handleOpenDialog(id: string) {
100
+ const value = await props.config.get(id);
101
+ Object.keys(detail).forEach(key => delete detail[key]);
102
+ Object.assign(detail, value);
103
+ dialog.visible = true;
104
+ traceItems.value = [];
105
+ const requestID = String(detail.request_id ?? "");
106
+ const traceID = String(detail.trace_id ?? "");
107
+ if (!props.config.trace || (!requestID && !traceID)) return;
108
+ traceLoading.value = true;
109
+ try {
110
+ traceItems.value = await props.config.trace(requestID, traceID);
111
+ } catch {
112
+ traceItems.value = [];
113
+ } finally {
114
+ traceLoading.value = false;
115
+ }
116
+ }
117
+
118
+ /** 关闭并清理审计详情弹窗。 */
119
+ function handleCloseDialog() {
120
+ dialog.visible = false;
121
+ Object.keys(detail).forEach(key => delete detail[key]);
122
+ traceItems.value = [];
123
+ traceLoading.value = false;
124
+ }
125
+
126
+ /** 格式化详情字段,JSON 内容使用统一脱敏展示格式。 */
127
+ function formatField(field: LogDetailField) {
128
+ const value = detail[field.key];
129
+ if (value === undefined || value === null || value === "") return t("common.value.none");
130
+ if (field.enum) return logEnumLabel(field.enum, value, t("common.value.unknown"));
131
+ if (field.format) return field.format(value);
132
+ if (field.code) return formatJson(String(value));
133
+ return String(value);
134
+ }
135
+
136
+ /** 格式化关联日志耗时。 */
137
+ function formatDuration(value: unknown) {
138
+ const duration = Number(value);
139
+ return duration > 0 ? `${duration} ms` : t("common.value.none");
140
+ }
141
+
142
+ /** 格式化关联审计日志类型。 */
143
+ function formatLogType(value: BaseLogType) {
144
+ const keys: Partial<Record<BaseLogType, string>> = {
145
+ [BaseLogType.BASE_LOG_TYPE_LOGIN]: "system.base.log.trace.type.login",
146
+ [BaseLogType.BASE_LOG_TYPE_API]: "system.base.log.trace.type.api",
147
+ [BaseLogType.BASE_LOG_TYPE_OPERATION]: "system.base.log.trace.type.operation",
148
+ [BaseLogType.BASE_LOG_TYPE_DATA_ACCESS]: "system.base.log.trace.type.data_access",
149
+ [BaseLogType.BASE_LOG_TYPE_PERMISSION]: "system.base.log.trace.type.permission",
150
+ [BaseLogType.BASE_LOG_TYPE_POLICY_EVALUATION]: "system.base.log.trace.type.policy"
151
+ };
152
+ return t(keys[value] ?? "system.base.log.trace.type.unknown");
153
+ }
154
+
155
+ /** 格式化关联审计结果。 */
156
+ function formatResult(value: BaseLogResult) {
157
+ const keys: Partial<Record<BaseLogResult, string>> = {
158
+ [BaseLogResult.BASE_LOG_RESULT_SUCCESS]: "system.base.log.result.success",
159
+ [BaseLogResult.BASE_LOG_RESULT_FAILURE]: "system.base.log.result.failure",
160
+ [BaseLogResult.BASE_LOG_RESULT_ERROR]: "system.base.log.result.error"
161
+ };
162
+ return t(keys[value] ?? "system.base.log.result.unspecified");
163
+ }
164
+
165
+ defineExpose({ handleOpenDialog, proTable });
166
+ </script>
167
+
168
+ <style scoped>
169
+ .detail-container {
170
+ width: 100%;
171
+ }
172
+
173
+ .code-block {
174
+ max-height: 360px;
175
+ margin: 0;
176
+ overflow: auto;
177
+ white-space: pre-wrap;
178
+ word-break: break-word;
179
+ }
180
+
181
+ .trace-section {
182
+ margin-top: 20px;
183
+ }
184
+
185
+ .trace-section h3 {
186
+ margin: 0 0 12px;
187
+ font-size: 15px;
188
+ font-weight: 600;
189
+ }
190
+ </style>
@@ -1,5 +1,12 @@
1
1
  <template>
2
- <el-popover placement="bottom-end" :width="360" trigger="click" @show="refresh">
2
+ <el-popover
3
+ v-bind="$attrs"
4
+ v-model:visible="popoverVisible"
5
+ placement="bottom-end"
6
+ :width="360"
7
+ trigger="click"
8
+ @show="refresh"
9
+ >
3
10
  <template #reference>
4
11
  <el-badge class="notification-trigger" :value="badgeValue" :hidden="unreadTotal === 0" :max="99">
5
12
  <el-icon :size="24"><Bell /></el-icon>
@@ -17,7 +24,7 @@
17
24
  class="notification-item"
18
25
  :class="{ 'is-unread': !item.read_at }"
19
26
  type="button"
20
- @click="openInbox"
27
+ @click="openNotification(item)"
21
28
  >
22
29
  <span class="notification-category-icon" :style="{ color: item.category_color || undefined }" aria-hidden="true">
23
30
  <component :is="resolveNotificationIcon(item.category_icon)" />
@@ -31,24 +38,65 @@
31
38
  <el-button class="notification-more" text @click="openInbox">{{ t("system.notification.action.view_all") }}</el-button>
32
39
  </div>
33
40
  </el-popover>
41
+ <ProDialog v-model="detailVisible" :title="detail?.title" width="720px" destroy-on-close :show-footer="false">
42
+ <div v-if="detail" class="notification-detail">
43
+ <div class="notification-detail-meta">
44
+ <span class="notification-detail-category" :style="{ color: detail.category_color || undefined }">
45
+ <component :is="resolveNotificationIcon(detail.category_icon)" />
46
+ <span>{{ detail.category_name }}</span>
47
+ </span>
48
+ <span>{{ detail.sender_name }}</span>
49
+ <span>{{ detail.received_at }}</span>
50
+ </div>
51
+ <RichTextPreview
52
+ v-if="detail.content_format === MessageContentFormat.MESSAGE_CONTENT_FORMAT_RICH_TEXT"
53
+ class="notification-detail-content"
54
+ :model-value="detail.content"
55
+ />
56
+ <pre v-else class="notification-detail-content">{{ detail.content }}</pre>
57
+ <el-button
58
+ v-if="detail.action_type === MessageActionType.MESSAGE_ACTION_TYPE_VIEW_KEY && actionRouteName"
59
+ type="primary"
60
+ @click="openAction"
61
+ >
62
+ {{ t("common.action.view") }}
63
+ </el-button>
64
+ </div>
65
+ </ProDialog>
34
66
  </template>
35
67
 
36
68
  <script setup lang="ts">
37
69
  import { computed, onBeforeUnmount, onMounted, ref } from "vue";
38
70
  import { useRouter } from "vue-router";
39
71
  import { t } from "@liujitcn/kratos-admin-core";
40
- import { defNotificationService } from "@liujitcn/kratos-admin-system/api/base/notification";
41
- import { subscribeSseEvent, type SseStop } from "@liujitcn/kratos-admin-system/api/base/sse";
72
+ import ProDialog from "@liujitcn/kratos-admin-core/components/Dialog/ProDialog.vue";
73
+ import RichTextPreview from "@liujitcn/kratos-admin-core/components/RichTextPreview/index.vue";
74
+ import { defNotificationService } from "@liujitcn/kratos-admin-system/api/base/v1/notification";
75
+ import { subscribeSseEvent, type SseStop } from "@liujitcn/kratos-admin-system/api/base/v1/sse";
42
76
  import type { Notification } from "@liujitcn/kratos-admin-system/rpc/base/v1/notification";
43
- import { NotificationView } from "@liujitcn/kratos-admin-system/rpc/base/v1/notification";
77
+ import {
78
+ MessageActionType,
79
+ MessageContentFormat,
80
+ NotificationView
81
+ } from "@liujitcn/kratos-admin-system/rpc/base/v1/notification";
44
82
 
45
83
  const router = useRouter();
84
+ const popoverVisible = ref(false);
46
85
  const unreadTotal = ref(0);
47
86
  const latestDeliveryID = ref(0);
48
87
  const notifications = ref<Notification[]>([]);
88
+ const detailVisible = ref(false);
89
+ const detail = ref<Notification>();
49
90
  let stopSse: SseStop | undefined;
50
91
 
92
+ defineOptions({ name: "Notification", inheritAttrs: false });
93
+
51
94
  const badgeValue = computed(() => Math.min(unreadTotal.value, 99));
95
+ const actionRouteName = computed(() => {
96
+ const viewKey = detail.value?.action_target;
97
+ if (!viewKey) return "";
98
+ return ({ MESSAGE_INBOX: "NotificationInbox", PROFILE: "Profile", AI: "AiChat" } as Record<string, string>)[viewKey] ?? "";
99
+ });
52
100
  const notificationIcons = {
53
101
  Bell,
54
102
  Calendar,
@@ -88,7 +136,7 @@ onBeforeUnmount(() => stopSse?.());
88
136
  async function refresh() {
89
137
  const [summary, page] = await Promise.all([
90
138
  defNotificationService.GetNotificationSummary({}),
91
- defNotificationService.PageNotification({ view: NotificationView.NOTIFICATION_VIEW_INBOX, category_id: undefined, priority: undefined, cursor_id: 0, page_num: 1, page_size: 5 })
139
+ defNotificationService.PageNotification({ view: NotificationView.NOTIFICATION_VIEW_UNREAD, category_id: undefined, priority: undefined, cursor_id: 0, page_num: 1, page_size: 5 })
92
140
  ]);
93
141
  unreadTotal.value = summary.unread_total;
94
142
  latestDeliveryID.value = summary.latest_delivery_id;
@@ -102,12 +150,34 @@ async function markAllRead() {
102
150
  await refresh();
103
151
  }
104
152
 
153
+ /** 打开下拉消息详情并标记消息为已读。 */
154
+ async function openNotification(row: Notification) {
155
+ popoverVisible.value = false;
156
+ const wasUnread = !row.read_at;
157
+ const [notification] = await Promise.all([
158
+ defNotificationService.GetNotification({ id: row.id }),
159
+ wasUnread ? defNotificationService.MarkNotificationRead({ ids: [row.id] }) : Promise.resolve()
160
+ ]);
161
+ detail.value = notification;
162
+ detailVisible.value = true;
163
+ notifications.value = notifications.value.filter(item => item.id !== row.id);
164
+ if (wasUnread) unreadTotal.value = Math.max(0, unreadTotal.value - 1);
165
+ }
166
+
105
167
  /** 打开完整收件箱。 */
106
168
  function openInbox() {
169
+ popoverVisible.value = false;
107
170
  void router.push({ name: "NotificationInbox" });
108
171
  }
109
172
 
110
- /** 解析收件箱分类图标,兼容历史数据中的未知图标名。 */
173
+ /** 执行通知携带的稳定 viewKey 动作。 */
174
+ function openAction() {
175
+ if (!actionRouteName.value) return;
176
+ detailVisible.value = false;
177
+ void router.push({ name: actionRouteName.value });
178
+ }
179
+
180
+ /** 解析收件箱分类图标,未知图标使用默认图标。 */
111
181
  function resolveNotificationIcon(icon: string) {
112
182
  return notificationIcons[icon as keyof typeof notificationIcons] ?? CollectionTag;
113
183
  }
@@ -193,4 +263,39 @@ function resolveNotificationIcon(icon: string) {
193
263
  width: 100%;
194
264
  margin-top: 8px;
195
265
  }
266
+
267
+ .notification-detail-meta {
268
+ display: flex;
269
+ flex-wrap: wrap;
270
+ gap: 16px;
271
+ margin-bottom: 18px;
272
+ color: var(--el-text-color-secondary);
273
+ }
274
+
275
+ .notification-detail-category {
276
+ display: inline-flex;
277
+ gap: 6px;
278
+ align-items: center;
279
+ line-height: 18px;
280
+ }
281
+
282
+ .notification-detail-category > svg {
283
+ flex: 0 0 18px;
284
+ width: 18px;
285
+ height: 18px;
286
+ }
287
+
288
+ .notification-detail-content {
289
+ min-height: 180px;
290
+ margin: 0 0 16px;
291
+ color: var(--el-text-color-primary);
292
+ font-family: inherit;
293
+ line-height: 1.7;
294
+ overflow-wrap: anywhere;
295
+ white-space: pre-wrap;
296
+ }
297
+
298
+ .notification-detail-content.core-rich-text-preview {
299
+ white-space: normal;
300
+ }
196
301
  </style>
@@ -1,4 +1,4 @@
1
- import { getEnabledBaseLanguages } from "@liujitcn/kratos-admin-system/api/system/base_language";
1
+ import { getEnabledBaseLanguages } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_language";
2
2
  import type { I18nTargetType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
3
3
 
4
4
  /** DynamicI18nValue 动态资源单语言翻译编辑状态。 */
@@ -11,12 +11,9 @@ export interface DynamicI18nValue {
11
11
 
12
12
  /** DynamicI18nRecord 描述三类动态资源翻译共有字段。 */
13
13
  export interface DynamicI18nRecord extends Omit<DynamicI18nValue, "text"> {
14
- target_type?: I18nTargetType;
15
- target_id?: number;
16
- name?: string;
17
- /** 兼容旧接口缓存中的字段名。 */
18
- title?: string;
19
- label?: string;
14
+ target_type: I18nTargetType;
15
+ target_id: number;
16
+ name: string;
20
17
  }
21
18
 
22
19
  /** DynamicLanguageOption 动态翻译编辑器显示的语言选项。 */
@@ -43,7 +40,6 @@ export function getLanguageLabel(locale: string): string {
43
40
  /** normalizeDynamicI18ns 将后端翻译记录补齐为全部非主语言编辑状态。 */
44
41
  export function normalizeDynamicI18ns(
45
42
  records: DynamicI18nRecord[] | undefined,
46
- _textField: "title" | "name" | "label",
47
43
  locales: string[] = getEditableLanguageOptions().map(item => item.value)
48
44
  ): DynamicI18nValue[] {
49
45
  return locales.map(locale => {
@@ -51,7 +47,7 @@ export function normalizeDynamicI18ns(
51
47
  return {
52
48
  id: record?.id ?? 0,
53
49
  locale,
54
- text: String(record?.name ?? record?.[_textField] ?? "")
50
+ text: String(record?.name ?? "")
55
51
  };
56
52
  });
57
53
  }
@@ -0,0 +1,87 @@
1
+ import type { ColumnProps, EnumProps, SearchProps } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
2
+ import { defBaseLogService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_log";
3
+ import type { BaseLogTraceItem } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_log";
4
+
5
+ /** 根据枚举值生成表格筛选项。 */
6
+ export function createLogEnumOptions(items: Array<[number, string]>): EnumProps[] {
7
+ return items.map(([value, label]) => ({ value, label }));
8
+ }
9
+
10
+ /** 根据枚举值查找展示文案。 */
11
+ export function logEnumLabel(options: EnumProps[], value: unknown, fallback = ""): string {
12
+ return options.find(item => item.value === value)?.label ?? (fallback || String(value ?? ""));
13
+ }
14
+
15
+ /** 格式化日志 HTTP 状态码并补充状态语义。 */
16
+ export function formatLogStatusCode(value: unknown, t: (key: string) => string): string {
17
+ const code = Number(value);
18
+ if (!Number.isInteger(code)) return t("common.value.unknown");
19
+
20
+ let statusKey = "system.base.log.status.other";
21
+ if (code >= 200 && code < 300) statusKey = "system.base.log.status.success";
22
+ else if (code >= 400 && code < 500) statusKey = "system.base.log.status.client_error";
23
+ else if (code >= 500 && code < 600) statusKey = "system.base.log.status.server_error";
24
+ return `${code} (${t(statusKey)})`;
25
+ }
26
+
27
+ /** 格式化日志耗时,零值表示未采集。 */
28
+ export function formatLogDuration(value: unknown, t: (key: string) => string): string {
29
+ const duration = Number(value);
30
+ if (!Number.isFinite(duration) || duration <= 0) return t("common.value.none");
31
+ return `${duration} ms`;
32
+ }
33
+
34
+ /** 格式化日志字节数,保留零字节结果。 */
35
+ export function formatLogBytes(value: unknown, t: (key: string) => string): string {
36
+ const size = Number(value);
37
+ if (!Number.isFinite(size) || size < 0) return t("common.value.none");
38
+ return `${size} B`;
39
+ }
40
+
41
+ /** 格式化日志数量并补充记录单位。 */
42
+ export function formatLogCount(value: unknown, t: (key: string) => string): string {
43
+ const count = Number(value);
44
+ if (!Number.isFinite(count) || count < 0) return t("common.value.none");
45
+ return `${count} ${t("system.base.log.unit.records")}`;
46
+ }
47
+
48
+ /** 创建审计日志时间范围筛选项。 */
49
+ export function logDateSearch(t: (key: string) => string): SearchProps {
50
+ return {
51
+ el: "date-picker",
52
+ props: {
53
+ type: "daterange",
54
+ editable: false,
55
+ class: "!w-[240px]",
56
+ rangeSeparator: "~",
57
+ startPlaceholder: t("common.placeholder.start_date"),
58
+ endPlaceholder: t("common.placeholder.end_date"),
59
+ valueFormat: "YYYY-MM-DD"
60
+ }
61
+ };
62
+ }
63
+
64
+ /** 创建审计日志详情按钮列。 */
65
+ export function logDetailColumn(label: string, onClick: (id: string) => void): ColumnProps {
66
+ return {
67
+ prop: "detailAction",
68
+ label,
69
+ width: 100,
70
+ fixed: "right",
71
+ cellType: "actions",
72
+ actions: [
73
+ {
74
+ label,
75
+ type: "primary",
76
+ link: true,
77
+ onClick: scope => onClick(String(scope.row.id))
78
+ }
79
+ ]
80
+ };
81
+ }
82
+
83
+ /** 查询同一请求或链路关联的审计时间线。 */
84
+ export async function requestLogTrace(requestID: string, traceID: string): Promise<BaseLogTraceItem[]> {
85
+ const response = await defBaseLogService.GetBaseLogTrace({ request_id: requestID, trace_id: traceID });
86
+ return response.items;
87
+ }
@@ -0,0 +1,26 @@
1
+ import { Document } from "@element-plus/icons-vue";
2
+ import type { RuntimeConfigDefinition } from "./types";
3
+
4
+ /** 日志入库回退配置模型。 */
5
+ export interface BaseLogFallbackConfig {
6
+ file_path: string;
7
+ }
8
+
9
+ /** 日志入库回退配置定义。 */
10
+ export const baseLogFallbackConfig: RuntimeConfigDefinition<BaseLogFallbackConfig> = {
11
+ key: "baseLogFallback",
12
+ titleKey: "system.base.runtime_config.base_log_fallback.title",
13
+ descriptionKey: "system.base.runtime_config.base_log_fallback.description",
14
+ icon: Document,
15
+ createModel: () => ({
16
+ file_path: "./logs/base-log-fallback"
17
+ }),
18
+ fields: [
19
+ {
20
+ prop: "file_path",
21
+ labelKey: "system.base.runtime_config.base_log_fallback.field.file_path",
22
+ component: "input",
23
+ rules: [{ required: true, messageKey: "system.base.runtime_config.base_log_fallback.validation.file_path", trigger: "blur" }]
24
+ }
25
+ ]
26
+ };
@@ -0,0 +1,57 @@
1
+ import { Coin } from "@element-plus/icons-vue";
2
+ import type { RuntimeConfigDefinition } from "./types";
3
+
4
+ /** 数据库备份配置模型。 */
5
+ export interface DatabaseBackupConfig {
6
+ enabled: boolean;
7
+ integrity_key: string;
8
+ encryption_key: string;
9
+ directory: string;
10
+ gzip: boolean;
11
+ retention_count: number;
12
+ }
13
+
14
+ /** 数据库备份配置定义。 */
15
+ export const databaseBackupConfig: RuntimeConfigDefinition<DatabaseBackupConfig> = {
16
+ key: "databaseBackup",
17
+ titleKey: "system.base.runtime_config.backup.title",
18
+ descriptionKey: "system.base.runtime_config.backup.description",
19
+ icon: Coin,
20
+ createModel: () => ({
21
+ enabled: false,
22
+ integrity_key: "",
23
+ encryption_key: "",
24
+ directory: "./backups",
25
+ gzip: true,
26
+ retention_count: 7
27
+ }),
28
+ fields: [
29
+ { prop: "enabled", labelKey: "system.base.runtime_config.field.enabled", component: "switch" },
30
+ {
31
+ prop: "integrity_key",
32
+ labelKey: "system.base.runtime_config.field.integrity_key",
33
+ component: "password",
34
+ props: { showPassword: true, autocomplete: "new-password" }
35
+ },
36
+ {
37
+ prop: "encryption_key",
38
+ labelKey: "system.base.runtime_config.field.encryption_key",
39
+ component: "password",
40
+ props: { showPassword: true, autocomplete: "new-password" }
41
+ },
42
+ {
43
+ prop: "directory",
44
+ labelKey: "system.base.runtime_config.field.directory",
45
+ component: "input",
46
+ rules: [{ required: true, messageKey: "system.base.runtime_config.validation.directory", trigger: "blur" }]
47
+ },
48
+ { prop: "gzip", labelKey: "system.base.runtime_config.field.gzip", component: "switch" },
49
+ {
50
+ prop: "retention_count",
51
+ labelKey: "system.base.runtime_config.field.retention_count",
52
+ component: "input-number",
53
+ props: { min: 1, max: 1000, controls: true },
54
+ rules: [{ type: "number", min: 1, messageKey: "system.base.runtime_config.validation.retention_count", trigger: "blur" }]
55
+ }
56
+ ]
57
+ };
@@ -0,0 +1,26 @@
1
+ import { shallowReactive } from "vue";
2
+ import type { RuntimeConfigDefinition } from "./types";
3
+
4
+ import { baseLogFallbackConfig } from "./base-log-fallback";
5
+
6
+ export { baseLogFallbackConfig } from "./base-log-fallback";
7
+ export type {
8
+ RuntimeConfigDefinition,
9
+ RuntimeConfigField,
10
+ RuntimeConfigMessageArg,
11
+ RuntimeConfigModel,
12
+ RuntimeConfigRule
13
+ } from "./types";
14
+
15
+ /** Admin 内置运行配置定义集合。 */
16
+ export const runtimeConfigDefinitions = shallowReactive<RuntimeConfigDefinition[]>([
17
+ baseLogFallbackConfig
18
+ ]);
19
+
20
+ /** 注册外部业务模块提供的运行配置定义。 */
21
+ export function registerRuntimeConfig(definition: RuntimeConfigDefinition) {
22
+ if (runtimeConfigDefinitions.some(item => item.key === definition.key)) {
23
+ throw new Error(`Runtime config key already registered: ${definition.key}`);
24
+ }
25
+ runtimeConfigDefinitions.push(definition);
26
+ }
@@ -0,0 +1,59 @@
1
+ import type { FormItemRule } from "element-plus";
2
+ import type { Component } from "vue";
3
+ import type { ProFormComponentType, ProFormField } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
4
+
5
+ /** 运行配置表单模型。 */
6
+ export type RuntimeConfigModel = Record<string, any>;
7
+
8
+ /** 运行配置国际化参数值。 */
9
+ export type RuntimeConfigMessageArg = string | number | boolean | { key: string };
10
+
11
+ /** 运行配置字段校验规则。 */
12
+ export interface RuntimeConfigRule {
13
+ /** 国际化消息键。 */
14
+ messageKey: string;
15
+ /** 国际化消息参数。 */
16
+ messageArgs?: Record<string, RuntimeConfigMessageArg>;
17
+ /** Element Plus 校验触发方式。 */
18
+ trigger?: FormItemRule["trigger"];
19
+ /** 其他 Element Plus 校验参数。 */
20
+ [key: string]: unknown;
21
+ }
22
+
23
+ /** 运行配置字段定义。 */
24
+ export interface RuntimeConfigField {
25
+ /** 字段路径。 */
26
+ prop: string;
27
+ /** 字段标题国际化消息键。 */
28
+ labelKey: string;
29
+ /** ProForm 控件类型。 */
30
+ component: ProFormComponentType;
31
+ /** 控件参数。 */
32
+ props?: ProFormField["props"];
33
+ /** 表单项参数。 */
34
+ itemProps?: ProFormField["itemProps"];
35
+ /** 选择项。 */
36
+ options?: ProFormField["options"];
37
+ /** 字段提示国际化消息键。 */
38
+ labelTooltipKey?: string;
39
+ /** 字段是否可见。 */
40
+ visible?: ProFormField["visible"];
41
+ /** 字段校验规则。 */
42
+ rules?: RuntimeConfigRule[];
43
+ }
44
+
45
+ /** 管理端运行配置定义。 */
46
+ export interface RuntimeConfigDefinition<T extends RuntimeConfigModel = RuntimeConfigModel> {
47
+ /** 配置稳定键。 */
48
+ key: string;
49
+ /** 配置名称国际化消息键。 */
50
+ titleKey: string;
51
+ /** 配置说明国际化消息键。 */
52
+ descriptionKey: string;
53
+ /** 配置项导航图标。 */
54
+ icon: Component;
55
+ /** 创建表单默认模型。 */
56
+ createModel: () => T;
57
+ /** 配置字段集合。 */
58
+ fields: RuntimeConfigField[];
59
+ }
@@ -14,11 +14,12 @@
14
14
  | 命名空间 | 文案范围 | 主要使用位置 |
15
15
  | --- | --- | --- |
16
16
  | `common.*` | 跨页面复用的操作、字段、弹窗、状态和校验文案。 | `src/views/**` 下的列表页、表单和确认弹窗。 |
17
- | `system.ai.*` | AI 会话、消息流、重试和错误提示。 | `src/views/ai/**`、`src/api/base/ai_message.ts`。 |
17
+ | `system.ai.*` | AI 会话、消息流、重试和错误提示。 | `src/views/ai/**`、`src/api/base/v1/ai_message.ts`。 |
18
18
  | `system.profile.*` | 个人资料、安全设置和用户中心导航。 | `src/views/profile/**`、`src/module.ts` 的用户菜单。 |
19
19
  | `system.base.*` | 区域、配置、部门、字典、岗位、角色、租户、用户等基础管理页面。 | `src/views/base/**`。 |
20
20
  | `system.base.oauth_client.*` | 开放授权客户端字段、凭据和 API 选择。 | `src/views/base/oauth-client/**`。 |
21
21
  | `system.code.gen.*` | 代码生成配置、预览、列配置和多语言编辑。 | `src/views/tool/code-gen/**`。 |
22
+ | `system.cache.*` | 运行时缓存查询、分页结果和条目详情。 | `src/views/tool/cache/**`。 |
22
23
  | `system.i18n.*` | 动态翻译编辑、草稿生成和语言包状态。 | `src/components/DynamicI18nEditor.vue`、代码生成语言编辑组件。 |
23
24
 
24
25
  语言包由生成的 `generated.ts` 传入 `systemAdminModule.messages`,由 core 的 `registerLocaleMessages` 校验语言键集合、命名空间和占位符后注册到 Vue I18n;业务代码统一使用 `t('system....')` 或 `useLocaleStore()` 读取。