@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.
- package/README.md +46 -15
- package/dist/package/declarations/src/api/base/v1/notification.d.ts +26 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_api_log.d.ts +10 -0
- package/dist/package/declarations/src/api/system/{base_area.d.ts → admin/v1/base_area.d.ts} +1 -1
- package/dist/package/declarations/src/api/system/{base_config.d.ts → admin/v1/base_config.d.ts} +5 -1
- package/dist/package/declarations/src/api/system/admin/v1/base_dashboard.d.ts +14 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_data_access_log.d.ts +10 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_dict.d.ts +20 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_dict_item.d.ts +18 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_file.d.ts +13 -0
- package/dist/package/declarations/src/api/system/{base_job.d.ts → admin/v1/base_job.d.ts} +4 -5
- package/dist/package/declarations/src/api/system/admin/v1/base_job_log.d.ts +9 -0
- package/dist/package/declarations/src/api/system/{base_language.d.ts → admin/v1/base_language.d.ts} +3 -3
- package/dist/package/declarations/src/api/system/admin/v1/base_log.d.ts +8 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_login_log.d.ts +10 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_login_policy.d.ts +19 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_message.d.ts +24 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_message_category.d.ts +21 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_operation_log.d.ts +10 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_permission_log.d.ts +10 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_policy_evaluation_log.d.ts +10 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_session.d.ts +11 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_table_archive.d.ts +20 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_table_archive_record.d.ts +11 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_table_archive_restore.d.ts +14 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_table_backup.d.ts +20 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_table_backup_record.d.ts +11 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_table_backup_restore.d.ts +14 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_table_source.d.ts +11 -0
- package/dist/package/declarations/src/api/system/admin/v1/cache.d.ts +7 -0
- package/dist/package/declarations/src/api/system/admin/v1/oauth_client.d.ts +24 -0
- package/dist/package/declarations/src/api/system/base_redact_field.d.ts +20 -0
- package/dist/package/declarations/src/api/system/base_redact_policy.d.ts +19 -0
- package/dist/package/declarations/src/api/system/base_redact_rule.d.ts +22 -0
- package/dist/package/declarations/src/components/DynamicI18nCell.vue.d.ts +5 -1
- package/dist/package/declarations/src/components/ForcedPasswordDialog.vue.d.ts +3 -0
- package/dist/package/declarations/src/components/LogTable.vue.d.ts +52 -0
- package/dist/package/declarations/src/components/Notification.vue.d.ts +3 -0
- package/dist/package/declarations/src/components/dynamicI18n.d.ts +4 -7
- package/dist/package/declarations/src/components/log.d.ts +20 -0
- package/dist/package/declarations/src/config/base-log-fallback.d.ts +7 -0
- package/dist/package/declarations/src/config/database-backup.d.ts +12 -0
- package/dist/package/declarations/src/config/index.d.ts +7 -0
- package/dist/package/declarations/src/config/types.d.ts +56 -0
- package/dist/package/declarations/src/locales/generated.d.ts +1968 -88
- package/dist/package/declarations/src/rpc/base/v1/login.d.ts +151 -0
- package/dist/package/declarations/src/rpc/base/v1/notification.d.ts +306 -0
- package/dist/package/declarations/src/rpc/base/v1/oauth.d.ts +25 -0
- package/dist/package/declarations/src/rpc/base/v1/oauth_client.d.ts +23 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/auth.d.ts +13 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_api.d.ts +2 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_api_log.d.ts +84 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +38 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_dashboard.d.ts +60 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_data_access_log.d.ts +112 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +0 -101
- package/dist/package/declarations/src/rpc/system/admin/v1/base_dict_item.d.ts +107 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_file.d.ts +73 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_i18n.d.ts +10 -6
- package/dist/package/declarations/src/rpc/system/admin/v1/base_job.d.ts +10 -56
- package/dist/package/declarations/src/rpc/system/admin/v1/base_job_log.d.ts +60 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_log.d.ts +66 -76
- package/dist/package/declarations/src/rpc/system/admin/v1/base_login_log.d.ts +92 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_login_policy.d.ts +179 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_message.d.ts +193 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_message_category.d.ts +125 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_operation_log.d.ts +106 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_permission_log.d.ts +118 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_policy_evaluation_log.d.ts +119 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_common.d.ts +9 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_field.d.ts +161 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_policy.d.ts +150 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_rule.d.ts +111 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_session.d.ts +33 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_table_archive.d.ts +90 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_table_archive_record.d.ts +82 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_table_archive_restore.d.ts +76 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_table_backup.d.ts +74 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_table_backup_record.d.ts +69 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_table_backup_restore.d.ts +76 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_table_source.d.ts +16 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_user.d.ts +18 -3
- package/dist/package/declarations/src/rpc/system/admin/v1/cache.d.ts +47 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_column.d.ts +2 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen_table.d.ts +8 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/oauth_client.d.ts +145 -0
- package/dist/package/declarations/src/rpc/system/common/v1/common.d.ts +26 -0
- package/dist/package/declarations/src/rpc/system/config/v1/system_config.d.ts +8 -0
- package/dist/package/declarations/src/{api/system → utils}/code_gen_i18n.d.ts +1 -2
- package/dist/package/declarations/src/{api/system → utils}/code_gen_sse.d.ts +1 -1
- package/dist/package/declarations/src/utils/notification-response.d.ts +5 -0
- package/dist/package/declarations/src/{api/system → utils}/ops_monitoring_sse.d.ts +1 -1
- package/dist/package/declarations/src/{api/system → utils}/runtime_log_sse.d.ts +1 -1
- package/dist/package/declarations/src/views/base/api-log/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/backup-management/archive-config/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/backup-management/archive-record/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/backup-management/archive-restore/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/backup-management/backup-config/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/backup-management/backup-record/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/backup-management/backup-restore/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/dashboard/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/data-access-log/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/file/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/login-log/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/login-policy/format.d.ts +2 -0
- package/dist/package/declarations/src/views/base/login-policy/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/message/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/message-category/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/oauth-client/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/operation-log/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/permission-log/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/policy-evaluation-log/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/redact-field/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/redact-policy/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/redact-rule/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/runtime-config/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/message/inbox/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/profile/components/session.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/tool/cache/index.vue.d.ts +3 -0
- package/dist/package/src/api/base/v1/notification.ts +99 -0
- package/dist/package/src/api/base/{sse.ts → v1/sse.ts} +4 -4
- package/dist/package/src/api/system/{auth.ts → admin/v1/auth.ts} +1 -0
- package/dist/package/src/api/system/admin/v1/base_api_log.ts +33 -0
- package/dist/package/src/api/system/{base_area.ts → admin/v1/base_area.ts} +1 -1
- package/dist/package/src/api/system/{base_config.ts → admin/v1/base_config.ts} +20 -0
- package/dist/package/src/api/system/admin/v1/base_dashboard.ts +55 -0
- package/dist/package/src/api/system/admin/v1/base_data_access_log.ts +33 -0
- package/dist/package/src/api/system/{base_dict.ts → admin/v1/base_dict.ts} +0 -60
- package/dist/package/src/api/system/admin/v1/base_dict_item.ts +72 -0
- package/dist/package/src/api/system/admin/v1/base_file.ts +43 -0
- package/dist/package/src/api/system/{base_job.ts → admin/v1/base_job.ts} +11 -22
- package/dist/package/src/api/system/admin/v1/base_job_log.ts +32 -0
- package/dist/package/src/api/system/{base_language.ts → admin/v1/base_language.ts} +3 -3
- package/dist/package/src/api/system/admin/v1/base_log.ts +23 -0
- package/dist/package/src/api/system/admin/v1/base_login_log.ts +33 -0
- package/dist/package/src/api/system/admin/v1/base_login_policy.ts +67 -0
- package/dist/package/src/api/system/admin/v1/base_message.ts +90 -0
- package/dist/package/src/api/system/admin/v1/base_message_category.ts +80 -0
- package/dist/package/src/api/system/admin/v1/base_operation_log.ts +33 -0
- package/dist/package/src/api/system/admin/v1/base_permission_log.ts +33 -0
- package/dist/package/src/api/system/admin/v1/base_policy_evaluation_log.ts +33 -0
- package/dist/package/src/api/system/admin/v1/base_session.ts +33 -0
- package/dist/package/src/api/system/admin/v1/base_table_archive.ts +70 -0
- package/dist/package/src/api/system/admin/v1/base_table_archive_record.ts +33 -0
- package/dist/package/src/api/system/admin/v1/base_table_archive_restore.ts +44 -0
- package/dist/package/src/api/system/admin/v1/base_table_backup.ts +70 -0
- package/dist/package/src/api/system/admin/v1/base_table_backup_record.ts +33 -0
- package/dist/package/src/api/system/admin/v1/base_table_backup_restore.ts +44 -0
- package/dist/package/src/api/system/admin/v1/base_table_source.ts +33 -0
- package/dist/package/src/api/system/admin/v1/cache.ts +22 -0
- package/dist/package/src/api/system/{code_gen_column.ts → admin/v1/code_gen_column.ts} +19 -3
- package/dist/package/src/api/system/{code_gen_table.ts → admin/v1/code_gen_table.ts} +13 -4
- package/dist/package/src/api/system/admin/v1/oauth_client.ts +102 -0
- package/dist/package/src/api/system/base_redact_field.ts +25 -0
- package/dist/package/src/api/system/base_redact_policy.ts +24 -0
- package/dist/package/src/api/system/base_redact_rule.ts +27 -0
- package/dist/package/src/components/Ai.vue +1 -1
- package/dist/package/src/components/ChangePasswordForm.vue +143 -0
- package/dist/package/src/components/DynamicI18nCell.vue +28 -8
- package/dist/package/src/components/DynamicI18nEditor.vue +1 -1
- package/dist/package/src/components/ForcedPasswordDialog.vue +40 -0
- package/dist/package/src/components/LogTable.vue +190 -0
- package/dist/package/src/components/Notification.vue +301 -0
- package/dist/package/src/components/dynamicI18n.ts +5 -9
- package/dist/package/src/components/log.ts +87 -0
- package/dist/package/src/config/base-log-fallback.ts +26 -0
- package/dist/package/src/config/database-backup.ts +57 -0
- package/dist/package/src/config/index.ts +26 -0
- package/dist/package/src/config/types.ts +59 -0
- package/dist/package/src/locales/README.md +6 -3
- package/dist/package/src/locales/en-US.json +511 -29
- package/dist/package/src/locales/ja-JP.json +515 -33
- package/dist/package/src/locales/zh-CN.json +511 -29
- package/dist/package/src/locales/zh-TW.json +514 -32
- package/dist/package/src/module.ts +7 -2
- package/dist/package/src/rpc/base/v1/login.ts +174 -0
- package/dist/package/src/rpc/base/v1/notification.ts +343 -0
- package/dist/package/src/rpc/base/v1/oauth.ts +25 -0
- package/dist/package/src/rpc/base/v1/oauth_client.ts +33 -0
- package/dist/package/src/rpc/system/admin/v1/auth.ts +13 -0
- package/dist/package/src/rpc/system/admin/v1/base_api.ts +2 -0
- package/dist/package/src/rpc/system/admin/v1/base_api_log.ts +102 -0
- package/dist/package/src/rpc/system/admin/v1/base_config.ts +42 -0
- package/dist/package/src/rpc/system/admin/v1/base_dashboard.ts +81 -0
- package/dist/package/src/rpc/system/admin/v1/base_data_access_log.ts +135 -0
- package/dist/package/src/rpc/system/admin/v1/base_dict.ts +0 -112
- package/dist/package/src/rpc/system/admin/v1/base_dict_item.ts +126 -0
- package/dist/package/src/rpc/system/admin/v1/base_file.ts +88 -0
- package/dist/package/src/rpc/system/admin/v1/base_i18n.ts +10 -6
- package/dist/package/src/rpc/system/admin/v1/base_job.ts +10 -62
- package/dist/package/src/rpc/system/admin/v1/base_job_log.ts +75 -0
- package/dist/package/src/rpc/system/admin/v1/base_log.ts +67 -78
- package/dist/package/src/rpc/system/admin/v1/base_login_log.ts +113 -0
- package/dist/package/src/rpc/system/admin/v1/base_login_policy.ts +212 -0
- package/dist/package/src/rpc/system/admin/v1/base_message.ts +236 -0
- package/dist/package/src/rpc/system/admin/v1/base_message_category.ts +149 -0
- package/dist/package/src/rpc/system/admin/v1/base_operation_log.ts +127 -0
- package/dist/package/src/rpc/system/admin/v1/base_permission_log.ts +142 -0
- package/dist/package/src/rpc/system/admin/v1/base_policy_evaluation_log.ts +143 -0
- package/dist/package/src/rpc/system/admin/v1/base_redact_common.ts +17 -0
- package/dist/package/src/rpc/system/admin/v1/base_redact_field.ts +182 -0
- package/dist/package/src/rpc/system/admin/v1/base_redact_policy.ts +174 -0
- package/dist/package/src/rpc/system/admin/v1/base_redact_rule.ts +131 -0
- package/dist/package/src/rpc/system/admin/v1/base_session.ts +44 -0
- package/dist/package/src/rpc/system/admin/v1/base_table_archive.ts +109 -0
- package/dist/package/src/rpc/system/admin/v1/base_table_archive_record.ts +95 -0
- package/dist/package/src/rpc/system/admin/v1/base_table_archive_restore.ts +93 -0
- package/dist/package/src/rpc/system/admin/v1/base_table_backup.ts +91 -0
- package/dist/package/src/rpc/system/admin/v1/base_table_backup_record.ts +82 -0
- package/dist/package/src/rpc/system/admin/v1/base_table_backup_restore.ts +91 -0
- package/dist/package/src/rpc/system/admin/v1/base_table_source.ts +26 -0
- package/dist/package/src/rpc/system/admin/v1/base_user.ts +18 -3
- package/dist/package/src/rpc/system/admin/v1/cache.ts +59 -0
- package/dist/package/src/rpc/system/admin/v1/code_gen_column.ts +2 -0
- package/dist/package/src/rpc/system/admin/v1/code_gen_table.ts +8 -0
- package/dist/package/src/rpc/system/admin/v1/oauth_client.ts +174 -0
- package/dist/package/src/rpc/system/common/v1/common.ts +35 -0
- package/dist/package/src/rpc/system/config/v1/system_config.ts +16 -0
- package/dist/package/src/{api/system → utils}/code_gen_i18n.ts +1 -1
- package/dist/package/src/{api/system → utils}/code_gen_sse.ts +1 -1
- package/dist/package/src/utils/notification-response.ts +22 -0
- package/dist/package/src/{api/system → utils}/ops_monitoring_sse.ts +1 -1
- package/dist/package/src/{api/system → utils}/runtime_log_sse.ts +1 -1
- package/dist/package/src/views/ai/chat/components/AiMarkdown.vue +1 -1
- package/dist/package/src/views/ai/chat/components/ChatPanel.vue +4 -6
- package/dist/package/src/views/ai/chat/components/XSender.vue +1 -1
- package/dist/package/src/views/ai/chat/index.vue +3 -3
- package/dist/package/src/views/ai/chat/message.ts +2 -3
- package/dist/package/src/views/base/api/index.vue +4 -4
- package/dist/package/src/views/base/api-log/index.vue +94 -0
- package/dist/package/src/views/base/area/index.vue +1 -1
- package/dist/package/src/views/base/backup-management/archive-config/index.vue +151 -0
- package/dist/package/src/views/base/backup-management/archive-record/index.vue +44 -0
- package/dist/package/src/views/base/backup-management/archive-restore/index.vue +59 -0
- package/dist/package/src/views/base/backup-management/backup-config/index.vue +119 -0
- package/dist/package/src/views/base/backup-management/backup-record/index.vue +41 -0
- package/dist/package/src/views/base/backup-management/backup-restore/index.vue +66 -0
- package/dist/package/src/views/base/config/index.vue +19 -28
- package/dist/package/src/views/base/dashboard/index.vue +202 -0
- package/dist/package/src/views/base/data-access-log/index.vue +96 -0
- package/dist/package/src/views/base/dept/index.vue +11 -11
- package/dist/package/src/views/base/dict/index.vue +7 -7
- package/dist/package/src/views/base/dict/item.vue +14 -14
- package/dist/package/src/views/base/file/index.vue +323 -0
- package/dist/package/src/views/base/job/index.vue +63 -8
- package/dist/package/src/views/base/job/log.vue +38 -11
- package/dist/package/src/views/base/language/index.vue +3 -2
- package/dist/package/src/views/base/login-log/index.vue +96 -0
- package/dist/package/src/views/base/login-policy/format.ts +4 -0
- package/dist/package/src/views/base/login-policy/index.vue +530 -0
- package/dist/package/src/views/base/menu/index.vue +19 -19
- package/dist/package/src/views/base/message/index.vue +712 -0
- package/dist/package/src/views/base/message-category/index.vue +387 -0
- package/dist/package/src/views/base/migration/index.vue +2 -2
- package/dist/package/src/views/base/oauth-client/index.vue +421 -0
- package/dist/package/src/views/base/operation-log/index.vue +86 -0
- package/dist/package/src/views/base/permission-log/index.vue +90 -0
- package/dist/package/src/views/base/policy-evaluation-log/index.vue +93 -0
- package/dist/package/src/views/base/post/index.vue +11 -11
- package/dist/package/src/views/base/redact-field/index.vue +59 -0
- package/dist/package/src/views/base/redact-policy/index.vue +92 -0
- package/dist/package/src/views/base/redact-rule/index.vue +51 -0
- package/dist/package/src/views/base/role/index.vue +9 -9
- package/dist/package/src/views/base/runtime-config/index.vue +479 -0
- package/dist/package/src/views/base/tenant/index.vue +9 -9
- package/dist/package/src/views/base/user/components/dept-tree.vue +1 -1
- package/dist/package/src/views/base/user/index.vue +86 -47
- package/dist/package/src/views/message/inbox/index.vue +276 -0
- package/dist/package/src/views/profile/components/base.vue +90 -13
- package/dist/package/src/views/profile/components/password.vue +3 -229
- package/dist/package/src/views/profile/components/security.vue +477 -64
- package/dist/package/src/views/profile/components/session.vue +161 -0
- package/dist/package/src/views/profile/index.vue +45 -31
- package/dist/package/src/views/tool/api-doc/index.vue +3 -3
- package/dist/package/src/views/tool/cache/index.vue +352 -0
- package/dist/package/src/views/tool/code-gen/code-preview/index.vue +4 -4
- package/dist/package/src/views/tool/code-gen/columns/index.vue +16 -16
- package/dist/package/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue +2 -2
- package/dist/package/src/views/tool/code-gen/components/CodeGenProgressDialog.vue +2 -2
- package/dist/package/src/views/tool/code-gen/config.ts +3 -0
- package/dist/package/src/views/tool/code-gen/preview/index.vue +9 -9
- package/dist/package/src/views/tool/code-gen/proto/index.vue +10 -12
- package/dist/package/src/views/tool/code-gen/table/index.vue +71 -15
- package/dist/package/src/views/tool/ops-monitoring/index.vue +55 -116
- package/dist/package/src/views/tool/project-doc/index.vue +2 -2
- package/dist/package/src/views/tool/runtime-log/index.vue +6 -6
- package/package.json +7 -2
- package/dist/package/declarations/src/api/system/base_dict.d.ts +0 -32
- package/dist/package/declarations/src/api/system/base_log.d.ts +0 -9
- package/dist/package/src/api/system/base_log.ts +0 -32
- package/dist/package/src/views/base/log/index.vue +0 -339
- /package/dist/package/declarations/src/api/base/{ai_message.d.ts → v1/ai_message.d.ts} +0 -0
- /package/dist/package/declarations/src/api/base/{ai_session.d.ts → v1/ai_session.d.ts} +0 -0
- /package/dist/package/declarations/src/api/base/{ai_tool.d.ts → v1/ai_tool.d.ts} +0 -0
- /package/dist/package/declarations/src/api/base/{oauth.d.ts → v1/oauth.d.ts} +0 -0
- /package/dist/package/declarations/src/api/base/{sse.d.ts → v1/sse.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{auth.d.ts → admin/v1/auth.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_api.d.ts → admin/v1/base_api.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_dept.d.ts → admin/v1/base_dept.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_i18n.d.ts → admin/v1/base_i18n.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_menu.d.ts → admin/v1/base_menu.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_migration.d.ts → admin/v1/base_migration.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_post.d.ts → admin/v1/base_post.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_role.d.ts → admin/v1/base_role.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_tenant.d.ts → admin/v1/base_tenant.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_user.d.ts → admin/v1/base_user.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{code_gen.d.ts → admin/v1/code_gen.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{code_gen_column.d.ts → admin/v1/code_gen_column.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{code_gen_proto.d.ts → admin/v1/code_gen_proto.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{code_gen_table.d.ts → admin/v1/code_gen_table.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{ops_monitoring.d.ts → admin/v1/ops_monitoring.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{project_document.d.ts → admin/v1/project_document.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{runtime_log.d.ts → admin/v1/runtime_log.d.ts} +0 -0
- /package/dist/package/declarations/src/{views/base/log/index.vue.d.ts → components/ChangePasswordForm.vue.d.ts} +0 -0
- /package/dist/package/src/api/base/{ai_message.ts → v1/ai_message.ts} +0 -0
- /package/dist/package/src/api/base/{ai_session.ts → v1/ai_session.ts} +0 -0
- /package/dist/package/src/api/base/{ai_tool.ts → v1/ai_tool.ts} +0 -0
- /package/dist/package/src/api/base/{oauth.ts → v1/oauth.ts} +0 -0
- /package/dist/package/src/api/system/{base_api.ts → admin/v1/base_api.ts} +0 -0
- /package/dist/package/src/api/system/{base_dept.ts → admin/v1/base_dept.ts} +0 -0
- /package/dist/package/src/api/system/{base_i18n.ts → admin/v1/base_i18n.ts} +0 -0
- /package/dist/package/src/api/system/{base_menu.ts → admin/v1/base_menu.ts} +0 -0
- /package/dist/package/src/api/system/{base_migration.ts → admin/v1/base_migration.ts} +0 -0
- /package/dist/package/src/api/system/{base_post.ts → admin/v1/base_post.ts} +0 -0
- /package/dist/package/src/api/system/{base_role.ts → admin/v1/base_role.ts} +0 -0
- /package/dist/package/src/api/system/{base_tenant.ts → admin/v1/base_tenant.ts} +0 -0
- /package/dist/package/src/api/system/{base_user.ts → admin/v1/base_user.ts} +0 -0
- /package/dist/package/src/api/system/{code_gen.ts → admin/v1/code_gen.ts} +0 -0
- /package/dist/package/src/api/system/{code_gen_proto.ts → admin/v1/code_gen_proto.ts} +0 -0
- /package/dist/package/src/api/system/{ops_monitoring.ts → admin/v1/ops_monitoring.ts} +0 -0
- /package/dist/package/src/api/system/{project_document.ts → admin/v1/project_document.ts} +0 -0
- /package/dist/package/src/api/system/{runtime_log.ts → admin/v1/runtime_log.ts} +0 -0
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
<template>
|
|
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
|
+
>
|
|
10
|
+
<template #reference>
|
|
11
|
+
<el-badge class="notification-trigger" :value="badgeValue" :hidden="unreadTotal === 0" :max="99">
|
|
12
|
+
<el-icon :size="24"><Bell /></el-icon>
|
|
13
|
+
</el-badge>
|
|
14
|
+
</template>
|
|
15
|
+
<div class="notification-panel">
|
|
16
|
+
<div class="notification-header">
|
|
17
|
+
<strong>{{ t("system.notification.title") }}</strong>
|
|
18
|
+
<el-button link type="primary" @click="markAllRead">{{ t("system.notification.action.mark_all_read") }}</el-button>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="notification-list">
|
|
21
|
+
<button
|
|
22
|
+
v-for="item in notifications"
|
|
23
|
+
:key="item.id"
|
|
24
|
+
class="notification-item"
|
|
25
|
+
:class="{ 'is-unread': !item.read_at }"
|
|
26
|
+
type="button"
|
|
27
|
+
@click="openNotification(item)"
|
|
28
|
+
>
|
|
29
|
+
<span class="notification-category-icon" :style="{ color: item.category_color || undefined }" aria-hidden="true">
|
|
30
|
+
<component :is="resolveNotificationIcon(item.category_icon)" />
|
|
31
|
+
</span>
|
|
32
|
+
<span class="notification-status" :style="{ backgroundColor: item.category_color || undefined }" aria-hidden="true"></span>
|
|
33
|
+
<span class="notification-title">{{ item.title }}</span>
|
|
34
|
+
<span class="notification-time">{{ item.received_at }}</span>
|
|
35
|
+
</button>
|
|
36
|
+
<el-empty v-if="notifications.length === 0" :description="t('system.notification.empty')" :image-size="72" />
|
|
37
|
+
</div>
|
|
38
|
+
<el-button class="notification-more" text @click="openInbox">{{ t("system.notification.action.view_all") }}</el-button>
|
|
39
|
+
</div>
|
|
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>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script setup lang="ts">
|
|
69
|
+
import { computed, onBeforeUnmount, onMounted, ref } from "vue";
|
|
70
|
+
import { useRouter } from "vue-router";
|
|
71
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
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";
|
|
76
|
+
import type { Notification } 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";
|
|
82
|
+
|
|
83
|
+
const router = useRouter();
|
|
84
|
+
const popoverVisible = ref(false);
|
|
85
|
+
const unreadTotal = ref(0);
|
|
86
|
+
const latestDeliveryID = ref(0);
|
|
87
|
+
const notifications = ref<Notification[]>([]);
|
|
88
|
+
const detailVisible = ref(false);
|
|
89
|
+
const detail = ref<Notification>();
|
|
90
|
+
let stopSse: SseStop | undefined;
|
|
91
|
+
|
|
92
|
+
defineOptions({ name: "Notification", inheritAttrs: false });
|
|
93
|
+
|
|
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
|
+
});
|
|
100
|
+
const notificationIcons = {
|
|
101
|
+
Bell,
|
|
102
|
+
Calendar,
|
|
103
|
+
ChatDotRound,
|
|
104
|
+
CircleCheckFilled,
|
|
105
|
+
CollectionTag,
|
|
106
|
+
DataAnalysis,
|
|
107
|
+
InfoFilled,
|
|
108
|
+
List,
|
|
109
|
+
Lock,
|
|
110
|
+
Message,
|
|
111
|
+
Promotion,
|
|
112
|
+
Setting,
|
|
113
|
+
User,
|
|
114
|
+
WarningFilled
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
onMounted(() => {
|
|
118
|
+
void refresh();
|
|
119
|
+
stopSse = subscribeSseEvent(
|
|
120
|
+
{ stream: "base.notification", channel_id: undefined },
|
|
121
|
+
"inbox.changed",
|
|
122
|
+
raw => {
|
|
123
|
+
try {
|
|
124
|
+
return JSON.parse(raw) as Record<string, unknown>;
|
|
125
|
+
} catch {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
() => void refresh()
|
|
130
|
+
);
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
onBeforeUnmount(() => stopSse?.());
|
|
134
|
+
|
|
135
|
+
/** 刷新未读汇总和最近消息。 */
|
|
136
|
+
async function refresh() {
|
|
137
|
+
const [summary, page] = await Promise.all([
|
|
138
|
+
defNotificationService.GetNotificationSummary({}),
|
|
139
|
+
defNotificationService.PageNotification({ view: NotificationView.NOTIFICATION_VIEW_UNREAD, category_id: undefined, priority: undefined, cursor_id: 0, page_num: 1, page_size: 5 })
|
|
140
|
+
]);
|
|
141
|
+
unreadTotal.value = summary.unread_total;
|
|
142
|
+
latestDeliveryID.value = summary.latest_delivery_id;
|
|
143
|
+
notifications.value = page.notifications;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** 标记全部消息为已读。 */
|
|
147
|
+
async function markAllRead() {
|
|
148
|
+
if (!latestDeliveryID.value) return;
|
|
149
|
+
await defNotificationService.MarkAllNotificationRead({ before_delivery_id: latestDeliveryID.value });
|
|
150
|
+
await refresh();
|
|
151
|
+
}
|
|
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
|
+
|
|
167
|
+
/** 打开完整收件箱。 */
|
|
168
|
+
function openInbox() {
|
|
169
|
+
popoverVisible.value = false;
|
|
170
|
+
void router.push({ name: "NotificationInbox" });
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** 执行通知携带的稳定 viewKey 动作。 */
|
|
174
|
+
function openAction() {
|
|
175
|
+
if (!actionRouteName.value) return;
|
|
176
|
+
detailVisible.value = false;
|
|
177
|
+
void router.push({ name: actionRouteName.value });
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** 解析收件箱分类图标,未知图标使用默认图标。 */
|
|
181
|
+
function resolveNotificationIcon(icon: string) {
|
|
182
|
+
return notificationIcons[icon as keyof typeof notificationIcons] ?? CollectionTag;
|
|
183
|
+
}
|
|
184
|
+
</script>
|
|
185
|
+
|
|
186
|
+
<style scoped lang="scss">
|
|
187
|
+
.notification-trigger {
|
|
188
|
+
display: inline-flex;
|
|
189
|
+
width: 24px;
|
|
190
|
+
height: 24px;
|
|
191
|
+
align-items: center;
|
|
192
|
+
justify-content: center;
|
|
193
|
+
cursor: pointer;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.notification-panel {
|
|
197
|
+
min-height: 160px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.notification-list {
|
|
201
|
+
max-height: min(440px, calc(100vh - 240px));
|
|
202
|
+
overflow-y: auto;
|
|
203
|
+
overscroll-behavior: contain;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.notification-header {
|
|
207
|
+
display: flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
justify-content: space-between;
|
|
210
|
+
margin-bottom: 8px;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.notification-item {
|
|
214
|
+
display: flex;
|
|
215
|
+
align-items: center;
|
|
216
|
+
gap: 8px;
|
|
217
|
+
width: 100%;
|
|
218
|
+
padding: 10px 0;
|
|
219
|
+
border: 0;
|
|
220
|
+
border-bottom: 1px solid var(--el-border-color-lighter);
|
|
221
|
+
background: transparent;
|
|
222
|
+
color: var(--el-text-color-primary);
|
|
223
|
+
cursor: pointer;
|
|
224
|
+
text-align: left;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.notification-status {
|
|
228
|
+
width: 7px;
|
|
229
|
+
height: 7px;
|
|
230
|
+
flex: 0 0 7px;
|
|
231
|
+
border-radius: 50%;
|
|
232
|
+
background: var(--el-color-primary);
|
|
233
|
+
visibility: hidden;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.notification-category-icon {
|
|
237
|
+
display: inline-flex;
|
|
238
|
+
flex: 0 0 18px;
|
|
239
|
+
align-items: center;
|
|
240
|
+
justify-content: center;
|
|
241
|
+
font-size: 17px;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.notification-item.is-unread .notification-status {
|
|
245
|
+
visibility: visible;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.notification-title {
|
|
249
|
+
min-width: 0;
|
|
250
|
+
flex: 1;
|
|
251
|
+
overflow: hidden;
|
|
252
|
+
text-overflow: ellipsis;
|
|
253
|
+
white-space: nowrap;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.notification-time {
|
|
257
|
+
margin-left: 12px;
|
|
258
|
+
color: var(--el-text-color-secondary);
|
|
259
|
+
font-size: 12px;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.notification-more {
|
|
263
|
+
width: 100%;
|
|
264
|
+
margin-top: 8px;
|
|
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
|
+
}
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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 ??
|
|
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
|
+
}
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
# 管理端 System 语言包
|
|
2
2
|
|
|
3
|
-
本目录提供 System 管理业务模块的页面、AI
|
|
3
|
+
本目录提供 System 管理业务模块的页面、AI、个人中心安全设置、开放授权客户端、基础资料和代码生成等业务文案。语言包由同级 `../module.ts` 导入,随 `systemAdminModule` 注册;管理端启动时由 core 的 `registerLocaleMessages` 合并,System 页面和组件通过 `t()` 或 `useLocaleStore()` 使用 `system.*` 键。
|
|
4
4
|
|
|
5
5
|
| 文件 | 用途 | 使用位置 |
|
|
6
6
|
| --- | --- | --- |
|
|
7
7
|
| `zh-CN.json` | System 模块简体中文固定 UI 默认语言包,也是所有语言键集合和占位符校验基准。 | 管理端固定文案默认语言及缺失翻译回退。 |
|
|
8
8
|
| `zh-TW.json` | System 模块繁体中文语言包。 | 管理端切换为繁体中文时由 Vue I18n 使用。 |
|
|
9
9
|
| `en-US.json` | System 模块英文语言包。 | 管理端切换为英文时由 Vue I18n 使用。 |
|
|
10
|
+
| `ja-JP.json` | System 模块日文语言包。 | 管理端切换为日文时由 Vue I18n 使用。 |
|
|
10
11
|
|
|
11
12
|
## 命名空间与使用位置
|
|
12
13
|
|
|
13
14
|
| 命名空间 | 文案范围 | 主要使用位置 |
|
|
14
15
|
| --- | --- | --- |
|
|
15
16
|
| `common.*` | 跨页面复用的操作、字段、弹窗、状态和校验文案。 | `src/views/**` 下的列表页、表单和确认弹窗。 |
|
|
16
|
-
| `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`。 |
|
|
17
18
|
| `system.profile.*` | 个人资料、安全设置和用户中心导航。 | `src/views/profile/**`、`src/module.ts` 的用户菜单。 |
|
|
18
19
|
| `system.base.*` | 区域、配置、部门、字典、岗位、角色、租户、用户等基础管理页面。 | `src/views/base/**`。 |
|
|
20
|
+
| `system.base.oauth_client.*` | 开放授权客户端字段、凭据和 API 选择。 | `src/views/base/oauth-client/**`。 |
|
|
19
21
|
| `system.code.gen.*` | 代码生成配置、预览、列配置和多语言编辑。 | `src/views/tool/code-gen/**`。 |
|
|
22
|
+
| `system.cache.*` | 运行时缓存查询、分页结果和条目详情。 | `src/views/tool/cache/**`。 |
|
|
20
23
|
| `system.i18n.*` | 动态翻译编辑、草稿生成和语言包状态。 | `src/components/DynamicI18nEditor.vue`、代码生成语言编辑组件。 |
|
|
21
24
|
|
|
22
25
|
语言包由生成的 `generated.ts` 传入 `systemAdminModule.messages`,由 core 的 `registerLocaleMessages` 校验语言键集合、命名空间和占位符后注册到 Vue I18n;业务代码统一使用 `t('system....')` 或 `useLocaleStore()` 读取。
|
|
23
26
|
|
|
24
27
|
语言键按文案归属使用 `common.` 或 `system.` 命名空间;语言包保持标准 JSON,不在文件内写注释。
|
|
25
28
|
|
|
26
|
-
新增语言的完整文件清单和迁移流程见[国际化语言扩展指南](
|
|
29
|
+
新增语言的完整文件清单和迁移流程见[国际化语言扩展指南](../../../../../../../docs/国际化语言扩展指南.md)。
|