Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions internal/apiserver/service/dms_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (

dmsV1 "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
"github.com/actiontech/dms/pkg/dms-common/api/jwt"
i18nPkg "github.com/actiontech/dms/pkg/dms-common/i18nPkg"

utilLog "github.com/actiontech/dms/pkg/dms-common/pkg/log"

Expand Down Expand Up @@ -744,7 +743,7 @@ func (ctl *DMSController) AddSession(c echo.Context) error {
OperationAction: "login",
OperationProjectName: "",
OperationStatus: "succeeded",
OperationI18nContent: i18nPkg.ConvertStr2I18nAsDefaultLang(fmt.Sprintf("用户 %s 登入系统", user.Name)),
OperationI18nContent: locale.Bundle.LocalizeAllWithArgs(locale.OpRecordUserLoginWithName, user.Name),
},
}
_, err = ctl.DMS.AddOperationRecord(c.Request().Context(), recordReq)
Expand Down Expand Up @@ -821,7 +820,7 @@ func (ctl *DMSController) DelSession(c echo.Context) error {
OperationAction: "logout",
OperationProjectName: "",
OperationStatus: "succeeded",
OperationI18nContent: i18nPkg.ConvertStr2I18nAsDefaultLang(fmt.Sprintf("用户 %s 登出系统", user.Name)),
OperationI18nContent: locale.Bundle.LocalizeAllWithArgs(locale.OpRecordUserLogoutWithName, user.Name),
},
}
_, err = ctl.DMS.AddOperationRecord(c.Request().Context(), recordReq)
Expand Down Expand Up @@ -2806,7 +2805,7 @@ func (ctl *DMSController) oauth2Callback(c echo.Context) error {
OperationAction: "login",
OperationProjectName: "",
OperationStatus: "succeeded",
OperationI18nContent: i18nPkg.ConvertStr2I18nAsDefaultLang(fmt.Sprintf("用户 %s 通过OAuth2登入系统", user.Name)),
OperationI18nContent: locale.Bundle.LocalizeAllWithArgs(locale.OpRecordUserOAuth2LoginWithName, user.Name),
},
}
_, err = ctl.DMS.AddOperationRecord(c.Request().Context(), recordReq)
Expand Down Expand Up @@ -2897,7 +2896,7 @@ func (ctl *DMSController) BindOauth2User(c echo.Context) error {
OperationAction: "login",
OperationProjectName: "",
OperationStatus: "succeeded",
OperationI18nContent: i18nPkg.ConvertStr2I18nAsDefaultLang(fmt.Sprintf("用户 %s 通过OAuth2绑定登入系统", user.Name)),
OperationI18nContent: locale.Bundle.LocalizeAllWithArgs(locale.OpRecordUserOAuth2BindLoginWithName, user.Name),
},
}
_, err = ctl.DMS.AddOperationRecord(c.Request().Context(), recordReq)
Expand Down
26 changes: 15 additions & 11 deletions internal/pkg/locale/active.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ NameRoleOpsEngineer = "Operation engineer"
NameRoleProjectAdmin = "Project admin"
NotifyDataWorkflowBodyApprovalReminder = "⏰ The export workflow has been approved. Please complete the export within 1 day, otherwise it will expire and cannot be executed"
NotifyDataWorkflowBodyConfigUrl = "Please add a global URL in the system settings - global configuration"
NotifyDataWorkflowBodyExportFailReason = "❌ Failure Reason: %v"
NotifyDataWorkflowBodyHead = "\n📋 Data Export Workflow Topic: %v\n📍 ProjectName: %v\n🆔 Workflow ID: %v\n📝 Workflow Description: %v\n👤 Applicant: %v\n⏰ Creation Time: %v"
NotifyDataWorkflowBodyInstanceAndSchema = "🗄️ Data Source: %v\n📊 Schema: %v"
NotifyDataWorkflowBodyLink = "🔗 Data Export Workflow Link: %v"
NotifyDataWorkflowBodyReason = "❌ Rejection Reason: %v"
NotifyDataWorkflowBodyExportFailReason = "❌ Failure Reason: %v"
NotifyDataWorkflowBodyReport = "⭐ Data Export Workflow Audit Score: %v"
NotifyDataWorkflowBodyStartEnd = "▶️ Execute Start Time: %v\n◀️ Execute End Time: %v"
NotifyDataWorkflowBodyWorkFlowErr = "⚠️ Failed to read data export workflow task content, please check the workflow status through the SQLE interface"
Expand Down Expand Up @@ -180,15 +180,6 @@ OpRecordDataExportCreate = "Create data export workflow"
OpRecordDataExportCreateWithName = "Create data export workflow %s"
OpRecordDataExportExportWithName = "Execute data export %s"
OpRecordDataExportRejectWithName = "Reject data export workflow %s"
OpRecordUnmaskingAPICreate = "Submit unmasking workflow application"
OpRecordUnmaskingApproveWithWorkflowUID = "Approve unmasking workflow %s"
OpRecordUnmaskingCancelWithWorkflowUID = "Cancel unmasking workflow %s"
OpRecordUnmaskingDownloadOriginalWithWorkflowUID = "Download original data %s"
OpRecordUnmaskingRejectWithWorkflowUID = "Reject unmasking workflow %s"
OpRecordUnmaskingSubmitWithWorkflowUID = "Submit unmasking workflow %s"
OpRecordUnmaskingUnknownWithWorkflowUID = "Unmasking workflow action %s (%s)"
OpRecordUnmaskingViewDetailWithWorkflowUID = "View unmasking workflow detail %s"
OpRecordUnmaskingViewOriginalWithWorkflowUID = "View full original data (SQL) %s"
OpRecordMemberCreate = "Add member"
OpRecordMemberCreateWithName = "Add member %s"
OpRecordMemberDelete = "Delete member %s"
Expand All @@ -207,9 +198,22 @@ OpRecordRoleCreate = "Create role"
OpRecordRoleCreateWithName = "Create role %s"
OpRecordRoleDelete = "Delete role %s"
OpRecordRoleUpdate = "Update role %s"
OpRecordUnmaskingAPICreate = "Submit unmasking workflow application"
OpRecordUnmaskingApproveWithWorkflowUID = "Approve unmasking workflow %s"
OpRecordUnmaskingCancelWithWorkflowUID = "Cancel unmasking workflow %s"
OpRecordUnmaskingDownloadOriginalWithWorkflowUID = "Download original data %s"
OpRecordUnmaskingRejectWithWorkflowUID = "Reject unmasking workflow %s"
OpRecordUnmaskingSubmitWithWorkflowUID = "Submit unmasking workflow %s"
OpRecordUnmaskingUnknownWithWorkflowUID = "Unmasking workflow action %s (%s)"
OpRecordUnmaskingViewDetailWithWorkflowUID = "View unmasking workflow detail %s"
OpRecordUnmaskingViewOriginalWithWorkflowUID = "View full original data (SQL) %s"
OpRecordUserCreate = "Create user"
OpRecordUserCreateWithName = "Create user %s"
OpRecordUserDelete = "Delete user %s"
OpRecordUserLoginWithName = "User %s logged into the system"
OpRecordUserLogoutWithName = "User %s logged out of the system"
OpRecordUserOAuth2BindLoginWithName = "User %s logged into the system via OAuth2 binding"
OpRecordUserOAuth2LoginWithName = "User %s logged into the system via OAuth2"
OpRecordUserUpdate = "Update user %s"
OpRecordUserUpdateBWP = "Update user %s business write permission: %s -> %s"
ProjectAvailable = "Available"
Expand All @@ -220,7 +224,6 @@ ProjectName = "Project name"
ProjectNotAvailable = "Unavailable"
ProjectStatus = "Project status"
SqlWorkbenchAuditCallSQLEErr = "The audit service is busy or unavailable. Please try again later."
SqlWorkbenchMaintenanceTimeBlocked = "Currently outside maintenance window (maintenance hours: %s). Non-query operations are prohibited. Please operate during maintenance hours or submit a change request."
SqlWorkbenchAuditDBServiceMappingNotFoundErr = "Current data source was not found. Please confirm it exists, reselect it, and try again."
SqlWorkbenchAuditGetDBServiceErr = "Current data source configuration was not found. Please confirm the data source exists and try again."
SqlWorkbenchAuditGetDBServiceMappingErr = "We couldn't get the current data source information. Please reselect the data source and try again."
Expand All @@ -229,6 +232,7 @@ SqlWorkbenchAuditMissingSQLOrDatasourceErr = "SQL or data source was not detecte
SqlWorkbenchAuditNotEnabledErr = "SQL audit is not enabled for this data source. Please enable SQL audit before running."
SqlWorkbenchAuditParseReqErr = "We couldn't parse the request content. Please try again later."
SqlWorkbenchAuditReadReqBodyErr = "We couldn't get the request content, possibly due to network instability. Please try again later."
SqlWorkbenchMaintenanceTimeBlocked = "Currently outside maintenance window (maintenance hours: %s). Non-query operations are prohibited. Please operate during maintenance hours or submit a change request."
StatDisable = "Disabled"
StatOK = "Normal"
StatUnknown = "Unknown"
49 changes: 37 additions & 12 deletions internal/pkg/locale/active.zh.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,37 @@ DescOpPermissionCreateOptimization = "创建智能调优;拥有该权限的用
DescOpPermissionCreatePipeline = "配置流水线;拥有该权限的用户可以为数据源配置流水线"
DescOpPermissionCreateProject = "创建项目、配置项目资源"
DescOpPermissionCreateWorkflow = "创建/编辑工单;拥有该权限的用户可以创建/编辑工单"
DescOpPermissionDesensitization = "配置脱敏任务;拥有该权限的用户可以管理脱敏模板、脱敏发现任务和规则配置"
DescOpPermissionExecuteWorkflow = "上线工单;拥有该权限的用户可以上线工单"
DescOpPermissionExportApprovalReject = "审批/驳回数据导出工单;拥有该权限的用户可以执行审批导出数据工单或者驳回导出数据工单"
DescOpPermissionExportCreate = "创建数据导出任务;拥有该权限的用户可以创建数据导出任务或者工单"
DescOpPermissionGlobalManagement = "具备系统最高权限,可进行系统配置、用户管理等操作"
DescOpPermissionGlobalView = "负责系统操作审计、数据合规检查等工作"
DescOpPermissionManageApprovalTemplate = "管理审批流程模版;拥有该权限的用户可以管理审批流程模版"
DescOpPermissionManageAuditRuleTemplate = "管理审核规则模版;拥有该权限的用户可以管理审核规则模版"
DescOpPermissionManageMember = "管理成员与权限;拥有该权限的用户可以管理项目成员与权限"
DescOpPermissionManageProjectDataSource = "管理项目数据源;拥有该权限的用户可以管理项目下数据源"
DescOpPermissionManageRoleMange = "角色管理权限;拥有该权限的用户可以管理角色"
DescOpPermissionManageSQLMangeWhiteList = "管控SQL例外;拥有该权限的用户可以管理管控SQL例外"
DescOpPermissionMangeAuditSQLWhiteList = "审核SQL例外;拥有该权限的用户可以管理审核SQL例外"
DescOpPermissionMaskingAudit = "脱敏审核;拥有该权限的用户可以查看和处理脱敏审批请求"
DescOpPermissionOrdinaryUser = "基础功能操作权限,可进行日常业务操作"
DescOpPermissionProjectAdmin = "项目管理;拥有该权限的用户可以管理项目下的所有资源"
DescOpPermissionPushRule = "管理推送规则;拥有该权限的用户可以管理推送规则"
DescOpPermissionSQLQuery = "SQL工作台查询;拥有该权限的用户可以执行SQL工作台查询"
DescOpPermissionSaveAuditPlan = "创建/编辑扫描任务;拥有该权限的用户可以创建/编辑扫描任务"
DescOpPermissionVersionManage = "配置版本;拥有该权限的用户可以配置版本管理策略"
DescOpPermissionViewExportTask = "查看所有导出任务;拥有该权限的用户可以查看平台全部导出任务"
DescOpPermissionViewIDEAuditRecord = "查看所有IDE审核记录;拥有该权限的用户可以查看全部IDE审核记录"
DescOpPermissionViewOperationRecord = "查看所有操作记录;拥有该权限的用户可以查看平台全部操作记录"
DescOpPermissionViewOptimizationRecord = "查看所有优化记录;拥有该权限的用户可以查看全部优化记录"
DescOpPermissionViewOthersAuditPlan = "查看他人创建的扫描任务;拥有该权限的用户可以查看他人创建的扫描任务"
DescOpPermissionViewOthersOptimization = "查看他人创建的智能调优;拥有该权限的用户可以查看他人创建的智能调优"
DescOpPermissionViewOthersWorkflow = "查看他人创建的工单;拥有该权限的用户可以查看他人创建的工单"
DescOpPermissionViewPipeline = "查看所有流水线;拥有该权限的用户可以查看全部流水线"
DescOpPermissionViewSQLInsight = "查看性能洞察;拥有该权限的用户可以查看性能洞察的数据"
DescOpPermissionViewVersionManage = "查看他人创建的版本记录;拥有该权限的用户可以查看全部版本记录"
DescPermissionViewQuickAuditRecord = "查看所有快捷审核记录;拥有该权限的用户可以查看全部快捷审核记录"
DescRoleDevEngineer = "拥有该权限的用户可以创建/编辑工单,SQL工作台查询,配置流水线,创建智能调优"
DescRoleDevManager = "拥有该权限的用户可以创建/编辑工单,审核/驳回工单,配置流水线,查看他人创建的智能调优"
DescRoleOpsEngineer = "拥有该权限的用户可以上线工单,查看他人创建的工单,创建智能扫描,查看他人的扫描任务,数据导出"
Expand Down Expand Up @@ -97,7 +115,7 @@ NameOpPermissionCreateOptimization = "创建智能调优"
NameOpPermissionCreatePipeline = "流水线增删改"
NameOpPermissionCreateProject = "项目总监"
NameOpPermissionCreateWorkflow = "创建上线工单"
NameOpPermissionDesensitization = "脱敏规则配置权限"
NameOpPermissionDesensitization = "配置脱敏任务"
NameOpPermissionExecuteWorkflow = "执行上线工单"
NameOpPermissionExportApprovalReject = "审批导出工单"
NameOpPermissionExportCreate = "创建导出工单"
Expand All @@ -110,6 +128,7 @@ NameOpPermissionManageProjectDataSource = "管理项目数据源"
NameOpPermissionManageRoleMange = "角色管理权限"
NameOpPermissionManageSQLMangeWhiteList = "管控SQL例外"
NameOpPermissionMangeAuditSQLWhiteList = "审核SQL例外"
NameOpPermissionMaskingAudit = "脱敏审核"
NameOpPermissionOrdinaryUser = "普通用户"
NameOpPermissionProjectAdmin = "项目管理"
NameOpPermissionPushRule = "管理推送规则"
Expand All @@ -133,11 +152,11 @@ NameRoleOpsEngineer = "运维工程师"
NameRoleProjectAdmin = "项目管理员"
NotifyDataWorkflowBodyApprovalReminder = "⏰ 导出工单已审批通过,请在1天内完成导出,过期后将无法执行"
NotifyDataWorkflowBodyConfigUrl = "请在系统设置-全局配置中补充全局url"
NotifyDataWorkflowBodyExportFailReason = "❌ 失败原因: %v"
NotifyDataWorkflowBodyHead = "\n📋 数据导出工单主题: %v\n📍 所属项目: %v\n🆔 数据导出工单ID: %v\n📝 数据导出工单描述: %v\n👤 申请人: %v\n⏰ 创建时间: %v\n"
NotifyDataWorkflowBodyInstanceAndSchema = "🗄️ 数据源: %v\n📊 schema: %v\n"
NotifyDataWorkflowBodyLink = "🔗 数据导出工单链接: %v"
NotifyDataWorkflowBodyReason = "❌ 驳回原因: %v"
NotifyDataWorkflowBodyExportFailReason = "❌ 失败原因: %v"
NotifyDataWorkflowBodyReport = "⭐ 数据导出工单审核得分: %v"
NotifyDataWorkflowBodyStartEnd = "▶️ 数据导出开始时间: %v\n◀️ 数据导出结束时间: %v"
NotifyDataWorkflowBodyWorkFlowErr = "❌ 读取工单任务内容失败,请通过SQLE界面确认工单状态"
Expand Down Expand Up @@ -180,15 +199,6 @@ OpRecordDataExportCreate = "创建数据导出工单"
OpRecordDataExportCreateWithName = "创建数据导出工单 %s"
OpRecordDataExportExportWithName = "执行数据导出 %s"
OpRecordDataExportRejectWithName = "驳回数据导出工单 %s"
OpRecordUnmaskingAPICreate = "提交查看原文工单申请"
OpRecordUnmaskingApproveWithWorkflowUID = "审批通过查看原文工单 %s"
OpRecordUnmaskingCancelWithWorkflowUID = "撤回查看原文工单 %s"
OpRecordUnmaskingDownloadOriginalWithWorkflowUID = "下载原文数据 %s"
OpRecordUnmaskingRejectWithWorkflowUID = "驳回查看原文工单 %s"
OpRecordUnmaskingSubmitWithWorkflowUID = "提交查看原文工单 %s"
OpRecordUnmaskingUnknownWithWorkflowUID = "查看原文工单操作 %s (%s)"
OpRecordUnmaskingViewDetailWithWorkflowUID = "查看查看原文工单详情 %s"
OpRecordUnmaskingViewOriginalWithWorkflowUID = "查看原文(SQL)%s"
OpRecordMemberCreate = "添加成员"
OpRecordMemberCreateWithName = "添加成员 %s"
OpRecordMemberDelete = "删除成员 %s"
Expand All @@ -207,9 +217,22 @@ OpRecordRoleCreate = "创建角色"
OpRecordRoleCreateWithName = "创建角色 %s"
OpRecordRoleDelete = "删除角色 %s"
OpRecordRoleUpdate = "更新角色 %s"
OpRecordUnmaskingAPICreate = "提交查看原文工单申请"
OpRecordUnmaskingApproveWithWorkflowUID = "审批通过查看原文工单 %s"
OpRecordUnmaskingCancelWithWorkflowUID = "撤回查看原文工单 %s"
OpRecordUnmaskingDownloadOriginalWithWorkflowUID = "下载原文数据 %s"
OpRecordUnmaskingRejectWithWorkflowUID = "驳回查看原文工单 %s"
OpRecordUnmaskingSubmitWithWorkflowUID = "提交查看原文工单 %s"
OpRecordUnmaskingUnknownWithWorkflowUID = "查看原文工单操作 %s (%s)"
OpRecordUnmaskingViewDetailWithWorkflowUID = "查看查看原文工单详情 %s"
OpRecordUnmaskingViewOriginalWithWorkflowUID = "查看原文(SQL)%s"
OpRecordUserCreate = "创建用户"
OpRecordUserCreateWithName = "创建用户 %s"
OpRecordUserDelete = "删除用户 %s"
OpRecordUserLoginWithName = "用户 %s 登入系统"
OpRecordUserLogoutWithName = "用户 %s 登出系统"
OpRecordUserOAuth2BindLoginWithName = "用户 %s 通过OAuth2绑定登入系统"
OpRecordUserOAuth2LoginWithName = "用户 %s 通过OAuth2登入系统"
OpRecordUserUpdate = "更新用户 %s"
OpRecordUserUpdateBWP = "修改用户 %s 的业务写权:%s -> %s"
ProjectAvailable = "可用"
Expand All @@ -220,7 +243,6 @@ ProjectName = "项目名称"
ProjectNotAvailable = "不可用"
ProjectStatus = "项目状态"
SqlWorkbenchAuditCallSQLEErr = "审核服务当前繁忙或不可用,请稍后重试。"
SqlWorkbenchMaintenanceTimeBlocked = "当前处于非运维时间(运维时间:%s),禁止执行非查询类操作。请在运维时间内操作或提交上线工单。"
SqlWorkbenchAuditDBServiceMappingNotFoundErr = "未找到当前数据源,请确认数据源存在并重新选择后重试。"
SqlWorkbenchAuditGetDBServiceErr = "未找到当前数据源配置,请确认数据源存在后重试。"
SqlWorkbenchAuditGetDBServiceMappingErr = "当前数据源信息获取失败,请重新选择数据源后重试。"
Expand All @@ -229,6 +251,9 @@ SqlWorkbenchAuditMissingSQLOrDatasourceErr = "未检测到 SQL 或数据源,
SqlWorkbenchAuditNotEnabledErr = "该数据源尚未开启 SQL 审核,请先在数据源配置中开启“SQL 审核”后再执行。"
SqlWorkbenchAuditParseReqErr = "请求内容解析失败,请稍后重试。"
SqlWorkbenchAuditReadReqBodyErr = "请求内容获取失败,可能网络不稳定,请稍后重试。"
SqlWorkbenchMaintenanceTimeBlocked = "当前处于非运维时间(运维时间:%s),禁止执行非查询类操作。请在运维时间内操作或提交上线工单。"
SqlWorkbenchUnmaskingNoPermissionErr = "您没有查看原文的权限,请提交查看原文工单"
SqlWorkbenchUnmaskingWorkflowNotFoundErr = "未找到对应的查看原文工单"
StatDisable = "被禁用"
StatOK = "正常"
StatUnknown = "未知"
4 changes: 4 additions & 0 deletions internal/pkg/locale/message_zh.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ var (
OpRecordCurrentUserUpdate = &i18n.Message{ID: "OpRecordCurrentUserUpdate", Other: "更新个人中心账号基本信息"}
OpRecordUserUpdate = &i18n.Message{ID: "OpRecordUserUpdate", Other: "更新用户 %s"}
OpRecordUserDelete = &i18n.Message{ID: "OpRecordUserDelete", Other: "删除用户 %s"}
OpRecordUserLoginWithName = &i18n.Message{ID: "OpRecordUserLoginWithName", Other: "用户 %s 登入系统"}
OpRecordUserLogoutWithName = &i18n.Message{ID: "OpRecordUserLogoutWithName", Other: "用户 %s 登出系统"}
OpRecordUserOAuth2LoginWithName = &i18n.Message{ID: "OpRecordUserOAuth2LoginWithName", Other: "用户 %s 通过OAuth2登入系统"}
OpRecordUserOAuth2BindLoginWithName = &i18n.Message{ID: "OpRecordUserOAuth2BindLoginWithName", Other: "用户 %s 通过OAuth2绑定登入系统"}
OpRecordMemberCreate = &i18n.Message{ID: "OpRecordMemberCreate", Other: "添加成员"}
OpRecordMemberCreateWithName = &i18n.Message{ID: "OpRecordMemberCreateWithName", Other: "添加成员 %s"}
OpRecordMemberUpdate = &i18n.Message{ID: "OpRecordMemberUpdate", Other: "更新成员 %s"}
Expand Down