@liujitcn/kratos-admin-system 0.0.31 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -20
- package/dist/package/declarations/src/api/base/{notification.d.ts → v1/notification.d.ts} +3 -1
- 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_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/{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_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_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/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/ChangePasswordForm.vue.d.ts +3 -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/{AuditLogTable.vue.d.ts → LogTable.vue.d.ts} +14 -7
- 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 +1084 -500
- package/dist/package/declarations/src/rpc/base/v1/login.d.ts +5 -3
- package/dist/package/declarations/src/rpc/base/v1/notification.d.ts +25 -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_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_job.d.ts +5 -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 +77 -0
- 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 +169 -41
- 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_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 +15 -0
- 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/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/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/login-policy/format.d.ts +2 -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/tool/cache/index.vue.d.ts +3 -0
- package/dist/package/src/api/base/v1/notification.ts +99 -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_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/{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/{base_message.ts → admin/v1/base_message.ts} +29 -9
- package/dist/package/src/api/system/{base_message_category.ts → admin/v1/base_message_category.ts} +30 -7
- 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_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/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 +112 -7
- 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 +2 -1
- package/dist/package/src/locales/en-US.json +285 -127
- package/dist/package/src/locales/ja-JP.json +285 -127
- package/dist/package/src/locales/zh-CN.json +285 -127
- package/dist/package/src/locales/zh-TW.json +285 -127
- package/dist/package/src/module.ts +3 -1
- package/dist/package/src/rpc/base/v1/login.ts +4 -2
- package/dist/package/src/rpc/base/v1/notification.ts +28 -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_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_job.ts +5 -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 +90 -0
- 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 +191 -42
- 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_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 +15 -0
- 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/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 +2 -4
- 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 +3 -8
- package/dist/package/src/views/base/api/index.vue +4 -4
- package/dist/package/src/views/base/api-log/index.vue +56 -45
- 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 +16 -25
- package/dist/package/src/views/base/dashboard/index.vue +68 -66
- package/dist/package/src/views/base/data-access-log/index.vue +64 -52
- package/dist/package/src/views/base/dept/index.vue +11 -11
- package/dist/package/src/views/base/dict/index.vue +5 -5
- package/dist/package/src/views/base/dict/item.vue +12 -12
- package/dist/package/src/views/base/file/index.vue +220 -16
- package/dist/package/src/views/base/job/index.vue +5 -5
- package/dist/package/src/views/base/job/log.vue +38 -11
- package/dist/package/src/views/base/language/index.vue +1 -1
- package/dist/package/src/views/base/login-log/index.vue +49 -45
- package/dist/package/src/views/base/login-policy/format.ts +4 -0
- package/dist/package/src/views/base/login-policy/index.vue +496 -185
- package/dist/package/src/views/base/menu/index.vue +17 -17
- package/dist/package/src/views/base/message/index.vue +149 -19
- package/dist/package/src/views/base/message-category/index.vue +41 -10
- package/dist/package/src/views/base/migration/index.vue +2 -2
- package/dist/package/src/views/base/oauth-client/index.vue +19 -9
- package/dist/package/src/views/base/operation-log/index.vue +54 -50
- package/dist/package/src/views/base/permission-log/index.vue +57 -52
- package/dist/package/src/views/base/policy-evaluation-log/index.vue +61 -50
- 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 +38 -11
- package/dist/package/src/views/profile/components/base.vue +84 -8
- package/dist/package/src/views/profile/components/password.vue +2 -228
- package/dist/package/src/views/profile/components/security.vue +3 -3
- package/dist/package/src/views/profile/components/session.vue +10 -2
- package/dist/package/src/views/profile/index.vue +10 -9
- 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 +2 -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 +31 -96
- 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_audit_log.d.ts +0 -55
- package/dist/package/declarations/src/api/system/base_dict.d.ts +0 -32
- package/dist/package/declarations/src/api/system/base_login_policy.d.ts +0 -10
- package/dist/package/declarations/src/components/auditLog.d.ts +0 -9
- package/dist/package/declarations/src/rpc/system/admin/v1/base_audit_log.d.ts +0 -640
- package/dist/package/src/api/base/notification.ts +0 -69
- package/dist/package/src/api/system/base_audit_log.ts +0 -168
- package/dist/package/src/api/system/base_login_policy.ts +0 -32
- package/dist/package/src/components/AuditLogTable.vue +0 -105
- package/dist/package/src/components/auditLog.ts +0 -46
- package/dist/package/src/rpc/system/admin/v1/base_audit_log.ts +0 -737
- /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_dashboard.d.ts → admin/v1/base_dashboard.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_file.d.ts → admin/v1/base_file.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_message.d.ts → admin/v1/base_message.d.ts} +0 -0
- /package/dist/package/declarations/src/api/system/{base_message_category.d.ts → admin/v1/base_message_category.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_session.d.ts → admin/v1/base_session.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/{oauth_client.d.ts → admin/v1/oauth_client.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/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/base/{sse.ts → v1/sse.ts} +0 -0
- /package/dist/package/src/api/system/{auth.ts → admin/v1/auth.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_dashboard.ts → admin/v1/base_dashboard.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_file.ts → admin/v1/base_file.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_session.ts → admin/v1/base_session.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/{oauth_client.ts → admin/v1/oauth_client.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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<LogTable ref="page" :config="config" />
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script setup lang="ts">
|
|
@@ -7,66 +7,77 @@ import { computed, ref } from "vue";
|
|
|
7
7
|
import type { ColumnProps } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
8
8
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
9
9
|
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
import LogTable, { type LogTableConfig } from "@liujitcn/kratos-admin-system/components/LogTable.vue";
|
|
11
|
+
import {
|
|
12
|
+
createLogEnumOptions,
|
|
13
|
+
formatLogBytes,
|
|
14
|
+
formatLogDuration,
|
|
15
|
+
formatLogStatusCode,
|
|
16
|
+
logDateSearch,
|
|
17
|
+
logDetailColumn,
|
|
18
|
+
logEnumLabel,
|
|
19
|
+
requestLogTrace
|
|
20
|
+
} from "@liujitcn/kratos-admin-system/components/log";
|
|
21
|
+
import { defBaseApiLogService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_api_log";
|
|
22
|
+
import { BaseLogResult } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_log";
|
|
23
|
+
import type { BaseApiLog, PageBaseApiLogRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_api_log";
|
|
15
24
|
|
|
16
25
|
defineOptions({ name: "BaseApiLog", inheritAttrs: false });
|
|
17
26
|
|
|
18
|
-
const page = ref<InstanceType<typeof
|
|
27
|
+
const page = ref<InstanceType<typeof LogTable>>();
|
|
19
28
|
const resultOptions = computed(() =>
|
|
20
|
-
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
29
|
+
createLogEnumOptions([
|
|
30
|
+
[BaseLogResult.BASE_LOG_RESULT_UNSPECIFIED, t("system.base.log.result.unspecified")],
|
|
31
|
+
[BaseLogResult.BASE_LOG_RESULT_SUCCESS, t("system.base.log.result.success")],
|
|
32
|
+
[BaseLogResult.BASE_LOG_RESULT_FAILURE, t("system.base.log.result.failure")],
|
|
33
|
+
[BaseLogResult.BASE_LOG_RESULT_ERROR, t("system.base.log.result.error")]
|
|
24
34
|
])
|
|
25
35
|
);
|
|
26
36
|
const columns = computed<ColumnProps[]>(() => [
|
|
27
|
-
{ prop: "operation", label: t("system.base.
|
|
28
|
-
{ prop: "method", label: t("system.base.
|
|
29
|
-
{ prop: "status_code", label: t("system.base.
|
|
37
|
+
{ prop: "operation", label: t("system.base.log.field.operation"), minWidth: 320, search: { el: "input" } },
|
|
38
|
+
{ prop: "method", label: t("system.base.log.field.method"), minWidth: 90 },
|
|
39
|
+
{ prop: "status_code", label: t("system.base.log.field.status_code"), minWidth: 100 },
|
|
30
40
|
{
|
|
31
41
|
prop: "result",
|
|
32
|
-
label: t("system.base.
|
|
42
|
+
label: t("system.base.log.field.result"),
|
|
33
43
|
minWidth: 110,
|
|
34
44
|
search: { el: "select", enum: resultOptions.value },
|
|
35
|
-
render: scope =>
|
|
45
|
+
render: scope => logEnumLabel(resultOptions.value, (scope.row as BaseApiLog).result)
|
|
36
46
|
},
|
|
37
|
-
{ prop: "latency_ms", label: t("system.base.
|
|
38
|
-
{ prop: "user_name", label: t("system.base.
|
|
39
|
-
{ prop: "occurred_at", label: t("system.base.
|
|
40
|
-
|
|
47
|
+
{ prop: "latency_ms", label: t("system.base.log.field.latency_ms"), minWidth: 110 },
|
|
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))
|
|
41
51
|
]);
|
|
42
52
|
|
|
43
|
-
const config = computed<
|
|
53
|
+
const config = computed<LogTableConfig>(() => ({
|
|
44
54
|
columns: columns.value,
|
|
45
|
-
detailTitle: t("system.base.
|
|
55
|
+
detailTitle: t("system.base.log.api.title.detail"),
|
|
46
56
|
closeText: t("common.action.close"),
|
|
57
|
+
trace: requestLogTrace,
|
|
47
58
|
detailFields: [
|
|
48
|
-
{ key: "id", label: t("system.base.
|
|
49
|
-
{ key: "tenant_id", label: t("system.base.
|
|
50
|
-
{ key: "tenant_code", label: t("system.base.
|
|
51
|
-
{ key: "user_id", label: t("system.base.
|
|
52
|
-
{ key: "user_name", label: t("system.base.
|
|
53
|
-
{ key: "service_name", label: t("system.base.
|
|
54
|
-
{ key: "operation", label: t("system.base.
|
|
55
|
-
{ key: "method", label: t("system.base.
|
|
56
|
-
{ key: "path", label: t("system.base.
|
|
57
|
-
{ key: "status_code", label: t("system.base.
|
|
58
|
-
{ key: "result", label: t("system.base.
|
|
59
|
-
{ key: "reason_code", label: t("system.base.
|
|
60
|
-
{ key: "reason", label: t("system.base.
|
|
61
|
-
{ key: "latency_ms", label: t("system.base.
|
|
62
|
-
{ key: "request_size", label: t("system.base.
|
|
63
|
-
{ key: "response_size", label: t("system.base.
|
|
64
|
-
{ key: "client_ip", label: t("system.base.
|
|
65
|
-
{ key: "user_agent", label: t("system.base.
|
|
66
|
-
{ key: "request_id", label: t("system.base.
|
|
67
|
-
{ key: "trace_id", label: t("system.base.
|
|
68
|
-
{ key: "occurred_at", label: t("system.base.
|
|
69
|
-
{ key: "created_at", label: t("system.base.
|
|
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: "service_name", label: t("system.base.log.field.service_name") },
|
|
65
|
+
{ key: "operation", label: t("system.base.log.field.operation"), span: 2 },
|
|
66
|
+
{ key: "method", label: t("system.base.log.field.method") },
|
|
67
|
+
{ key: "path", label: t("system.base.log.field.path"), span: 2 },
|
|
68
|
+
{ key: "status_code", label: t("system.base.log.field.status_code"), format: value => formatLogStatusCode(value, t) },
|
|
69
|
+
{ key: "result", label: t("system.base.log.field.result"), enum: resultOptions.value },
|
|
70
|
+
{ key: "reason_code", label: t("system.base.log.field.reason_code") },
|
|
71
|
+
{ key: "reason", label: t("system.base.log.field.reason"), span: 2 },
|
|
72
|
+
{ key: "latency_ms", label: t("system.base.log.field.latency_ms"), format: value => formatLogDuration(value, t) },
|
|
73
|
+
{ key: "request_size", label: t("system.base.log.field.request_size"), format: value => formatLogBytes(value, t) },
|
|
74
|
+
{ key: "response_size", label: t("system.base.log.field.response_size"), format: value => formatLogBytes(value, t) },
|
|
75
|
+
{ key: "client_ip", label: t("system.base.log.field.client_ip") },
|
|
76
|
+
{ key: "user_agent", label: t("system.base.log.field.user_agent"), span: 2 },
|
|
77
|
+
{ key: "request_id", label: t("system.base.log.field.request_id") },
|
|
78
|
+
{ key: "trace_id", label: t("system.base.log.field.trace_id") },
|
|
79
|
+
{ key: "occurred_at", label: t("system.base.log.field.occurred_at") },
|
|
80
|
+
{ key: "created_at", label: t("system.base.log.field.created_at") }
|
|
70
81
|
],
|
|
71
82
|
request: requestTable,
|
|
72
83
|
get: getDetail
|
|
@@ -77,7 +88,7 @@ async function requestTable(params: Record<string, unknown>) {
|
|
|
77
88
|
return { list: response.base_api_logs as unknown as Record<string, unknown>[], total: response.total };
|
|
78
89
|
}
|
|
79
90
|
|
|
80
|
-
async function getDetail(id:
|
|
91
|
+
async function getDetail(id: string) {
|
|
81
92
|
return (await defBaseApiLogService.GetBaseApiLog({ id })) as unknown as Record<string, unknown>;
|
|
82
93
|
}
|
|
83
94
|
</script>
|
|
@@ -38,7 +38,7 @@ import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
|
38
38
|
import FormDialog from "@liujitcn/kratos-admin-core/components/Dialog/FormDialog.vue";
|
|
39
39
|
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
40
40
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
41
|
-
import { defBaseAreaService } from "@liujitcn/kratos-admin-system/api/system/base_area";
|
|
41
|
+
import { defBaseAreaService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_area";
|
|
42
42
|
|
|
43
43
|
import type { TreeBaseAreaRequest, BaseArea, BaseAreaForm } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_area";
|
|
44
44
|
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-box">
|
|
3
|
+
<ProTable ref="proTable" row-key="id" :columns="columns" :header-actions="headerActions" :request-api="requestTable" />
|
|
4
|
+
<FormDialog
|
|
5
|
+
ref="formDialogRef"
|
|
6
|
+
v-model="dialog.visible"
|
|
7
|
+
:title="t(dialog.editing ? 'common.action.edit_resource' : 'common.action.create_resource', { resource: t('system.backup.archive.config') })"
|
|
8
|
+
:model="formData"
|
|
9
|
+
:fields="formFields"
|
|
10
|
+
:rules="formRules"
|
|
11
|
+
@confirm="handleSubmit"
|
|
12
|
+
@close="resetForm"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
import { computed, reactive, ref } from "vue";
|
|
19
|
+
import { CirclePlus, Delete, EditPen } from "@element-plus/icons-vue";
|
|
20
|
+
import { ElMessage, ElMessageBox } from "element-plus";
|
|
21
|
+
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
22
|
+
import FormDialog from "@liujitcn/kratos-admin-core/components/Dialog/FormDialog.vue";
|
|
23
|
+
import type { ColumnProps, HeaderActionProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
24
|
+
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
25
|
+
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
26
|
+
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
27
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
28
|
+
import { defBaseTableArchiveService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_archive";
|
|
29
|
+
import { defBaseTableSourceService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_source";
|
|
30
|
+
import { BaseTableArchiveMode, type BaseTableArchiveForm, type PageBaseTableArchiveRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_table_archive";
|
|
31
|
+
import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
|
|
32
|
+
|
|
33
|
+
defineOptions({ name: "BaseTableArchiveConfig", inheritAttrs: false });
|
|
34
|
+
const { BUTTONS } = useAuthButtons();
|
|
35
|
+
const proTable = ref<ProTableInstance>();
|
|
36
|
+
const formDialogRef = ref<InstanceType<typeof FormDialog>>();
|
|
37
|
+
const dialog = reactive({ visible: false, editing: false });
|
|
38
|
+
const formData = reactive<BaseTableArchiveForm>(defaultForm());
|
|
39
|
+
const sourceOptions = ref<ProFormOption[]>([]);
|
|
40
|
+
const tableOptions = ref<ProFormOption[]>([]);
|
|
41
|
+
const loadingSources = ref(false);
|
|
42
|
+
const loadingTables = ref(false);
|
|
43
|
+
const modeOptions = computed<ProFormOption[]>(() => [
|
|
44
|
+
{ label: t("system.backup.archive.mode.internal"), value: BaseTableArchiveMode.BASE_TABLE_ARCHIVE_MODE_INTERNAL_DATABASE },
|
|
45
|
+
{ label: t("system.backup.archive.mode.oss"), value: BaseTableArchiveMode.BASE_TABLE_ARCHIVE_MODE_OSS }
|
|
46
|
+
]);
|
|
47
|
+
const statusOptions = computed<ProFormOption[]>(() => [
|
|
48
|
+
{ label: t("common.status.enabled"), value: Status.STATUS_ENABLE },
|
|
49
|
+
{ label: t("common.status.disabled"), value: Status.STATUS_DISABLE }
|
|
50
|
+
]);
|
|
51
|
+
const formFields = computed<ProFormField[]>(() => [
|
|
52
|
+
{ prop: "source_name", label: t("system.backup.field.source_name"), component: "select", options: sourceOptions.value, props: { loading: loadingSources.value, filterable: true, placeholder: t("system.backup.placeholder.source_name"), onChange: handleSourceChange } },
|
|
53
|
+
{ prop: "table_name", label: t("system.backup.field.table_name"), component: "select", options: tableOptions.value, props: { loading: loadingTables.value, filterable: true, placeholder: t("system.backup.placeholder.table_name"), disabled: !formData.source_name } },
|
|
54
|
+
{ prop: "archive_mode", label: t("system.backup.field.archive_mode"), component: "select", options: modeOptions.value },
|
|
55
|
+
{ prop: "online_retention_days", label: t("system.backup.field.online_retention_days"), component: "input-number", props: { min: 0, max: 36500 } },
|
|
56
|
+
{ prop: "archive_retention_days", label: t("system.backup.field.archive_retention_days"), component: "input-number", props: { min: 0, max: 36500 } },
|
|
57
|
+
{ prop: "batch_size", label: t("system.backup.field.batch_size"), component: "input-number", props: { min: 1, max: 100000 } },
|
|
58
|
+
{ prop: "delete_after_verify", label: t("system.backup.field.delete_after_verify"), component: "switch" },
|
|
59
|
+
{ prop: "oss_prefix", label: t("system.backup.field.oss_prefix"), component: "input" },
|
|
60
|
+
{ prop: "status", label: t("common.field.status"), component: "radio-group", options: statusOptions.value }
|
|
61
|
+
]);
|
|
62
|
+
const formRules = computed(() => ({
|
|
63
|
+
source_name: [{ required: true, message: t("system.backup.validation.source_name"), trigger: "change" }],
|
|
64
|
+
table_name: [{ required: true, message: t("system.backup.validation.table_name"), trigger: "change" }]
|
|
65
|
+
}));
|
|
66
|
+
const columns = computed<ColumnProps[]>(() => [
|
|
67
|
+
{ type: "selection", width: 55 },
|
|
68
|
+
{ prop: "source_name", label: t("system.backup.field.source_name"), minWidth: 140 },
|
|
69
|
+
{ prop: "table_name", label: t("system.backup.field.table_name"), minWidth: 180 },
|
|
70
|
+
{ prop: "archive_mode", label: t("system.backup.field.archive_mode"), minWidth: 130, render: scope => modeLabel(scope.row.archive_mode) },
|
|
71
|
+
{ prop: "online_retention_days", label: t("system.backup.field.online_retention_days"), width: 120 },
|
|
72
|
+
{ prop: "archive_retention_days", label: t("system.backup.field.archive_retention_days"), width: 120 },
|
|
73
|
+
{ prop: "status", label: t("common.field.status"), width: 100, cellType: "status", statusProps: { activeValue: Status.STATUS_ENABLE, inactiveValue: Status.STATUS_DISABLE, activeText: t("common.status.enabled"), inactiveText: t("common.status.disabled"), disabled: () => !BUTTONS.value["base:table-archive:status"], beforeChange: scope => setStatus(scope.row as BaseTableArchiveForm) } },
|
|
74
|
+
{ prop: "operation", label: t("common.field.operation"), width: 180, fixed: "right", cellType: "actions", actions: [{ label: t("common.action.edit"), link: true, icon: EditPen, hidden: () => !BUTTONS.value["base:table-archive:update"], onClick: scope => openDialog((scope.row as BaseTableArchiveForm).id) }, { label: t("common.action.delete"), link: true, type: "danger", icon: Delete, hidden: () => !BUTTONS.value["base:table-archive:delete"], onClick: scope => remove(scope.row as BaseTableArchiveForm) }] }
|
|
75
|
+
]);
|
|
76
|
+
const headerActions = computed<HeaderActionProps[]>(() => [{ label: t("common.action.create"), type: "primary", icon: CirclePlus, hidden: !BUTTONS.value["base:table-archive:create"], onClick: () => openDialog() }, { label: t("common.action.delete"), type: "danger", icon: Delete, hidden: !BUTTONS.value["base:table-archive:delete"], disabled: scope => !scope.isSelected, onClick: scope => remove(scope.selectedListIds as number[]) }]);
|
|
77
|
+
|
|
78
|
+
async function requestTable(params: PageBaseTableArchiveRequest) {
|
|
79
|
+
const data = await defBaseTableArchiveService.PageBaseTableArchive(buildPageRequest(params));
|
|
80
|
+
return { data: { list: data.base_table_archives ?? [], total: data.total } };
|
|
81
|
+
}
|
|
82
|
+
function refresh() { proTable.value?.getTableList(); }
|
|
83
|
+
function defaultForm(): BaseTableArchiveForm { return { id: 0, source_name: "", table_name: "", archive_mode: BaseTableArchiveMode.BASE_TABLE_ARCHIVE_MODE_INTERNAL_DATABASE, online_retention_days: 180, archive_retention_days: 3650, batch_size: 5000, delete_after_verify: false, oss_prefix: "archive", status: Status.STATUS_ENABLE }; }
|
|
84
|
+
function resetForm() { dialog.visible = false; formDialogRef.value?.resetFields(); Object.assign(formData, defaultForm()); }
|
|
85
|
+
async function openDialog(id?: number) {
|
|
86
|
+
await loadSourceOptions();
|
|
87
|
+
Object.assign(formData, defaultForm());
|
|
88
|
+
dialog.editing = Boolean(id);
|
|
89
|
+
if (id) Object.assign(formData, await defBaseTableArchiveService.GetBaseTableArchive({ id }));
|
|
90
|
+
if (!formData.source_name) formData.source_name = String(sourceOptions.value[0]?.value ?? "");
|
|
91
|
+
await loadTableOptions(formData.source_name);
|
|
92
|
+
dialog.visible = true;
|
|
93
|
+
}
|
|
94
|
+
async function loadSourceOptions() {
|
|
95
|
+
if (sourceOptions.value.length || loadingSources.value) return;
|
|
96
|
+
loadingSources.value = true;
|
|
97
|
+
try {
|
|
98
|
+
const data = await defBaseTableSourceService.OptionBaseTableSource({});
|
|
99
|
+
sourceOptions.value = (data.value ?? []).map(value => ({ label: value, value }));
|
|
100
|
+
} finally {
|
|
101
|
+
loadingSources.value = false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async function handleSourceChange(value: string | number | boolean | undefined) {
|
|
105
|
+
formData.source_name = String(value ?? "");
|
|
106
|
+
formData.table_name = "";
|
|
107
|
+
await loadTableOptions(formData.source_name);
|
|
108
|
+
}
|
|
109
|
+
async function loadTableOptions(sourceName: string) {
|
|
110
|
+
tableOptions.value = [];
|
|
111
|
+
if (!sourceName) return;
|
|
112
|
+
loadingTables.value = true;
|
|
113
|
+
try {
|
|
114
|
+
const data = await defBaseTableSourceService.OptionBaseTable({ source_name: sourceName });
|
|
115
|
+
tableOptions.value = (data.value ?? []).map(value => ({ label: value, value }));
|
|
116
|
+
} finally {
|
|
117
|
+
loadingTables.value = false;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async function handleSubmit() { const valid = await formDialogRef.value?.validate(); if (!valid) return; const payload = JSON.parse(JSON.stringify(formData)) as BaseTableArchiveForm; if (payload.id) await defBaseTableArchiveService.UpdateBaseTableArchive({ base_table_archive: payload }); else await defBaseTableArchiveService.CreateBaseTableArchive({ base_table_archive: payload }); ElMessage.success(t("common.message.save_success")); resetForm(); refresh(); }
|
|
121
|
+
/** 确认并切换归档配置状态。 */
|
|
122
|
+
async function setStatus(row: BaseTableArchiveForm) {
|
|
123
|
+
const status = row.status === Status.STATUS_ENABLE ? Status.STATUS_DISABLE : Status.STATUS_ENABLE;
|
|
124
|
+
const action = t(status === Status.STATUS_ENABLE ? "common.status.enabled" : "common.status.disabled");
|
|
125
|
+
const name = row.table_name || row.source_name || `ID:${row.id}`;
|
|
126
|
+
try {
|
|
127
|
+
await ElMessageBox.confirm(
|
|
128
|
+
t("common.dialog.status_change", {
|
|
129
|
+
action,
|
|
130
|
+
resource: t("system.backup.archive.config"),
|
|
131
|
+
field: t("system.backup.field.table_name"),
|
|
132
|
+
value: name
|
|
133
|
+
}),
|
|
134
|
+
t("common.title.notice"),
|
|
135
|
+
{
|
|
136
|
+
confirmButtonText: t("common.action.confirm"),
|
|
137
|
+
cancelButtonText: t("common.action.cancel"),
|
|
138
|
+
type: "warning"
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
await defBaseTableArchiveService.SetBaseTableArchiveStatus({ id: row.id, status });
|
|
142
|
+
ElMessage.success(t("common.message.status_success", { action }));
|
|
143
|
+
await proTable.value?.getTableList();
|
|
144
|
+
return true;
|
|
145
|
+
} catch {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
async function remove(selected: number | number[] | BaseTableArchiveForm) { let ids: number[]; if (Array.isArray(selected)) ids = selected.map(Number); else if (typeof selected === "object") ids = [selected.id]; else ids = normalizeSelectedIds(selected).map(Number); if (!ids.length) return; await ElMessageBox.confirm(t("common.dialog.delete_selected", { resource: t("system.backup.archive.config") }), t("common.title.warning"), { type: "warning" }); await defBaseTableArchiveService.DeleteBaseTableArchive({ id: ids.join(",") }); ElMessage.success(t("common.message.delete_success", { resource: t("system.backup.archive.config") })); refresh(); }
|
|
150
|
+
function modeLabel(value: BaseTableArchiveMode) { return modeOptions.value.find(item => item.value === value)?.label ?? String(value); }
|
|
151
|
+
</script>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-box">
|
|
3
|
+
<ProTable ref="proTable" row-key="id" :columns="columns" :request-api="requestTable" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { computed, ref } from "vue";
|
|
9
|
+
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
10
|
+
import type { ColumnProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
11
|
+
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
12
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
13
|
+
import { defBaseTableArchiveRecordService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_archive_record";
|
|
14
|
+
import { BaseTableArchiveMode } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_table_archive";
|
|
15
|
+
import { BaseTableArchiveRecordStatus, type PageBaseTableArchiveRecordRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_table_archive_record";
|
|
16
|
+
|
|
17
|
+
defineOptions({ name: "BaseTableArchiveRecord", inheritAttrs: false });
|
|
18
|
+
const proTable = ref<ProTableInstance>();
|
|
19
|
+
const statusOptions = computed(() => [
|
|
20
|
+
{ label: t("system.backup.status.running"), value: BaseTableArchiveRecordStatus.BASE_TABLE_ARCHIVE_RECORD_STATUS_RUNNING },
|
|
21
|
+
{ label: t("system.backup.status.success"), value: BaseTableArchiveRecordStatus.BASE_TABLE_ARCHIVE_RECORD_STATUS_SUCCESS },
|
|
22
|
+
{ label: t("system.backup.status.failed"), value: BaseTableArchiveRecordStatus.BASE_TABLE_ARCHIVE_RECORD_STATUS_FAILED },
|
|
23
|
+
{ label: t("system.backup.status.deleted"), value: BaseTableArchiveRecordStatus.BASE_TABLE_ARCHIVE_RECORD_STATUS_DELETED }
|
|
24
|
+
]);
|
|
25
|
+
const columns = computed<ColumnProps[]>(() => [
|
|
26
|
+
{ prop: "id", label: t("system.backup.field.id"), width: 90 },
|
|
27
|
+
{ prop: "source_name", label: t("system.backup.field.source_name"), minWidth: 140 },
|
|
28
|
+
{ prop: "table_name", label: t("system.backup.field.table_name"), minWidth: 180 },
|
|
29
|
+
{ prop: "archive_mode", label: t("system.backup.field.archive_mode"), width: 130, render: scope => scope.row.archive_mode === BaseTableArchiveMode.BASE_TABLE_ARCHIVE_MODE_INTERNAL_DATABASE ? t("system.backup.archive.mode.internal") : t("system.backup.archive.mode.oss") },
|
|
30
|
+
{ prop: "cutoff_at", label: t("system.backup.field.cutoff_at"), minWidth: 170 },
|
|
31
|
+
{ prop: "archived_rows", label: t("system.backup.field.archived_rows"), width: 110 },
|
|
32
|
+
{ prop: "deleted_rows", label: t("system.backup.field.deleted_rows"), width: 110 },
|
|
33
|
+
{ prop: "object_key", label: t("system.backup.field.object_key"), minWidth: 220 },
|
|
34
|
+
{ prop: "status", label: t("common.field.status"), width: 110, search: { el: "select", enum: statusOptions.value }, render: scope => statusOptions.value.find(item => item.value === scope.row.status)?.label ?? String(scope.row.status) },
|
|
35
|
+
{ prop: "started_at", label: t("system.backup.field.started_at"), minWidth: 170 },
|
|
36
|
+
{ prop: "finished_at", label: t("system.backup.field.finished_at"), minWidth: 170 }
|
|
37
|
+
]);
|
|
38
|
+
|
|
39
|
+
/** 请求归档记录分页列表。 */
|
|
40
|
+
async function requestTable(params: PageBaseTableArchiveRecordRequest) {
|
|
41
|
+
const data = await defBaseTableArchiveRecordService.PageBaseTableArchiveRecord(buildPageRequest(params));
|
|
42
|
+
return { data: { list: data.base_table_archive_records ?? [], total: data.total } };
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-box">
|
|
3
|
+
<ProTable ref="proTable" row-key="id" :columns="columns" :request-api="requestTable" />
|
|
4
|
+
<el-card class="restore-card">
|
|
5
|
+
<template #header>{{ t("system.backup.archive.restore.manual") }}</template>
|
|
6
|
+
<ProForm ref="formRef" :model="formData" :fields="formFields" :rules="formRules" label-width="160px" />
|
|
7
|
+
<el-button v-if="BUTTONS['base:table-archive-restore:execute']" type="primary" :loading="submitting" @click="submitRestore">{{ t("system.backup.action.restore") }}</el-button>
|
|
8
|
+
</el-card>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
import { computed, reactive, ref } from "vue";
|
|
14
|
+
import { ElMessage } from "element-plus";
|
|
15
|
+
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
16
|
+
import ProForm from "@liujitcn/kratos-admin-core/components/ProForm/index.vue";
|
|
17
|
+
import type { ColumnProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
18
|
+
import type { ProFormField, ProFormInstance, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
19
|
+
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
20
|
+
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
21
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
22
|
+
import { defBaseTableArchiveRestoreService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_archive_restore";
|
|
23
|
+
import { BaseTableArchiveRestoreMode, BaseTableArchiveRestoreStatus, type BaseTableArchiveRestore } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_table_archive_restore";
|
|
24
|
+
|
|
25
|
+
defineOptions({ name: "BaseTableArchiveRestore", inheritAttrs: false });
|
|
26
|
+
const proTable = ref<ProTableInstance>();
|
|
27
|
+
const { BUTTONS } = useAuthButtons();
|
|
28
|
+
const formRef = ref<ProFormInstance>();
|
|
29
|
+
const submitting = ref(false);
|
|
30
|
+
const formData = reactive<BaseTableArchiveRestore>({ id: 0, archive_record_id: 0, table_name: "", restore_mode: BaseTableArchiveRestoreMode.BASE_TABLE_ARCHIVE_RESTORE_MODE_ALL, restore_range: "", restored_rows: 0, operator_id: 0, status: BaseTableArchiveRestoreStatus.BASE_TABLE_ARCHIVE_RESTORE_STATUS_PENDING, error: "", started_at: "", finished_at: "" });
|
|
31
|
+
const modeOptions = computed<ProFormOption[]>(() => [{ label: t("system.backup.restore.mode.all"), value: BaseTableArchiveRestoreMode.BASE_TABLE_ARCHIVE_RESTORE_MODE_ALL }, { label: t("system.backup.restore.mode.selected"), value: BaseTableArchiveRestoreMode.BASE_TABLE_ARCHIVE_RESTORE_MODE_SELECTED }]);
|
|
32
|
+
const formFields = computed<ProFormField[]>(() => [{ prop: "archive_record_id", label: t("system.backup.field.archive_record_id"), component: "input-number", props: { min: 0, precision: 0 } }, { prop: "restore_mode", label: t("system.backup.field.restore_mode"), component: "select", options: modeOptions.value }, { prop: "restore_range", label: t("system.backup.field.restore_range"), component: "input", visible: model => model.restore_mode === BaseTableArchiveRestoreMode.BASE_TABLE_ARCHIVE_RESTORE_MODE_SELECTED, props: { placeholder: '{"start_id":1,"end_id":100}' } }]);
|
|
33
|
+
const formRules = computed(() => ({
|
|
34
|
+
archive_record_id: [
|
|
35
|
+
{ required: true, message: t("system.backup.validation.archive_record_id"), trigger: "blur" },
|
|
36
|
+
{ type: "number", min: 1, message: t("system.backup.validation.archive_record_id_positive"), trigger: "change" }
|
|
37
|
+
]
|
|
38
|
+
}));
|
|
39
|
+
const columns = computed<ColumnProps[]>(() => [{ prop: "id", label: t("system.backup.field.id"), width: 90 }, { prop: "archive_record_id", label: t("system.backup.field.archive_record_id"), width: 130 }, { prop: "table_name", label: t("system.backup.field.table_name"), minWidth: 180 }, { prop: "restore_mode", label: t("system.backup.field.restore_mode"), width: 120, render: scope => modeOptions.value.find(item => item.value === scope.row.restore_mode)?.label ?? String(scope.row.restore_mode) }, { prop: "restored_rows", label: t("system.backup.field.restored_rows"), width: 110 }, { prop: "status", label: t("common.field.status"), width: 110 }, { prop: "error", label: t("system.backup.field.error"), minWidth: 220 }, { prop: "started_at", label: t("system.backup.field.started_at"), minWidth: 170 }, { prop: "finished_at", label: t("system.backup.field.finished_at"), minWidth: 170 }]);
|
|
40
|
+
|
|
41
|
+
/** 请求归档恢复记录分页列表。 */
|
|
42
|
+
async function requestTable(params: Record<string, unknown>) { const data = await defBaseTableArchiveRestoreService.PageBaseTableArchiveRestore(buildPageRequest(params)); return { data: { list: data.base_table_archive_restores ?? [], total: data.total } }; }
|
|
43
|
+
/** 手工提交归档恢复请求。 */
|
|
44
|
+
async function submitRestore() {
|
|
45
|
+
if (!(await formRef.value?.validate())) return;
|
|
46
|
+
if (!Number.isInteger(formData.archive_record_id) || formData.archive_record_id < 1) {
|
|
47
|
+
ElMessage.warning(t("system.backup.validation.archive_record_id_positive"));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
submitting.value = true;
|
|
51
|
+
try {
|
|
52
|
+
await defBaseTableArchiveRestoreService.ExecuteBaseTableArchiveRestore({ base_table_archive_restore: { ...formData } });
|
|
53
|
+
ElMessage.success(t("system.backup.message.restore_submitted"));
|
|
54
|
+
proTable.value?.getTableList();
|
|
55
|
+
} finally {
|
|
56
|
+
submitting.value = false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-box">
|
|
3
|
+
<ProTable ref="proTable" row-key="id" :columns="columns" :header-actions="headerActions" :request-api="requestTable" />
|
|
4
|
+
<FormDialog
|
|
5
|
+
ref="formDialogRef"
|
|
6
|
+
v-model="dialog.visible"
|
|
7
|
+
:title="t(dialog.editing ? 'common.action.edit_resource' : 'common.action.create_resource', { resource: t('system.backup.backup.config') })"
|
|
8
|
+
:model="formData"
|
|
9
|
+
:fields="formFields"
|
|
10
|
+
:rules="formRules"
|
|
11
|
+
@confirm="handleSubmit"
|
|
12
|
+
@close="resetForm"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
import { computed, reactive, ref } from "vue";
|
|
19
|
+
import { CirclePlus, Delete, EditPen } from "@element-plus/icons-vue";
|
|
20
|
+
import { ElMessage, ElMessageBox } from "element-plus";
|
|
21
|
+
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
22
|
+
import FormDialog from "@liujitcn/kratos-admin-core/components/Dialog/FormDialog.vue";
|
|
23
|
+
import type { ColumnProps, HeaderActionProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
24
|
+
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
25
|
+
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
26
|
+
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
27
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
28
|
+
import { defBaseTableBackupService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_backup";
|
|
29
|
+
import { defBaseTableSourceService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_source";
|
|
30
|
+
import { BaseTableBackupType, type BaseTableBackupForm, type PageBaseTableBackupRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_table_backup";
|
|
31
|
+
import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
|
|
32
|
+
|
|
33
|
+
defineOptions({ name: "BaseTableBackupConfig", inheritAttrs: false });
|
|
34
|
+
const { BUTTONS } = useAuthButtons();
|
|
35
|
+
const proTable = ref<ProTableInstance>();
|
|
36
|
+
const formDialogRef = ref<InstanceType<typeof FormDialog>>();
|
|
37
|
+
const dialog = reactive({ visible: false, editing: false });
|
|
38
|
+
const formData = reactive<BaseTableBackupForm>(defaultForm());
|
|
39
|
+
const sourceOptions = ref<ProFormOption[]>([]);
|
|
40
|
+
const loadingSources = ref(false);
|
|
41
|
+
const backupTypeOptions = computed<ProFormOption[]>(() => [{ label: t("system.backup.backup.type.full"), value: BaseTableBackupType.BASE_TABLE_BACKUP_TYPE_FULL }]);
|
|
42
|
+
const statusOptions = computed<ProFormOption[]>(() => [{ label: t("common.status.enabled"), value: Status.STATUS_ENABLE }, { label: t("common.status.disabled"), value: Status.STATUS_DISABLE }]);
|
|
43
|
+
const formFields = computed<ProFormField[]>(() => [
|
|
44
|
+
{ prop: "source_name", label: t("system.backup.field.source_name"), component: "select", options: sourceOptions.value, props: { loading: loadingSources.value, filterable: true, placeholder: t("system.backup.placeholder.source_name") } },
|
|
45
|
+
{ prop: "backup_type", label: t("system.backup.field.backup_type"), component: "select", options: backupTypeOptions.value },
|
|
46
|
+
{ prop: "oss_prefix", label: t("system.backup.field.oss_prefix"), component: "input" },
|
|
47
|
+
{ prop: "retention_count", label: t("system.backup.field.retention_count"), component: "input-number", props: { min: 1, max: 1000 } },
|
|
48
|
+
{ prop: "status", label: t("common.field.status"), component: "radio-group", options: statusOptions.value }
|
|
49
|
+
]);
|
|
50
|
+
const formRules = computed(() => ({ source_name: [{ required: true, message: t("system.backup.validation.source_name"), trigger: "change" }] }));
|
|
51
|
+
const columns = computed<ColumnProps[]>(() => [
|
|
52
|
+
{ type: "selection", width: 55 },
|
|
53
|
+
{ prop: "source_name", label: t("system.backup.field.source_name"), minWidth: 150 },
|
|
54
|
+
{ prop: "backup_type", label: t("system.backup.field.backup_type"), width: 110, render: scope => backupTypeLabel(scope.row.backup_type) },
|
|
55
|
+
{ prop: "oss_prefix", label: t("system.backup.field.oss_prefix"), minWidth: 180 },
|
|
56
|
+
{ prop: "retention_count", label: t("system.backup.field.retention_count"), width: 110 },
|
|
57
|
+
{ prop: "status", label: t("common.field.status"), width: 100, cellType: "status", statusProps: { activeValue: Status.STATUS_ENABLE, inactiveValue: Status.STATUS_DISABLE, activeText: t("common.status.enabled"), inactiveText: t("common.status.disabled"), disabled: () => !BUTTONS.value["base:table-backup:status"], beforeChange: scope => setStatus(scope.row as BaseTableBackupForm) } },
|
|
58
|
+
{ prop: "operation", label: t("common.field.operation"), width: 180, fixed: "right", cellType: "actions", actions: [{ label: t("common.action.edit"), link: true, icon: EditPen, hidden: () => !BUTTONS.value["base:table-backup:update"], onClick: scope => openDialog((scope.row as BaseTableBackupForm).id) }, { label: t("common.action.delete"), link: true, type: "danger", icon: Delete, hidden: () => !BUTTONS.value["base:table-backup:delete"], onClick: scope => remove(scope.row as BaseTableBackupForm) }] }
|
|
59
|
+
]);
|
|
60
|
+
const headerActions = computed<HeaderActionProps[]>(() => [{ label: t("common.action.create"), type: "primary", icon: CirclePlus, hidden: !BUTTONS.value["base:table-backup:create"], onClick: () => openDialog() }, { label: t("common.action.delete"), type: "danger", icon: Delete, hidden: !BUTTONS.value["base:table-backup:delete"], disabled: scope => !scope.isSelected, onClick: scope => remove(scope.selectedListIds as number[]) }]);
|
|
61
|
+
|
|
62
|
+
/** 请求备份配置分页列表。 */
|
|
63
|
+
async function requestTable(params: PageBaseTableBackupRequest) {
|
|
64
|
+
const data = await defBaseTableBackupService.PageBaseTableBackup(buildPageRequest(params));
|
|
65
|
+
return { data: { list: data.base_table_backups ?? [], total: data.total } };
|
|
66
|
+
}
|
|
67
|
+
function refresh() { proTable.value?.getTableList(); }
|
|
68
|
+
function defaultForm(): BaseTableBackupForm { return { id: 0, source_name: "", backup_type: BaseTableBackupType.BASE_TABLE_BACKUP_TYPE_FULL, oss_prefix: "backup/database", retention_count: 7, status: Status.STATUS_ENABLE }; }
|
|
69
|
+
function resetForm() { dialog.visible = false; formDialogRef.value?.resetFields(); Object.assign(formData, defaultForm()); }
|
|
70
|
+
async function openDialog(id?: number) {
|
|
71
|
+
await loadSourceOptions();
|
|
72
|
+
Object.assign(formData, defaultForm());
|
|
73
|
+
dialog.editing = Boolean(id);
|
|
74
|
+
if (id) Object.assign(formData, await defBaseTableBackupService.GetBaseTableBackup({ id }));
|
|
75
|
+
if (!formData.source_name) formData.source_name = String(sourceOptions.value[0]?.value ?? "");
|
|
76
|
+
dialog.visible = true;
|
|
77
|
+
}
|
|
78
|
+
async function loadSourceOptions() {
|
|
79
|
+
if (sourceOptions.value.length || loadingSources.value) return;
|
|
80
|
+
loadingSources.value = true;
|
|
81
|
+
try {
|
|
82
|
+
const data = await defBaseTableSourceService.OptionBaseTableSource({});
|
|
83
|
+
sourceOptions.value = (data.value ?? []).map(value => ({ label: value, value }));
|
|
84
|
+
} finally {
|
|
85
|
+
loadingSources.value = false;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async function handleSubmit() { const valid = await formDialogRef.value?.validate(); if (!valid) return; const payload = JSON.parse(JSON.stringify(formData)) as BaseTableBackupForm; if (payload.id) await defBaseTableBackupService.UpdateBaseTableBackup({ base_table_backup: payload }); else await defBaseTableBackupService.CreateBaseTableBackup({ base_table_backup: payload }); ElMessage.success(t("common.message.save_success")); resetForm(); refresh(); }
|
|
89
|
+
/** 确认并切换备份配置状态。 */
|
|
90
|
+
async function setStatus(row: BaseTableBackupForm) {
|
|
91
|
+
const status = row.status === Status.STATUS_ENABLE ? Status.STATUS_DISABLE : Status.STATUS_ENABLE;
|
|
92
|
+
const action = t(status === Status.STATUS_ENABLE ? "common.status.enabled" : "common.status.disabled");
|
|
93
|
+
const name = row.source_name || `ID:${row.id}`;
|
|
94
|
+
try {
|
|
95
|
+
await ElMessageBox.confirm(
|
|
96
|
+
t("common.dialog.status_change", {
|
|
97
|
+
action,
|
|
98
|
+
resource: t("system.backup.backup.config"),
|
|
99
|
+
field: t("system.backup.field.source_name"),
|
|
100
|
+
value: name
|
|
101
|
+
}),
|
|
102
|
+
t("common.title.notice"),
|
|
103
|
+
{
|
|
104
|
+
confirmButtonText: t("common.action.confirm"),
|
|
105
|
+
cancelButtonText: t("common.action.cancel"),
|
|
106
|
+
type: "warning"
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
await defBaseTableBackupService.SetBaseTableBackupStatus({ id: row.id, status });
|
|
110
|
+
ElMessage.success(t("common.message.status_success", { action }));
|
|
111
|
+
await proTable.value?.getTableList();
|
|
112
|
+
return true;
|
|
113
|
+
} catch {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
async function remove(selected: number | number[] | BaseTableBackupForm) { let ids: number[]; if (Array.isArray(selected)) ids = selected.map(Number); else if (typeof selected === "object") ids = [selected.id]; else ids = normalizeSelectedIds(selected).map(Number); if (!ids.length) return; await ElMessageBox.confirm(t("common.dialog.delete_selected", { resource: t("system.backup.backup.config") }), t("common.title.warning"), { type: "warning" }); await defBaseTableBackupService.DeleteBaseTableBackup({ id: ids.join(",") }); ElMessage.success(t("common.message.delete_success", { resource: t("system.backup.backup.config") })); refresh(); }
|
|
118
|
+
function backupTypeLabel(value: BaseTableBackupType) { return backupTypeOptions.value.find(item => item.value === value)?.label ?? String(value); }
|
|
119
|
+
</script>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table-box">
|
|
3
|
+
<ProTable ref="proTable" row-key="id" :columns="columns" :request-api="requestTable" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { computed, ref } from "vue";
|
|
9
|
+
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
10
|
+
import type { ColumnProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
11
|
+
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
12
|
+
import { t } from "@liujitcn/kratos-admin-core";
|
|
13
|
+
import { defBaseTableBackupRecordService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_table_backup_record";
|
|
14
|
+
import { BaseTableBackupRecordStatus, type PageBaseTableBackupRecordRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_table_backup_record";
|
|
15
|
+
|
|
16
|
+
defineOptions({ name: "BaseTableBackupRecord", inheritAttrs: false });
|
|
17
|
+
const proTable = ref<ProTableInstance>();
|
|
18
|
+
const statusOptions = computed(() => [
|
|
19
|
+
{ label: t("system.backup.status.running"), value: BaseTableBackupRecordStatus.BASE_TABLE_BACKUP_RECORD_STATUS_RUNNING },
|
|
20
|
+
{ label: t("system.backup.status.success"), value: BaseTableBackupRecordStatus.BASE_TABLE_BACKUP_RECORD_STATUS_SUCCESS },
|
|
21
|
+
{ label: t("system.backup.status.failed"), value: BaseTableBackupRecordStatus.BASE_TABLE_BACKUP_RECORD_STATUS_FAILED },
|
|
22
|
+
{ label: t("system.backup.status.deleted"), value: BaseTableBackupRecordStatus.BASE_TABLE_BACKUP_RECORD_STATUS_DELETED }
|
|
23
|
+
]);
|
|
24
|
+
const columns = computed<ColumnProps[]>(() => [
|
|
25
|
+
{ prop: "id", label: t("system.backup.field.id"), width: 90 },
|
|
26
|
+
{ prop: "source_name", label: t("system.backup.field.source_name"), minWidth: 140 },
|
|
27
|
+
{ prop: "database_name", label: t("system.backup.field.database_name"), minWidth: 160 },
|
|
28
|
+
{ prop: "object_key", label: t("system.backup.field.object_key"), minWidth: 260 },
|
|
29
|
+
{ prop: "size_bytes", label: t("system.backup.field.size_bytes"), width: 110 },
|
|
30
|
+
{ prop: "status", label: t("common.field.status"), width: 110, search: { el: "select", enum: statusOptions.value }, render: scope => statusOptions.value.find(item => item.value === scope.row.status)?.label ?? String(scope.row.status) },
|
|
31
|
+
{ prop: "started_at", label: t("system.backup.field.started_at"), minWidth: 170 },
|
|
32
|
+
{ prop: "finished_at", label: t("system.backup.field.finished_at"), minWidth: 170 },
|
|
33
|
+
{ prop: "verified_at", label: t("system.backup.field.verified_at"), minWidth: 170 }
|
|
34
|
+
]);
|
|
35
|
+
|
|
36
|
+
/** 请求备份记录分页列表。 */
|
|
37
|
+
async function requestTable(params: PageBaseTableBackupRecordRequest) {
|
|
38
|
+
const data = await defBaseTableBackupRecordService.PageBaseTableBackupRecord(buildPageRequest(params));
|
|
39
|
+
return { data: { list: data.base_table_backup_records ?? [], total: data.total } };
|
|
40
|
+
}
|
|
41
|
+
</script>
|