@liujitcn/kratos-admin-system 0.0.29 → 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 (332) hide show
  1. package/README.md +46 -15
  2. package/dist/package/declarations/src/api/base/v1/notification.d.ts +26 -0
  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_dashboard.d.ts +14 -0
  7. package/dist/package/declarations/src/api/system/admin/v1/base_data_access_log.d.ts +10 -0
  8. package/dist/package/declarations/src/api/system/admin/v1/base_dict.d.ts +20 -0
  9. package/dist/package/declarations/src/api/system/admin/v1/base_dict_item.d.ts +18 -0
  10. package/dist/package/declarations/src/api/system/admin/v1/base_file.d.ts +13 -0
  11. package/dist/package/declarations/src/api/system/{base_job.d.ts → admin/v1/base_job.d.ts} +4 -5
  12. package/dist/package/declarations/src/api/system/admin/v1/base_job_log.d.ts +9 -0
  13. package/dist/package/declarations/src/api/system/{base_language.d.ts → admin/v1/base_language.d.ts} +3 -3
  14. package/dist/package/declarations/src/api/system/admin/v1/base_log.d.ts +8 -0
  15. package/dist/package/declarations/src/api/system/admin/v1/base_login_log.d.ts +10 -0
  16. package/dist/package/declarations/src/api/system/admin/v1/base_login_policy.d.ts +19 -0
  17. package/dist/package/declarations/src/api/system/admin/v1/base_message.d.ts +24 -0
  18. package/dist/package/declarations/src/api/system/admin/v1/base_message_category.d.ts +21 -0
  19. package/dist/package/declarations/src/api/system/admin/v1/base_operation_log.d.ts +10 -0
  20. package/dist/package/declarations/src/api/system/admin/v1/base_permission_log.d.ts +10 -0
  21. package/dist/package/declarations/src/api/system/admin/v1/base_policy_evaluation_log.d.ts +10 -0
  22. package/dist/package/declarations/src/api/system/admin/v1/base_session.d.ts +11 -0
  23. package/dist/package/declarations/src/api/system/admin/v1/base_table_archive.d.ts +20 -0
  24. package/dist/package/declarations/src/api/system/admin/v1/base_table_archive_record.d.ts +11 -0
  25. package/dist/package/declarations/src/api/system/admin/v1/base_table_archive_restore.d.ts +14 -0
  26. package/dist/package/declarations/src/api/system/admin/v1/base_table_backup.d.ts +20 -0
  27. package/dist/package/declarations/src/api/system/admin/v1/base_table_backup_record.d.ts +11 -0
  28. package/dist/package/declarations/src/api/system/admin/v1/base_table_backup_restore.d.ts +14 -0
  29. package/dist/package/declarations/src/api/system/admin/v1/base_table_source.d.ts +11 -0
  30. package/dist/package/declarations/src/api/system/admin/v1/cache.d.ts +7 -0
  31. package/dist/package/declarations/src/api/system/admin/v1/oauth_client.d.ts +24 -0
  32. package/dist/package/declarations/src/api/system/base_redact_field.d.ts +20 -0
  33. package/dist/package/declarations/src/api/system/base_redact_policy.d.ts +19 -0
  34. package/dist/package/declarations/src/api/system/base_redact_rule.d.ts +22 -0
  35. package/dist/package/declarations/src/components/DynamicI18nCell.vue.d.ts +5 -1
  36. package/dist/package/declarations/src/components/ForcedPasswordDialog.vue.d.ts +3 -0
  37. package/dist/package/declarations/src/components/LogTable.vue.d.ts +52 -0
  38. package/dist/package/declarations/src/components/Notification.vue.d.ts +3 -0
  39. package/dist/package/declarations/src/components/dynamicI18n.d.ts +4 -7
  40. package/dist/package/declarations/src/components/log.d.ts +20 -0
  41. package/dist/package/declarations/src/config/base-log-fallback.d.ts +7 -0
  42. package/dist/package/declarations/src/config/database-backup.d.ts +12 -0
  43. package/dist/package/declarations/src/config/index.d.ts +7 -0
  44. package/dist/package/declarations/src/config/types.d.ts +56 -0
  45. package/dist/package/declarations/src/locales/generated.d.ts +1968 -88
  46. package/dist/package/declarations/src/rpc/base/v1/login.d.ts +151 -0
  47. package/dist/package/declarations/src/rpc/base/v1/notification.d.ts +306 -0
  48. package/dist/package/declarations/src/rpc/base/v1/oauth.d.ts +25 -0
  49. package/dist/package/declarations/src/rpc/base/v1/oauth_client.d.ts +23 -0
  50. package/dist/package/declarations/src/rpc/system/admin/v1/auth.d.ts +13 -0
  51. package/dist/package/declarations/src/rpc/system/admin/v1/base_api.d.ts +2 -0
  52. package/dist/package/declarations/src/rpc/system/admin/v1/base_api_log.d.ts +84 -0
  53. package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +38 -0
  54. package/dist/package/declarations/src/rpc/system/admin/v1/base_dashboard.d.ts +60 -0
  55. package/dist/package/declarations/src/rpc/system/admin/v1/base_data_access_log.d.ts +112 -0
  56. package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +0 -101
  57. package/dist/package/declarations/src/rpc/system/admin/v1/base_dict_item.d.ts +107 -0
  58. package/dist/package/declarations/src/rpc/system/admin/v1/base_file.d.ts +73 -0
  59. package/dist/package/declarations/src/rpc/system/admin/v1/base_i18n.d.ts +10 -6
  60. package/dist/package/declarations/src/rpc/system/admin/v1/base_job.d.ts +10 -56
  61. package/dist/package/declarations/src/rpc/system/admin/v1/base_job_log.d.ts +60 -0
  62. package/dist/package/declarations/src/rpc/system/admin/v1/base_log.d.ts +66 -76
  63. package/dist/package/declarations/src/rpc/system/admin/v1/base_login_log.d.ts +92 -0
  64. package/dist/package/declarations/src/rpc/system/admin/v1/base_login_policy.d.ts +179 -0
  65. package/dist/package/declarations/src/rpc/system/admin/v1/base_message.d.ts +193 -0
  66. package/dist/package/declarations/src/rpc/system/admin/v1/base_message_category.d.ts +125 -0
  67. package/dist/package/declarations/src/rpc/system/admin/v1/base_operation_log.d.ts +106 -0
  68. package/dist/package/declarations/src/rpc/system/admin/v1/base_permission_log.d.ts +118 -0
  69. package/dist/package/declarations/src/rpc/system/admin/v1/base_policy_evaluation_log.d.ts +119 -0
  70. package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_common.d.ts +9 -0
  71. package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_field.d.ts +161 -0
  72. package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_policy.d.ts +150 -0
  73. package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_rule.d.ts +111 -0
  74. package/dist/package/declarations/src/rpc/system/admin/v1/base_session.d.ts +33 -0
  75. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_archive.d.ts +90 -0
  76. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_archive_record.d.ts +82 -0
  77. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_archive_restore.d.ts +76 -0
  78. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_backup.d.ts +74 -0
  79. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_backup_record.d.ts +69 -0
  80. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_backup_restore.d.ts +76 -0
  81. package/dist/package/declarations/src/rpc/system/admin/v1/base_table_source.d.ts +16 -0
  82. package/dist/package/declarations/src/rpc/system/admin/v1/base_user.d.ts +18 -3
  83. package/dist/package/declarations/src/rpc/system/admin/v1/cache.d.ts +47 -0
  84. package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_column.d.ts +2 -0
  85. package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_table.d.ts +8 -0
  86. package/dist/package/declarations/src/rpc/system/admin/v1/oauth_client.d.ts +145 -0
  87. package/dist/package/declarations/src/rpc/system/common/v1/common.d.ts +26 -0
  88. package/dist/package/declarations/src/rpc/system/config/v1/system_config.d.ts +8 -0
  89. package/dist/package/declarations/src/{api/system → utils}/code_gen_i18n.d.ts +1 -2
  90. package/dist/package/declarations/src/{api/system → utils}/code_gen_sse.d.ts +1 -1
  91. package/dist/package/declarations/src/utils/notification-response.d.ts +5 -0
  92. package/dist/package/declarations/src/{api/system → utils}/ops_monitoring_sse.d.ts +1 -1
  93. package/dist/package/declarations/src/{api/system → utils}/runtime_log_sse.d.ts +1 -1
  94. package/dist/package/declarations/src/views/base/api-log/index.vue.d.ts +3 -0
  95. package/dist/package/declarations/src/views/base/backup-management/archive-config/index.vue.d.ts +3 -0
  96. package/dist/package/declarations/src/views/base/backup-management/archive-record/index.vue.d.ts +3 -0
  97. package/dist/package/declarations/src/views/base/backup-management/archive-restore/index.vue.d.ts +3 -0
  98. package/dist/package/declarations/src/views/base/backup-management/backup-config/index.vue.d.ts +3 -0
  99. package/dist/package/declarations/src/views/base/backup-management/backup-record/index.vue.d.ts +3 -0
  100. package/dist/package/declarations/src/views/base/backup-management/backup-restore/index.vue.d.ts +3 -0
  101. package/dist/package/declarations/src/views/base/dashboard/index.vue.d.ts +3 -0
  102. package/dist/package/declarations/src/views/base/data-access-log/index.vue.d.ts +3 -0
  103. package/dist/package/declarations/src/views/base/file/index.vue.d.ts +3 -0
  104. package/dist/package/declarations/src/views/base/login-log/index.vue.d.ts +3 -0
  105. package/dist/package/declarations/src/views/base/login-policy/format.d.ts +2 -0
  106. package/dist/package/declarations/src/views/base/login-policy/index.vue.d.ts +3 -0
  107. package/dist/package/declarations/src/views/base/message/index.vue.d.ts +3 -0
  108. package/dist/package/declarations/src/views/base/message-category/index.vue.d.ts +3 -0
  109. package/dist/package/declarations/src/views/base/oauth-client/index.vue.d.ts +3 -0
  110. package/dist/package/declarations/src/views/base/operation-log/index.vue.d.ts +3 -0
  111. package/dist/package/declarations/src/views/base/permission-log/index.vue.d.ts +3 -0
  112. package/dist/package/declarations/src/views/base/policy-evaluation-log/index.vue.d.ts +3 -0
  113. package/dist/package/declarations/src/views/base/redact-field/index.vue.d.ts +3 -0
  114. package/dist/package/declarations/src/views/base/redact-policy/index.vue.d.ts +3 -0
  115. package/dist/package/declarations/src/views/base/redact-rule/index.vue.d.ts +3 -0
  116. package/dist/package/declarations/src/views/base/runtime-config/index.vue.d.ts +3 -0
  117. package/dist/package/declarations/src/views/message/inbox/index.vue.d.ts +3 -0
  118. package/dist/package/declarations/src/views/profile/components/session.vue.d.ts +3 -0
  119. package/dist/package/declarations/src/views/tool/cache/index.vue.d.ts +3 -0
  120. package/dist/package/src/api/base/v1/notification.ts +99 -0
  121. package/dist/package/src/api/base/{sse.ts → v1/sse.ts} +4 -4
  122. package/dist/package/src/api/system/{auth.ts → admin/v1/auth.ts} +1 -0
  123. package/dist/package/src/api/system/admin/v1/base_api_log.ts +33 -0
  124. package/dist/package/src/api/system/{base_area.ts → admin/v1/base_area.ts} +1 -1
  125. package/dist/package/src/api/system/{base_config.ts → admin/v1/base_config.ts} +20 -0
  126. package/dist/package/src/api/system/admin/v1/base_dashboard.ts +55 -0
  127. package/dist/package/src/api/system/admin/v1/base_data_access_log.ts +33 -0
  128. package/dist/package/src/api/system/{base_dict.ts → admin/v1/base_dict.ts} +0 -60
  129. package/dist/package/src/api/system/admin/v1/base_dict_item.ts +72 -0
  130. package/dist/package/src/api/system/admin/v1/base_file.ts +43 -0
  131. package/dist/package/src/api/system/{base_job.ts → admin/v1/base_job.ts} +11 -22
  132. package/dist/package/src/api/system/admin/v1/base_job_log.ts +32 -0
  133. package/dist/package/src/api/system/{base_language.ts → admin/v1/base_language.ts} +3 -3
  134. package/dist/package/src/api/system/admin/v1/base_log.ts +23 -0
  135. package/dist/package/src/api/system/admin/v1/base_login_log.ts +33 -0
  136. package/dist/package/src/api/system/admin/v1/base_login_policy.ts +67 -0
  137. package/dist/package/src/api/system/admin/v1/base_message.ts +90 -0
  138. package/dist/package/src/api/system/admin/v1/base_message_category.ts +80 -0
  139. package/dist/package/src/api/system/admin/v1/base_operation_log.ts +33 -0
  140. package/dist/package/src/api/system/admin/v1/base_permission_log.ts +33 -0
  141. package/dist/package/src/api/system/admin/v1/base_policy_evaluation_log.ts +33 -0
  142. package/dist/package/src/api/system/admin/v1/base_session.ts +33 -0
  143. package/dist/package/src/api/system/admin/v1/base_table_archive.ts +70 -0
  144. package/dist/package/src/api/system/admin/v1/base_table_archive_record.ts +33 -0
  145. package/dist/package/src/api/system/admin/v1/base_table_archive_restore.ts +44 -0
  146. package/dist/package/src/api/system/admin/v1/base_table_backup.ts +70 -0
  147. package/dist/package/src/api/system/admin/v1/base_table_backup_record.ts +33 -0
  148. package/dist/package/src/api/system/admin/v1/base_table_backup_restore.ts +44 -0
  149. package/dist/package/src/api/system/admin/v1/base_table_source.ts +33 -0
  150. package/dist/package/src/api/system/admin/v1/cache.ts +22 -0
  151. package/dist/package/src/api/system/{code_gen_column.ts → admin/v1/code_gen_column.ts} +19 -3
  152. package/dist/package/src/api/system/{code_gen_table.ts → admin/v1/code_gen_table.ts} +13 -4
  153. package/dist/package/src/api/system/admin/v1/oauth_client.ts +102 -0
  154. package/dist/package/src/api/system/base_redact_field.ts +25 -0
  155. package/dist/package/src/api/system/base_redact_policy.ts +24 -0
  156. package/dist/package/src/api/system/base_redact_rule.ts +27 -0
  157. package/dist/package/src/components/Ai.vue +1 -1
  158. package/dist/package/src/components/ChangePasswordForm.vue +143 -0
  159. package/dist/package/src/components/DynamicI18nCell.vue +28 -8
  160. package/dist/package/src/components/DynamicI18nEditor.vue +1 -1
  161. package/dist/package/src/components/ForcedPasswordDialog.vue +40 -0
  162. package/dist/package/src/components/LogTable.vue +190 -0
  163. package/dist/package/src/components/Notification.vue +301 -0
  164. package/dist/package/src/components/dynamicI18n.ts +5 -9
  165. package/dist/package/src/components/log.ts +87 -0
  166. package/dist/package/src/config/base-log-fallback.ts +26 -0
  167. package/dist/package/src/config/database-backup.ts +57 -0
  168. package/dist/package/src/config/index.ts +26 -0
  169. package/dist/package/src/config/types.ts +59 -0
  170. package/dist/package/src/locales/README.md +6 -3
  171. package/dist/package/src/locales/en-US.json +511 -29
  172. package/dist/package/src/locales/ja-JP.json +515 -33
  173. package/dist/package/src/locales/zh-CN.json +511 -29
  174. package/dist/package/src/locales/zh-TW.json +514 -32
  175. package/dist/package/src/module.ts +7 -2
  176. package/dist/package/src/rpc/base/v1/login.ts +174 -0
  177. package/dist/package/src/rpc/base/v1/notification.ts +343 -0
  178. package/dist/package/src/rpc/base/v1/oauth.ts +25 -0
  179. package/dist/package/src/rpc/base/v1/oauth_client.ts +33 -0
  180. package/dist/package/src/rpc/system/admin/v1/auth.ts +13 -0
  181. package/dist/package/src/rpc/system/admin/v1/base_api.ts +2 -0
  182. package/dist/package/src/rpc/system/admin/v1/base_api_log.ts +102 -0
  183. package/dist/package/src/rpc/system/admin/v1/base_config.ts +42 -0
  184. package/dist/package/src/rpc/system/admin/v1/base_dashboard.ts +81 -0
  185. package/dist/package/src/rpc/system/admin/v1/base_data_access_log.ts +135 -0
  186. package/dist/package/src/rpc/system/admin/v1/base_dict.ts +0 -112
  187. package/dist/package/src/rpc/system/admin/v1/base_dict_item.ts +126 -0
  188. package/dist/package/src/rpc/system/admin/v1/base_file.ts +88 -0
  189. package/dist/package/src/rpc/system/admin/v1/base_i18n.ts +10 -6
  190. package/dist/package/src/rpc/system/admin/v1/base_job.ts +10 -62
  191. package/dist/package/src/rpc/system/admin/v1/base_job_log.ts +75 -0
  192. package/dist/package/src/rpc/system/admin/v1/base_log.ts +67 -78
  193. package/dist/package/src/rpc/system/admin/v1/base_login_log.ts +113 -0
  194. package/dist/package/src/rpc/system/admin/v1/base_login_policy.ts +212 -0
  195. package/dist/package/src/rpc/system/admin/v1/base_message.ts +236 -0
  196. package/dist/package/src/rpc/system/admin/v1/base_message_category.ts +149 -0
  197. package/dist/package/src/rpc/system/admin/v1/base_operation_log.ts +127 -0
  198. package/dist/package/src/rpc/system/admin/v1/base_permission_log.ts +142 -0
  199. package/dist/package/src/rpc/system/admin/v1/base_policy_evaluation_log.ts +143 -0
  200. package/dist/package/src/rpc/system/admin/v1/base_redact_common.ts +17 -0
  201. package/dist/package/src/rpc/system/admin/v1/base_redact_field.ts +182 -0
  202. package/dist/package/src/rpc/system/admin/v1/base_redact_policy.ts +174 -0
  203. package/dist/package/src/rpc/system/admin/v1/base_redact_rule.ts +131 -0
  204. package/dist/package/src/rpc/system/admin/v1/base_session.ts +44 -0
  205. package/dist/package/src/rpc/system/admin/v1/base_table_archive.ts +109 -0
  206. package/dist/package/src/rpc/system/admin/v1/base_table_archive_record.ts +95 -0
  207. package/dist/package/src/rpc/system/admin/v1/base_table_archive_restore.ts +93 -0
  208. package/dist/package/src/rpc/system/admin/v1/base_table_backup.ts +91 -0
  209. package/dist/package/src/rpc/system/admin/v1/base_table_backup_record.ts +82 -0
  210. package/dist/package/src/rpc/system/admin/v1/base_table_backup_restore.ts +91 -0
  211. package/dist/package/src/rpc/system/admin/v1/base_table_source.ts +26 -0
  212. package/dist/package/src/rpc/system/admin/v1/base_user.ts +18 -3
  213. package/dist/package/src/rpc/system/admin/v1/cache.ts +59 -0
  214. package/dist/package/src/rpc/system/admin/v1/code_gen_column.ts +2 -0
  215. package/dist/package/src/rpc/system/admin/v1/code_gen_table.ts +8 -0
  216. package/dist/package/src/rpc/system/admin/v1/oauth_client.ts +174 -0
  217. package/dist/package/src/rpc/system/common/v1/common.ts +35 -0
  218. package/dist/package/src/rpc/system/config/v1/system_config.ts +16 -0
  219. package/dist/package/src/{api/system → utils}/code_gen_i18n.ts +1 -1
  220. package/dist/package/src/{api/system → utils}/code_gen_sse.ts +1 -1
  221. package/dist/package/src/utils/notification-response.ts +22 -0
  222. package/dist/package/src/{api/system → utils}/ops_monitoring_sse.ts +1 -1
  223. package/dist/package/src/{api/system → utils}/runtime_log_sse.ts +1 -1
  224. package/dist/package/src/views/ai/chat/components/AiMarkdown.vue +1 -1
  225. package/dist/package/src/views/ai/chat/components/ChatPanel.vue +4 -6
  226. package/dist/package/src/views/ai/chat/components/XSender.vue +1 -1
  227. package/dist/package/src/views/ai/chat/index.vue +3 -3
  228. package/dist/package/src/views/ai/chat/message.ts +2 -3
  229. package/dist/package/src/views/base/api/index.vue +4 -4
  230. package/dist/package/src/views/base/api-log/index.vue +94 -0
  231. package/dist/package/src/views/base/area/index.vue +1 -1
  232. package/dist/package/src/views/base/backup-management/archive-config/index.vue +151 -0
  233. package/dist/package/src/views/base/backup-management/archive-record/index.vue +44 -0
  234. package/dist/package/src/views/base/backup-management/archive-restore/index.vue +59 -0
  235. package/dist/package/src/views/base/backup-management/backup-config/index.vue +119 -0
  236. package/dist/package/src/views/base/backup-management/backup-record/index.vue +41 -0
  237. package/dist/package/src/views/base/backup-management/backup-restore/index.vue +66 -0
  238. package/dist/package/src/views/base/config/index.vue +19 -28
  239. package/dist/package/src/views/base/dashboard/index.vue +202 -0
  240. package/dist/package/src/views/base/data-access-log/index.vue +96 -0
  241. package/dist/package/src/views/base/dept/index.vue +11 -11
  242. package/dist/package/src/views/base/dict/index.vue +7 -7
  243. package/dist/package/src/views/base/dict/item.vue +14 -14
  244. package/dist/package/src/views/base/file/index.vue +323 -0
  245. package/dist/package/src/views/base/job/index.vue +63 -8
  246. package/dist/package/src/views/base/job/log.vue +38 -11
  247. package/dist/package/src/views/base/language/index.vue +3 -2
  248. package/dist/package/src/views/base/login-log/index.vue +96 -0
  249. package/dist/package/src/views/base/login-policy/format.ts +4 -0
  250. package/dist/package/src/views/base/login-policy/index.vue +530 -0
  251. package/dist/package/src/views/base/menu/index.vue +19 -19
  252. package/dist/package/src/views/base/message/index.vue +712 -0
  253. package/dist/package/src/views/base/message-category/index.vue +387 -0
  254. package/dist/package/src/views/base/migration/index.vue +2 -2
  255. package/dist/package/src/views/base/oauth-client/index.vue +421 -0
  256. package/dist/package/src/views/base/operation-log/index.vue +86 -0
  257. package/dist/package/src/views/base/permission-log/index.vue +90 -0
  258. package/dist/package/src/views/base/policy-evaluation-log/index.vue +93 -0
  259. package/dist/package/src/views/base/post/index.vue +11 -11
  260. package/dist/package/src/views/base/redact-field/index.vue +59 -0
  261. package/dist/package/src/views/base/redact-policy/index.vue +92 -0
  262. package/dist/package/src/views/base/redact-rule/index.vue +51 -0
  263. package/dist/package/src/views/base/role/index.vue +9 -9
  264. package/dist/package/src/views/base/runtime-config/index.vue +479 -0
  265. package/dist/package/src/views/base/tenant/index.vue +9 -9
  266. package/dist/package/src/views/base/user/components/dept-tree.vue +1 -1
  267. package/dist/package/src/views/base/user/index.vue +86 -47
  268. package/dist/package/src/views/message/inbox/index.vue +276 -0
  269. package/dist/package/src/views/profile/components/base.vue +90 -13
  270. package/dist/package/src/views/profile/components/password.vue +3 -229
  271. package/dist/package/src/views/profile/components/security.vue +477 -64
  272. package/dist/package/src/views/profile/components/session.vue +161 -0
  273. package/dist/package/src/views/profile/index.vue +45 -31
  274. package/dist/package/src/views/tool/api-doc/index.vue +3 -3
  275. package/dist/package/src/views/tool/cache/index.vue +352 -0
  276. package/dist/package/src/views/tool/code-gen/code-preview/index.vue +4 -4
  277. package/dist/package/src/views/tool/code-gen/columns/index.vue +16 -16
  278. package/dist/package/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue +2 -2
  279. package/dist/package/src/views/tool/code-gen/components/CodeGenProgressDialog.vue +2 -2
  280. package/dist/package/src/views/tool/code-gen/config.ts +3 -0
  281. package/dist/package/src/views/tool/code-gen/preview/index.vue +9 -9
  282. package/dist/package/src/views/tool/code-gen/proto/index.vue +10 -12
  283. package/dist/package/src/views/tool/code-gen/table/index.vue +71 -15
  284. package/dist/package/src/views/tool/ops-monitoring/index.vue +55 -116
  285. package/dist/package/src/views/tool/project-doc/index.vue +2 -2
  286. package/dist/package/src/views/tool/runtime-log/index.vue +6 -6
  287. package/package.json +7 -2
  288. package/dist/package/declarations/src/api/system/base_dict.d.ts +0 -32
  289. package/dist/package/declarations/src/api/system/base_log.d.ts +0 -9
  290. package/dist/package/src/api/system/base_log.ts +0 -32
  291. package/dist/package/src/views/base/log/index.vue +0 -339
  292. /package/dist/package/declarations/src/api/base/{ai_message.d.ts → v1/ai_message.d.ts} +0 -0
  293. /package/dist/package/declarations/src/api/base/{ai_session.d.ts → v1/ai_session.d.ts} +0 -0
  294. /package/dist/package/declarations/src/api/base/{ai_tool.d.ts → v1/ai_tool.d.ts} +0 -0
  295. /package/dist/package/declarations/src/api/base/{oauth.d.ts → v1/oauth.d.ts} +0 -0
  296. /package/dist/package/declarations/src/api/base/{sse.d.ts → v1/sse.d.ts} +0 -0
  297. /package/dist/package/declarations/src/api/system/{auth.d.ts → admin/v1/auth.d.ts} +0 -0
  298. /package/dist/package/declarations/src/api/system/{base_api.d.ts → admin/v1/base_api.d.ts} +0 -0
  299. /package/dist/package/declarations/src/api/system/{base_dept.d.ts → admin/v1/base_dept.d.ts} +0 -0
  300. /package/dist/package/declarations/src/api/system/{base_i18n.d.ts → admin/v1/base_i18n.d.ts} +0 -0
  301. /package/dist/package/declarations/src/api/system/{base_menu.d.ts → admin/v1/base_menu.d.ts} +0 -0
  302. /package/dist/package/declarations/src/api/system/{base_migration.d.ts → admin/v1/base_migration.d.ts} +0 -0
  303. /package/dist/package/declarations/src/api/system/{base_post.d.ts → admin/v1/base_post.d.ts} +0 -0
  304. /package/dist/package/declarations/src/api/system/{base_role.d.ts → admin/v1/base_role.d.ts} +0 -0
  305. /package/dist/package/declarations/src/api/system/{base_tenant.d.ts → admin/v1/base_tenant.d.ts} +0 -0
  306. /package/dist/package/declarations/src/api/system/{base_user.d.ts → admin/v1/base_user.d.ts} +0 -0
  307. /package/dist/package/declarations/src/api/system/{code_gen.d.ts → admin/v1/code_gen.d.ts} +0 -0
  308. /package/dist/package/declarations/src/api/system/{code_gen_column.d.ts → admin/v1/code_gen_column.d.ts} +0 -0
  309. /package/dist/package/declarations/src/api/system/{code_gen_proto.d.ts → admin/v1/code_gen_proto.d.ts} +0 -0
  310. /package/dist/package/declarations/src/api/system/{code_gen_table.d.ts → admin/v1/code_gen_table.d.ts} +0 -0
  311. /package/dist/package/declarations/src/api/system/{ops_monitoring.d.ts → admin/v1/ops_monitoring.d.ts} +0 -0
  312. /package/dist/package/declarations/src/api/system/{project_document.d.ts → admin/v1/project_document.d.ts} +0 -0
  313. /package/dist/package/declarations/src/api/system/{runtime_log.d.ts → admin/v1/runtime_log.d.ts} +0 -0
  314. /package/dist/package/declarations/src/{views/base/log/index.vue.d.ts → components/ChangePasswordForm.vue.d.ts} +0 -0
  315. /package/dist/package/src/api/base/{ai_message.ts → v1/ai_message.ts} +0 -0
  316. /package/dist/package/src/api/base/{ai_session.ts → v1/ai_session.ts} +0 -0
  317. /package/dist/package/src/api/base/{ai_tool.ts → v1/ai_tool.ts} +0 -0
  318. /package/dist/package/src/api/base/{oauth.ts → v1/oauth.ts} +0 -0
  319. /package/dist/package/src/api/system/{base_api.ts → admin/v1/base_api.ts} +0 -0
  320. /package/dist/package/src/api/system/{base_dept.ts → admin/v1/base_dept.ts} +0 -0
  321. /package/dist/package/src/api/system/{base_i18n.ts → admin/v1/base_i18n.ts} +0 -0
  322. /package/dist/package/src/api/system/{base_menu.ts → admin/v1/base_menu.ts} +0 -0
  323. /package/dist/package/src/api/system/{base_migration.ts → admin/v1/base_migration.ts} +0 -0
  324. /package/dist/package/src/api/system/{base_post.ts → admin/v1/base_post.ts} +0 -0
  325. /package/dist/package/src/api/system/{base_role.ts → admin/v1/base_role.ts} +0 -0
  326. /package/dist/package/src/api/system/{base_tenant.ts → admin/v1/base_tenant.ts} +0 -0
  327. /package/dist/package/src/api/system/{base_user.ts → admin/v1/base_user.ts} +0 -0
  328. /package/dist/package/src/api/system/{code_gen.ts → admin/v1/code_gen.ts} +0 -0
  329. /package/dist/package/src/api/system/{code_gen_proto.ts → admin/v1/code_gen_proto.ts} +0 -0
  330. /package/dist/package/src/api/system/{ops_monitoring.ts → admin/v1/ops_monitoring.ts} +0 -0
  331. /package/dist/package/src/api/system/{project_document.ts → admin/v1/project_document.ts} +0 -0
  332. /package/dist/package/src/api/system/{runtime_log.ts → admin/v1/runtime_log.ts} +0 -0
@@ -0,0 +1,421 @@
1
+ <!-- 开放授权客户端管理 -->
2
+ <template>
3
+ <div class="table-box">
4
+ <ProTable
5
+ ref="proTable"
6
+ row-key="id"
7
+ :columns="columns"
8
+ :header-actions="headerActions"
9
+ :request-api="requestOauthClientTable"
10
+ />
11
+
12
+ <FormDialog
13
+ v-model="dialog.visible"
14
+ ref="formDialogRef"
15
+ :title="t(dialog.titleKey)"
16
+ width="960px"
17
+ :model="formData"
18
+ :fields="formFields"
19
+ :rules="rules"
20
+ @confirm="handleSubmit"
21
+ @close="handleCloseDialog"
22
+ />
23
+ </div>
24
+ </template>
25
+
26
+ <script setup lang="ts">
27
+ import { computed, onMounted, reactive, ref } from "vue";
28
+ import type { ColumnProps, HeaderActionProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
29
+ import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
30
+ import FormDialog from "@liujitcn/kratos-admin-core/components/Dialog/FormDialog.vue";
31
+ import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
32
+ import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
33
+ import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
34
+ import { t } from "@liujitcn/kratos-admin-core";
35
+ import { copyText } from "@liujitcn/kratos-admin-core/security";
36
+ import { defOauthClientService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/oauth_client";
37
+ import { defBaseTenantService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_tenant";
38
+ import type { BaseApi } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_api";
39
+ import {
40
+ OauthClientCryptoType,
41
+ type OauthClient,
42
+ type OauthClientForm,
43
+ type PageOauthClientRequest
44
+ } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/oauth_client";
45
+ import type { SelectOptionResponse_Option } from "@liujitcn/kratos-admin-system/rpc/common/v1/common";
46
+ import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
47
+ import { useUserStore } from "@liujitcn/kratos-admin-core/stores/runtime";
48
+ import { DEFAULT_TENANT_CODE, requestTenantOptions } from "@liujitcn/kratos-admin-core/tenant";
49
+
50
+ /** 开放授权客户端表单状态,新增时租户保持未选择。 */
51
+ type OauthClientFormState = Omit<OauthClientForm, "tenant_id"> & {
52
+ /** 绑定租户ID。 */
53
+ tenant_id?: number;
54
+ };
55
+
56
+ defineOptions({
57
+ name: "OauthClient",
58
+ inheritAttrs: false
59
+ });
60
+
61
+ const { BUTTONS } = useAuthButtons();
62
+ const userStore = useUserStore();
63
+ const isDefaultTenant = computed(() => userStore.userInfo.tenant_code === DEFAULT_TENANT_CODE);
64
+ const proTable = ref<ProTableInstance>();
65
+ const formDialogRef = ref<InstanceType<typeof FormDialog>>();
66
+ const apiOptions = ref<BaseApi[]>([]);
67
+ const tenantOptions = ref<SelectOptionResponse_Option[]>([]);
68
+
69
+ const dialog = reactive({
70
+ titleKey: "common.action.create",
71
+ visible: false
72
+ });
73
+
74
+ const formData = reactive<OauthClientFormState>({
75
+ id: 0,
76
+ tenant_id: undefined,
77
+ client_name: "",
78
+ crypto_type: OauthClientCryptoType.OAUTH_CLIENT_CRYPTO_TYPE_SM4,
79
+ ip_whitelist: "",
80
+ api: [],
81
+ status: Status.STATUS_ENABLE
82
+ });
83
+
84
+ onMounted(() => {
85
+ void loadTenantOptions();
86
+ });
87
+
88
+ const cryptoOptions = computed<ProFormOption[]>(() => [
89
+ { label: "SM4-GCM", value: OauthClientCryptoType.OAUTH_CLIENT_CRYPTO_TYPE_SM4 },
90
+ { label: "AES-GCM", value: OauthClientCryptoType.OAUTH_CLIENT_CRYPTO_TYPE_AES }
91
+ ]);
92
+
93
+ const statusOptions = computed<ProFormOption[]>(() => [
94
+ { label: t("common.status.enabled"), value: Status.STATUS_ENABLE },
95
+ { label: t("common.status.disabled"), value: Status.STATUS_DISABLE }
96
+ ]);
97
+
98
+ const transferOptions = computed<ProFormOption[]>(() =>
99
+ apiOptions.value.map(item => ({
100
+ value: item.operation,
101
+ label: item.operation
102
+ }))
103
+ );
104
+
105
+ const tenantNameMap = computed(() => new Map(tenantOptions.value.map(item => [item.value, item.label])));
106
+
107
+ const rules = computed(() => ({
108
+ tenant_id: [
109
+ {
110
+ required: isDefaultTenant.value,
111
+ message: t("common.validation.required_select", { field: t("common.field.tenant") }),
112
+ trigger: "change"
113
+ }
114
+ ],
115
+ client_name: [
116
+ {
117
+ required: true,
118
+ message: t("common.validation.required_input", { field: t("system.base.oauth_client.field.client_name") }),
119
+ trigger: "blur"
120
+ },
121
+ {
122
+ max: 100,
123
+ message: t("common.validation.max_length", { field: t("system.base.oauth_client.field.client_name"), max: 100 }),
124
+ trigger: "blur"
125
+ }
126
+ ],
127
+ crypto_type: [
128
+ {
129
+ required: true,
130
+ message: t("common.validation.required_select", { field: t("system.base.oauth_client.field.crypto_type") }),
131
+ trigger: "change"
132
+ }
133
+ ],
134
+ status: [
135
+ { required: true, message: t("common.validation.required_select", { field: t("common.field.status") }), trigger: "change" }
136
+ ]
137
+ }));
138
+
139
+ const formFields = computed<ProFormField[]>(() => [
140
+ {
141
+ prop: "tenant_id",
142
+ label: t("common.field.tenant"),
143
+ component: "select",
144
+ props: {
145
+ filterable: true,
146
+ disabled: Boolean(formData.id),
147
+ placeholder: t("common.placeholder.select")
148
+ },
149
+ options: tenantOptions.value,
150
+ visible: () => isDefaultTenant.value
151
+ },
152
+ {
153
+ prop: "client_name",
154
+ label: t("system.base.oauth_client.field.client_name"),
155
+ component: "input"
156
+ },
157
+ {
158
+ prop: "crypto_type",
159
+ label: t("system.base.oauth_client.field.crypto_type"),
160
+ component: "select",
161
+ options: cryptoOptions.value
162
+ },
163
+ {
164
+ prop: "ip_whitelist",
165
+ label: t("system.base.oauth_client.field.ip_whitelist"),
166
+ component: "textarea",
167
+ props: { rows: 2 },
168
+ colSpan: 24
169
+ },
170
+ {
171
+ prop: "api",
172
+ label: t("system.base.oauth_client.field.api"),
173
+ component: "transfer",
174
+ options: transferOptions.value,
175
+ props: {
176
+ filterable: true,
177
+ titles: [t("system.base.oauth_client.value.available_api"), t("system.base.oauth_client.value.selected_api")],
178
+ style: { width: "100%" }
179
+ },
180
+ colSpan: 24
181
+ },
182
+ { prop: "status", label: t("common.field.status"), component: "radio-group", options: statusOptions.value }
183
+ ]);
184
+
185
+ const columns = computed<ColumnProps[]>(() => [
186
+ { type: "selection", width: 55 },
187
+ ...(isDefaultTenant.value
188
+ ? ([
189
+ {
190
+ prop: "tenant_id",
191
+ label: t("common.field.tenant"),
192
+ minWidth: 130,
193
+ search: { el: "select", key: "tenant_id", props: { filterable: true }, order: 1 },
194
+ enum: requestTenantOptions,
195
+ render: scope =>
196
+ tenantNameMap.value.get((scope.row as OauthClient).tenant_id) ?? String((scope.row as OauthClient).tenant_id)
197
+ }
198
+ ] satisfies ColumnProps[])
199
+ : []),
200
+ { prop: "client_id", label: t("system.base.oauth_client.field.client_id"), minWidth: 220 },
201
+ { prop: "client_name", label: t("system.base.oauth_client.field.client_name"), minWidth: 160, search: { el: "input" } },
202
+ {
203
+ prop: "crypto_type",
204
+ label: t("system.base.oauth_client.field.crypto_type"),
205
+ width: 110,
206
+ render: scope => formatCrypto((scope.row as OauthClient).crypto_type)
207
+ },
208
+ {
209
+ prop: "ip_whitelist",
210
+ label: t("system.base.oauth_client.field.ip_whitelist"),
211
+ minWidth: 180,
212
+ render: scope => (scope.row as OauthClient).ip_whitelist || t("common.value.none")
213
+ },
214
+ {
215
+ prop: "api",
216
+ label: t("system.base.oauth_client.field.api"),
217
+ width: 90,
218
+ render: scope => String((scope.row as OauthClient).api?.length ?? 0)
219
+ },
220
+ {
221
+ prop: "status",
222
+ label: t("common.field.status"),
223
+ width: 110,
224
+ search: { el: "select", enum: statusOptions.value },
225
+ cellType: "status",
226
+ statusProps: {
227
+ activeValue: Status.STATUS_ENABLE,
228
+ inactiveValue: Status.STATUS_DISABLE,
229
+ activeText: t("common.status.enabled"),
230
+ inactiveText: t("common.status.disabled"),
231
+ disabled: () => !BUTTONS.value["base:oauth-client:status"],
232
+ beforeChange: scope => handleSetStatus(scope.row as OauthClient)
233
+ }
234
+ },
235
+ {
236
+ prop: "operation",
237
+ label: t("common.field.operation"),
238
+ width: 280,
239
+ fixed: "right",
240
+ cellType: "actions",
241
+ actions: [
242
+ {
243
+ label: t("system.base.oauth_client.action.copy_credentials"),
244
+ type: "primary",
245
+ link: true,
246
+ icon: CopyDocument,
247
+ hidden: () => !BUTTONS.value["base:oauth-client:credentials"],
248
+ onClick: scope => handleCopyCredentials(scope.row as OauthClient)
249
+ },
250
+ {
251
+ label: t("common.action.edit"),
252
+ link: true,
253
+ icon: EditPen,
254
+ hidden: () => !BUTTONS.value["base:oauth-client:update"],
255
+ onClick: scope => handleOpenDialog((scope.row as OauthClient).id)
256
+ },
257
+ {
258
+ label: t("common.action.delete"),
259
+ type: "danger",
260
+ link: true,
261
+ icon: Delete,
262
+ hidden: () => !BUTTONS.value["base:oauth-client:delete"],
263
+ onClick: scope => handleDelete(scope.row as OauthClient)
264
+ }
265
+ ]
266
+ }
267
+ ]);
268
+
269
+ const headerActions = computed<HeaderActionProps[]>(() => [
270
+ {
271
+ label: t("common.action.create"),
272
+ type: "success",
273
+ icon: CirclePlus,
274
+ hidden: () => !BUTTONS.value["base:oauth-client:create"],
275
+ onClick: () => handleOpenDialog()
276
+ },
277
+ {
278
+ label: t("common.action.delete"),
279
+ type: "danger",
280
+ icon: Delete,
281
+ hidden: () => !BUTTONS.value["base:oauth-client:delete"],
282
+ disabled: scope => !scope.selectedList.length,
283
+ onClick: scope => handleDelete(scope.selectedList as OauthClient[])
284
+ }
285
+ ]);
286
+
287
+ async function requestOauthClientTable(params: PageOauthClientRequest) {
288
+ const data = await defOauthClientService.PageOauthClient(buildPageRequest(params));
289
+ return { data: { list: data.oauth_clients ?? [], total: data.total } };
290
+ }
291
+
292
+ async function loadApiOptions() {
293
+ const data = await defOauthClientService.OptionOauthClientApi({});
294
+ apiOptions.value = data.base_apis ?? [];
295
+ }
296
+
297
+ async function loadTenantOptions() {
298
+ if (userStore.userInfo.tenant_code !== DEFAULT_TENANT_CODE || tenantOptions.value.length) return;
299
+ const data = await defBaseTenantService.OptionBaseTenant({ keyword: "" });
300
+ tenantOptions.value = data.list ?? [];
301
+ }
302
+
303
+ async function handleOpenDialog(id?: number) {
304
+ await loadTenantOptions();
305
+ await loadApiOptions();
306
+ resetForm();
307
+ dialog.titleKey = id ? "common.action.edit" : "common.action.create";
308
+ dialog.visible = true;
309
+ if (id) Object.assign(formData, await defOauthClientService.GetOauthClient({ id }));
310
+ }
311
+
312
+ function resetForm() {
313
+ formDialogRef.value?.resetFields();
314
+ formDialogRef.value?.clearValidate();
315
+ Object.assign(formData, {
316
+ id: 0,
317
+ tenant_id: undefined,
318
+ client_name: "",
319
+ crypto_type: OauthClientCryptoType.OAUTH_CLIENT_CRYPTO_TYPE_SM4,
320
+ ip_whitelist: "",
321
+ api: [],
322
+ status: Status.STATUS_ENABLE
323
+ });
324
+ }
325
+
326
+ function handleCloseDialog() {
327
+ dialog.visible = false;
328
+ resetForm();
329
+ }
330
+
331
+ function handleSubmit() {
332
+ formDialogRef.value?.validate()?.then(valid => {
333
+ if (!valid) return;
334
+ const payload = JSON.parse(JSON.stringify(formData)) as OauthClientForm;
335
+ const request = payload.id
336
+ ? defOauthClientService.UpdateOauthClient({ oauth_client: payload })
337
+ : defOauthClientService.CreateOauthClient({ oauth_client: payload });
338
+ request.then(() => {
339
+ ElMessage.success(
340
+ t(payload.id ? "common.message.update_success" : "common.message.create_success", {
341
+ resource: t("system.base.oauth_client.resource")
342
+ })
343
+ );
344
+ handleCloseDialog();
345
+ proTable.value?.getTableList();
346
+ });
347
+ });
348
+ }
349
+
350
+ async function handleSetStatus(row: OauthClient) {
351
+ const nextStatus = row.status === Status.STATUS_ENABLE ? Status.STATUS_DISABLE : Status.STATUS_ENABLE;
352
+ try {
353
+ await ElMessageBox.confirm(
354
+ t("common.dialog.status_change", {
355
+ action: nextStatus === Status.STATUS_ENABLE ? t("common.action.enable") : t("common.action.disable"),
356
+ resource: t("system.base.oauth_client.resource"),
357
+ field: t("system.base.oauth_client.field.client_name"),
358
+ value: row.client_name
359
+ }),
360
+ t("common.title.warning"),
361
+ { type: "warning", confirmButtonText: t("common.action.confirm"), cancelButtonText: t("common.action.cancel") }
362
+ );
363
+ await defOauthClientService.SetOauthClientStatus({ id: row.id, status: nextStatus });
364
+ ElMessage.success(t("common.message.update_success", { resource: t("system.base.oauth_client.resource") }));
365
+ proTable.value?.getTableList();
366
+ return true;
367
+ } catch {
368
+ return false;
369
+ }
370
+ }
371
+
372
+ function handleDelete(selected?: number | string | Array<number | string> | OauthClient | OauthClient[]) {
373
+ const rowList = Array.isArray(selected)
374
+ ? (selected.filter(item => typeof item === "object") as OauthClient[])
375
+ : selected && typeof selected === "object"
376
+ ? [selected as OauthClient]
377
+ : [];
378
+ const ids = rowList.length
379
+ ? rowList.map(item => item.id)
380
+ : normalizeSelectedIds(selected as number | string | Array<number | string>);
381
+ const value = ids.filter(Boolean).join(",");
382
+ if (!value) {
383
+ ElMessage.warning(t("common.message.select_delete_item"));
384
+ return;
385
+ }
386
+ const resource = rowList.length
387
+ ? `${t("system.base.oauth_client.resource")}:${rowList
388
+ .map(item => item.client_name)
389
+ .filter(Boolean)
390
+ .join("、")}`
391
+ : t("system.base.oauth_client.resource");
392
+ ElMessageBox.confirm(t("common.dialog.delete_selected", { resource }), t("common.title.warning"), {
393
+ type: "warning",
394
+ confirmButtonText: t("common.action.confirm"),
395
+ cancelButtonText: t("common.action.cancel")
396
+ })
397
+ .then(() => {
398
+ return defOauthClientService.DeleteOauthClient({ id: value });
399
+ })
400
+ .then(() => {
401
+ ElMessage.success(t("common.message.delete_success", { resource: t("system.base.oauth_client.resource") }));
402
+ proTable.value?.getTableList();
403
+ });
404
+ }
405
+
406
+ async function handleCopyCredentials(row: OauthClient) {
407
+ const credentials = await defOauthClientService.RotateOauthClientCredentials({ id: row.id });
408
+ const content = [
409
+ `${t("system.base.oauth_client.field.client_id")}:${credentials.client_id}`,
410
+ `${t("system.base.oauth_client.field.client_secret")}:${credentials.client_secret}`,
411
+ `${t("system.base.oauth_client.field.crypto_type")}:${formatCrypto(credentials.crypto_type)}`,
412
+ `${t("system.base.oauth_client.field.crypto_key")}:${credentials.crypto_key}`
413
+ ].join("\n");
414
+ await copyText(content);
415
+ ElMessage.success(t("core.clipboard.success"));
416
+ }
417
+
418
+ function formatCrypto(value: OauthClientCryptoType) {
419
+ return cryptoOptions.value.find(item => item.value === value)?.label ?? String(value);
420
+ }
421
+ </script>
@@ -0,0 +1,86 @@
1
+ <template>
2
+ <LogTable ref="page" :config="config" />
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ import { computed, ref } from "vue";
7
+ import type { ColumnProps } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
8
+ import { t } from "@liujitcn/kratos-admin-core";
9
+ import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
10
+ import LogTable, { type LogTableConfig } from "@liujitcn/kratos-admin-system/components/LogTable.vue";
11
+ import { logDateSearch, logDetailColumn, logEnumLabel, createLogEnumOptions, requestLogTrace } from "@liujitcn/kratos-admin-system/components/log";
12
+ import { defBaseOperationLogService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_operation_log";
13
+ import { BaseLogResult } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_log";
14
+ import { BaseOperationAction } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_operation_log";
15
+ import type { BaseOperationLog, PageBaseOperationLogRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_operation_log";
16
+
17
+ defineOptions({ name: "BaseOperationLog", inheritAttrs: false });
18
+
19
+ const page = ref<InstanceType<typeof LogTable>>();
20
+ const resultOptions = computed(() => createLogEnumOptions([
21
+ [BaseLogResult.BASE_LOG_RESULT_UNSPECIFIED, t("system.base.log.result.unspecified")],
22
+ [BaseLogResult.BASE_LOG_RESULT_SUCCESS, t("system.base.log.result.success")],
23
+ [BaseLogResult.BASE_LOG_RESULT_FAILURE, t("system.base.log.result.failure")],
24
+ [BaseLogResult.BASE_LOG_RESULT_ERROR, t("system.base.log.result.error")]
25
+ ]));
26
+ const actionOptions = computed(() => createLogEnumOptions([
27
+ [BaseOperationAction.BASE_OPERATION_ACTION_UNSPECIFIED, t("system.base.log.operation_action.unspecified")],
28
+ [BaseOperationAction.BASE_OPERATION_ACTION_CREATE, t("system.base.log.operation_action.create")],
29
+ [BaseOperationAction.BASE_OPERATION_ACTION_UPDATE, t("system.base.log.operation_action.update")],
30
+ [BaseOperationAction.BASE_OPERATION_ACTION_DELETE, t("system.base.log.operation_action.delete")],
31
+ [BaseOperationAction.BASE_OPERATION_ACTION_PUBLISH, t("system.base.log.operation_action.publish")],
32
+ [BaseOperationAction.BASE_OPERATION_ACTION_REVOKE, t("system.base.log.operation_action.revoke")],
33
+ [BaseOperationAction.BASE_OPERATION_ACTION_IMPORT, t("system.base.log.operation_action.import")],
34
+ [BaseOperationAction.BASE_OPERATION_ACTION_EXPORT, t("system.base.log.operation_action.export")],
35
+ [BaseOperationAction.BASE_OPERATION_ACTION_OTHER, t("system.base.log.operation_action.other")]
36
+ ]));
37
+ const columns = computed<ColumnProps[]>(() => [
38
+ { prop: "resource_type", label: t("system.base.log.field.resource_type"), minWidth: 150, search: { el: "input" } },
39
+ { prop: "resource_id", label: t("system.base.log.field.resource_id"), minWidth: 120 },
40
+ { prop: "resource_name", label: t("system.base.log.field.resource_name"), minWidth: 160 },
41
+ { prop: "action", label: t("system.base.log.field.action"), minWidth: 110, search: { el: "select", enum: actionOptions.value }, render: scope => logEnumLabel(actionOptions.value, (scope.row as BaseOperationLog).action) },
42
+ { prop: "result", label: t("system.base.log.field.result"), minWidth: 110, search: { el: "select", enum: resultOptions.value }, render: scope => logEnumLabel(resultOptions.value, (scope.row as BaseOperationLog).result) },
43
+ { prop: "user_name", label: t("system.base.log.field.user_name"), minWidth: 130 },
44
+ { prop: "occurred_at", label: t("system.base.log.field.occurred_at"), minWidth: 190, search: logDateSearch(t) },
45
+ logDetailColumn(t("common.action.view"), id => page.value?.handleOpenDialog(id))
46
+ ]);
47
+
48
+ const config = computed<LogTableConfig>(() => ({
49
+ columns: columns.value,
50
+ detailTitle: t("system.base.log.operation.title.detail"),
51
+ closeText: t("common.action.close"),
52
+ trace: requestLogTrace,
53
+ detailFields: [
54
+ { key: "id", label: t("system.base.log.field.id") },
55
+ { key: "tenant_id", label: t("system.base.log.field.tenant_id") },
56
+ { key: "tenant_code", label: t("system.base.log.field.tenant_code") },
57
+ { key: "user_id", label: t("system.base.log.field.user_id") },
58
+ { key: "user_name", label: t("system.base.log.field.user_name") },
59
+ { key: "resource_type", label: t("system.base.log.field.resource_type") },
60
+ { key: "resource_id", label: t("system.base.log.field.resource_id") },
61
+ { key: "resource_name", label: t("system.base.log.field.resource_name") },
62
+ { key: "action", label: t("system.base.log.field.action"), enum: actionOptions.value },
63
+ { key: "result", label: t("system.base.log.field.result"), enum: resultOptions.value },
64
+ { key: "changed_fields", label: t("system.base.log.field.changed_fields"), span: 2, code: true },
65
+ { key: "before_data", label: t("system.base.log.field.before_data"), span: 2, code: true },
66
+ { key: "after_data", label: t("system.base.log.field.after_data"), span: 2, code: true },
67
+ { key: "reason_code", label: t("system.base.log.field.reason_code") },
68
+ { key: "reason", label: t("system.base.log.field.reason"), span: 2 },
69
+ { key: "request_id", label: t("system.base.log.field.request_id") },
70
+ { key: "trace_id", label: t("system.base.log.field.trace_id") },
71
+ { key: "occurred_at", label: t("system.base.log.field.occurred_at") },
72
+ { key: "created_at", label: t("system.base.log.field.created_at") }
73
+ ],
74
+ request: requestTable,
75
+ get: getDetail
76
+ }));
77
+
78
+ async function requestTable(params: Record<string, unknown>) {
79
+ const response = await defBaseOperationLogService.PageBaseOperationLog(buildPageRequest(params as unknown as PageBaseOperationLogRequest));
80
+ return { list: response.base_operation_logs as unknown as Record<string, unknown>[], total: response.total };
81
+ }
82
+
83
+ async function getDetail(id: string) {
84
+ return (await defBaseOperationLogService.GetBaseOperationLog({ id })) as unknown as Record<string, unknown>;
85
+ }
86
+ </script>
@@ -0,0 +1,90 @@
1
+ <template>
2
+ <LogTable ref="page" :config="config" />
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ import { computed, ref } from "vue";
7
+ import type { ColumnProps } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
8
+ import { t } from "@liujitcn/kratos-admin-core";
9
+ import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
10
+ import LogTable, { type LogTableConfig } from "@liujitcn/kratos-admin-system/components/LogTable.vue";
11
+ import { logDateSearch, logDetailColumn, logEnumLabel, createLogEnumOptions, requestLogTrace } from "@liujitcn/kratos-admin-system/components/log";
12
+ import { defBasePermissionLogService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_permission_log";
13
+ import { BaseLogResult } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_log";
14
+ import { BasePermissionAction, BasePermissionTargetType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_permission_log";
15
+ import type { BasePermissionLog, PageBasePermissionLogRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_permission_log";
16
+
17
+ defineOptions({ name: "BasePermissionLog", inheritAttrs: false });
18
+
19
+ const page = ref<InstanceType<typeof LogTable>>();
20
+ const resultOptions = computed(() => createLogEnumOptions([
21
+ [BaseLogResult.BASE_LOG_RESULT_UNSPECIFIED, t("system.base.log.result.unspecified")],
22
+ [BaseLogResult.BASE_LOG_RESULT_SUCCESS, t("system.base.log.result.success")],
23
+ [BaseLogResult.BASE_LOG_RESULT_FAILURE, t("system.base.log.result.failure")],
24
+ [BaseLogResult.BASE_LOG_RESULT_ERROR, t("system.base.log.result.error")]
25
+ ]));
26
+ const targetOptions = computed(() => createLogEnumOptions([
27
+ [BasePermissionTargetType.BASE_PERMISSION_TARGET_TYPE_UNSPECIFIED, t("system.base.log.target_type.unspecified")],
28
+ [BasePermissionTargetType.BASE_PERMISSION_TARGET_TYPE_USER, t("common.field.user")],
29
+ [BasePermissionTargetType.BASE_PERMISSION_TARGET_TYPE_ROLE, t("common.field.role")],
30
+ [BasePermissionTargetType.BASE_PERMISSION_TARGET_TYPE_MENU, t("system.base.log.target_type.menu")],
31
+ [BasePermissionTargetType.BASE_PERMISSION_TARGET_TYPE_API, t("system.base.log.target_type.api")],
32
+ [BasePermissionTargetType.BASE_PERMISSION_TARGET_TYPE_TENANT, t("common.field.tenant")]
33
+ ]));
34
+ const actionOptions = computed(() => createLogEnumOptions([
35
+ [BasePermissionAction.BASE_PERMISSION_ACTION_UNSPECIFIED, t("system.base.log.permission_action.unspecified")],
36
+ [BasePermissionAction.BASE_PERMISSION_ACTION_GRANT, t("system.base.log.permission_action.grant")],
37
+ [BasePermissionAction.BASE_PERMISSION_ACTION_REVOKE, t("system.base.log.permission_action.revoke")],
38
+ [BasePermissionAction.BASE_PERMISSION_ACTION_CREATE, t("system.base.log.permission_action.create")],
39
+ [BasePermissionAction.BASE_PERMISSION_ACTION_UPDATE, t("system.base.log.permission_action.update")],
40
+ [BasePermissionAction.BASE_PERMISSION_ACTION_DELETE, t("system.base.log.permission_action.delete")],
41
+ [BasePermissionAction.BASE_PERMISSION_ACTION_ASSIGN, t("system.base.log.permission_action.assign")]
42
+ ]));
43
+ const columns = computed<ColumnProps[]>(() => [
44
+ { prop: "target_type", label: t("system.base.log.field.target_type"), minWidth: 120, search: { el: "select", enum: targetOptions.value }, render: scope => logEnumLabel(targetOptions.value, (scope.row as BasePermissionLog).target_type) },
45
+ { prop: "target_name", label: t("system.base.log.field.target_name"), minWidth: 180, search: { el: "input" } },
46
+ { prop: "action", label: t("system.base.log.field.action"), minWidth: 110, search: { el: "select", enum: actionOptions.value }, render: scope => logEnumLabel(actionOptions.value, (scope.row as BasePermissionLog).action) },
47
+ { prop: "result", label: t("system.base.log.field.result"), minWidth: 110, search: { el: "select", enum: resultOptions.value }, render: scope => logEnumLabel(resultOptions.value, (scope.row as BasePermissionLog).result) },
48
+ { prop: "user_name", label: t("system.base.log.field.user_name"), minWidth: 130 },
49
+ { prop: "occurred_at", label: t("system.base.log.field.occurred_at"), minWidth: 190, search: logDateSearch(t) },
50
+ logDetailColumn(t("common.action.view"), id => page.value?.handleOpenDialog(id))
51
+ ]);
52
+
53
+ const config = computed<LogTableConfig>(() => ({
54
+ columns: columns.value,
55
+ detailTitle: t("system.base.log.permission.title.detail"),
56
+ closeText: t("common.action.close"),
57
+ trace: requestLogTrace,
58
+ detailFields: [
59
+ { key: "id", label: t("system.base.log.field.id") },
60
+ { key: "tenant_id", label: t("system.base.log.field.tenant_id") },
61
+ { key: "tenant_code", label: t("system.base.log.field.tenant_code") },
62
+ { key: "user_id", label: t("system.base.log.field.user_id") },
63
+ { key: "user_name", label: t("system.base.log.field.user_name") },
64
+ { key: "target_type", label: t("system.base.log.field.target_type"), enum: targetOptions.value },
65
+ { key: "target_id", label: t("system.base.log.field.target_id") },
66
+ { key: "target_name", label: t("system.base.log.field.target_name") },
67
+ { key: "action", label: t("system.base.log.field.action"), enum: actionOptions.value },
68
+ { key: "old_value", label: t("system.base.log.field.old_value"), span: 2, code: true },
69
+ { key: "new_value", label: t("system.base.log.field.new_value"), span: 2, code: true },
70
+ { key: "result", label: t("system.base.log.field.result"), enum: resultOptions.value },
71
+ { key: "reason_code", label: t("system.base.log.field.reason_code") },
72
+ { key: "reason", label: t("system.base.log.field.reason"), span: 2 },
73
+ { key: "request_id", label: t("system.base.log.field.request_id") },
74
+ { key: "trace_id", label: t("system.base.log.field.trace_id") },
75
+ { key: "occurred_at", label: t("system.base.log.field.occurred_at") },
76
+ { key: "created_at", label: t("system.base.log.field.created_at") }
77
+ ],
78
+ request: requestTable,
79
+ get: getDetail
80
+ }));
81
+
82
+ async function requestTable(params: Record<string, unknown>) {
83
+ const response = await defBasePermissionLogService.PageBasePermissionLog(buildPageRequest(params as unknown as PageBasePermissionLogRequest));
84
+ return { list: response.base_permission_logs as unknown as Record<string, unknown>[], total: response.total };
85
+ }
86
+
87
+ async function getDetail(id: string) {
88
+ return (await defBasePermissionLogService.GetBasePermissionLog({ id })) as unknown as Record<string, unknown>;
89
+ }
90
+ </script>