diff --git a/mock/user.js b/mock/user.js index ce4873150..39905a391 100644 --- a/mock/user.js +++ b/mock/user.js @@ -27,7 +27,7 @@ export default { data: { id: 69, name: 'admin', - email: 'admin@alibaba-inc.com', + email: 'admin@oceanbase1024.com', password: 'admin', role: null, status: 1, diff --git a/package.json b/package.json index e52d7e92e..a83e90e71 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "cron-parser": "^4.6.0", "cross-env": "^6.0.3", "css": "^3.0.0", - "echarts": "^5.4.3", + "echarts": "^5.4.0", "electron": "20.3.12", "electron-builder": "^24.6.0", "electron-builder-notarize": "^1.5.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 28db6499e..c38678f37 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -152,8 +152,8 @@ devDependencies: specifier: ^3.0.0 version: 3.0.0 echarts: - specifier: ^5.4.3 - version: 5.4.3 + specifier: ^5.4.0 + version: 5.4.0 electron: specifier: 20.3.12 version: 20.3.12 @@ -8381,11 +8381,11 @@ packages: safer-buffer: 2.1.2 dev: false - /echarts@5.4.3: - resolution: {integrity: sha512-mYKxLxhzy6zyTi/FaEbJMOZU1ULGEQHaeIeuMR5L+JnJTpz+YR03mnnpBhbR4+UYJAgiXgpyTVLffPAjOTLkZA==} + /echarts@5.4.0: + resolution: {integrity: sha512-uPsO9VRUIKAdFOoH3B0aNg7NRVdN7aM39/OjovjO9MwmWsAkfGyeXJhK+dbRi51iDrQWliXV60/XwLA7kg3z0w==} dependencies: tslib: 2.3.0 - zrender: 5.4.4 + zrender: 5.4.0 dev: true /ee-first@1.1.1: @@ -18653,8 +18653,8 @@ packages: readable-stream: 3.6.2 dev: false - /zrender@5.4.4: - resolution: {integrity: sha512-0VxCNJ7AGOMCWeHVyTrGzUgrK4asT4ml9PEkeGirAkKNYXYzoPJCLvmyfdoOXcjTHPs10OZVMfD1Rwg16AZyYw==} + /zrender@5.4.0: + resolution: {integrity: sha512-rOS09Z2HSVGFs2dn/TuYk5BlCaZcVe8UDLLjj1ySYF828LATKKdxuakSZMvrDz54yiKPDYVfjdKqcX8Jky3BIA==} dependencies: tslib: 2.3.0 dev: true diff --git a/src/d.ts/index.ts b/src/d.ts/index.ts index ca0941ad3..9e688a74f 100644 --- a/src/d.ts/index.ts +++ b/src/d.ts/index.ts @@ -416,6 +416,8 @@ export enum AuditEventType { PROJECT_MANAGEMENT = 'PROJECT_MANAGEMENT', // 导出结果集 EXPORT_RESULT_SET = 'EXPORT_RESULT_SET', + // SQL 安全规则管理 + SQL_SECURITY_RULE_MANAGEMENT = 'SQL_SECURITY_RULE_MANAGEMENT', } export enum AuditEventActionType { @@ -551,6 +553,8 @@ export enum AuditEventActionType { REJECT_EXPORT_RESULT_SET_TASK = 'REJECT_EXPORT_RESULT_SET_TASK', EXECUTE_EXPORT_RESULT_SET_TASK = 'EXECUTE_EXPORT_RESULT_SET_TASK', STOP_EXPORT_RESULT_SET_TASK = 'STOP_EXPORT_RESULT_SET_TASK', + // SQL 安全规则管理 + UPDATE_SQL_SECURITY_RULE = 'UPDATE_SQL_SECURITY_RULE', } export enum AuditEventDialectType { diff --git a/src/locales/must/strings/en-US.json b/src/locales/must/strings/en-US.json index c8685473c..c105920b9 100644 --- a/src/locales/must/strings/en-US.json +++ b/src/locales/must/strings/en-US.json @@ -6017,7 +6017,7 @@ "odc.src.component.Task.DataClearTask.CreateModal.TaskSetting": "Ticket Settings", "odc.src.component.helpDoc.DefineVariablesSetTime.1": "Define variables, set time offsets, and reference them in the subsequent cleanup conditions.", "odc.src.component.Task.DataClearTask.CreateModal.VariablesCanBeReferencedIn": "(Optional) Variables can be referenced in Cleanup Condition in Cleanup Scope.", - "odc.src.component.helpDoc.CanConfigureTheFilteringConditions.1": "You can configure filter conditions using constants or variables defined in the previous section. Example 1: \"gmt_create ≤ '2023-01-01'\", Example 2: \"gmt_create ≤ '{bizdate}'\" where 'bizdate' is the variable name defined in Variable Configuration, and 'gmt_create' is a field in the cleanup table.", + "odc.src.component.helpDoc.CanConfigureTheFilteringConditions.1": "You can configure filter conditions using constants or variables defined in the previous section. Example 1: gmt_create ≤ '2023-01-01', Example 2: gmt_create ≤ '${bizdate}' where \"bizdate\" is the variable name defined in Variable Configuration, and \"gmt_create\" is a field in the cleanup table.", "odc.src.component.Task.DataArchiveTask.DetailContent.SuccessfullyModified": "Modified successfully", "odc.src.component.Task.DataArchiveTask.DetailContent.RestrictedFlow": "Row Limit", "odc.src.component.Task.component.ThrottleFormItem.PleaseImportTheBobbyFlow": "Please enter a row limit", @@ -6032,7 +6032,7 @@ "odc.src.page.Project.Sensitive.components.SensitiveColumn.components.YouCanUseThePath": "You can select columns in batches using either path, regular expression, or Groovy.", "odc.src.page.Project.Sensitive.components.SensitiveColumn.components.ThereIsNoOptionalSensitive": "No sensitive columns available in the selected database", "odc.src.page.Project.Sensitive.components.SensitiveRule.components.Preview": "Preview", - "odc.src.component.helpDoc.CanConfigureTheFilteringConditions": "You can configure filter conditions using constants or variables defined in the previous section. Example 1: \"gmt_create ≤ '2023-01-01'\", Example 2: \"gmt_create ≤ '{bizdate}'\" where 'bizdate' is the variable name defined in Variable Configuration, and 'gmt_create' is a field in the archiving table.", + "odc.src.component.helpDoc.CanConfigureTheFilteringConditions": "You can configure filter conditions using constants or variables defined in the previous section. Example 1: gmt_create ≤ '2023-01-01', Example 2: gmt_create ≤ '${bizdate}' where “bizdate” is the variable name defined in Variable Configuration, and “gmt_create” is a field in the archiving table.", "odc.src.component.Task.component.ThrottleFormItem.PleaseLoseTheDataSize": "Please enter a data size limit", "odc.src.component.Task.DataClearTask.DetailContent.RestrictedFlow": "Row Limit", "odc.src.page.Project.Sensitive.components.SensitiveColumn.components.HaveNotCheckedTheSensitive": "No sensitive column selected yet", diff --git a/src/locales/must/strings/zh-CN.json b/src/locales/must/strings/zh-CN.json index b328cc512..139c9c964 100644 --- a/src/locales/must/strings/zh-CN.json +++ b/src/locales/must/strings/zh-CN.json @@ -6012,7 +6012,7 @@ "odc.src.page.Project.Sensitive.components.SensitiveRule.components.TestData": "测试数据", "odc.src.page.Workspace.SideBar.ResourceTree.SelectPanel.PleaseSelectTheDataSource": "请选择数据源或项目", "odc.src.component.Task.component.ThrottleEditableCell.CanNotBeEmpty": "不能为空!", - "odc.src.component.helpDoc.CanConfigureTheFilteringConditions.1": "可使用常量或引用上文中定义的变量来配置过滤条件。样例 1:gmt_create <= '2023-01-01' ,样例 2:gmt_create <= '{bizdate}',其中 bizdate 为变量配置中的变量名,gmt_create 为清理表中的字段。", + "odc.src.component.helpDoc.CanConfigureTheFilteringConditions.1": "可使用常量或引用上文中定义的变量来配置过滤条件。样例 1:gmt_create <= '2023-01-01' ,样例 2:gmt_create <= '${bizdate}',其中 bizdate 为变量配置中的变量名,gmt_create 为清理表中的字段。", "odc.src.component.Task.component.ThrottleFormItem.DataSizeLimit": "数据大小限流", "odc.src.component.Task.DataClearTask.DetailContent.DataSizeLimit": "数据大小限流", "odc.src.component.Task.DataArchiveTask.DetailContent.DataSizeLimit": "数据大小限流", @@ -6038,8 +6038,8 @@ "odc.src.page.Project.Sensitive.components.SensitiveColumn.components.YouCanUseThePath": "可通过路径、正则或 Groovy 任意一种识别方式,进行脚本批量选择列", "odc.src.component.Task.component.ThrottleFormItem.RestrictedFlow": "行限流", "odc.src.component.helpDoc.TheTotalSizeLimitOf": "每秒操作数据总大小限制", - "odc.src.component.helpDoc.CanConfigureTheFilteringConditions": "可使用常量或引用上文中定义的变量来配置过滤条件。样例 1:gmt_create <= '2023-01-01' ,样例 2:gmt_create <= '{bizdate}',其中 bizdate 为变量配置中的变量名,gmt_create 为归档表中的字段。", + "odc.src.component.helpDoc.CanConfigureTheFilteringConditions": "可使用常量或引用上文中定义的变量来配置过滤条件。样例 1:gmt_create <= '2023-01-01' ,样例 2:gmt_create <= '${bizdate}',其中 bizdate 为变量配置中的变量名,gmt_create 为归档表中的字段。", "odc.src.component.Task.DataClearTask.DetailContent.RestrictedFlow": "行限流", "odc.src.component.Task.DataClearTask.CreateModal.TaskSetting": "任务设置", "odc.src.component.Task.DataArchiveTask.DetailContent.RestrictedFlow": "行限流" -} +} \ No newline at end of file diff --git a/src/locales/must/strings/zh-TW.json b/src/locales/must/strings/zh-TW.json index ec70e4211..60f61f874 100644 --- a/src/locales/must/strings/zh-TW.json +++ b/src/locales/must/strings/zh-TW.json @@ -6017,7 +6017,7 @@ "odc.src.component.Task.DataClearTask.CreateModal.TaskSetting": "任務設定", "odc.src.component.helpDoc.DefineVariablesSetTime.1": "定義變數、設定時間位移量並在下文的清理條件中引用", "odc.src.component.Task.DataClearTask.CreateModal.VariablesCanBeReferencedIn": "變數可在清理範圍的清理條件中引用 (可選)", - "odc.src.component.helpDoc.CanConfigureTheFilteringConditions.1": "可使用常量或引用上文中定義的變數來配置過濾條件。範例 1:gmt_create <= '2023-01-01' ,範例 2:gmt_create <= '{bizdate}',其中 bizdate 為變數配置中的變數名,gmt_create 為清理表中的欄位。", + "odc.src.component.helpDoc.CanConfigureTheFilteringConditions.1": "可使用常量或引用上文中定義的變數來配置過濾條件。範例 1:gmt_create <= '2023-01-01' ,範例 2:gmt_create <= '${bizdate}',其中 bizdate 為變數配置中的變數名,gmt_create 為清理表中的欄位。", "odc.src.component.Task.DataArchiveTask.DetailContent.SuccessfullyModified": "修改成功!", "odc.src.component.Task.DataArchiveTask.DetailContent.RestrictedFlow": "行限流", "odc.src.component.Task.component.ThrottleFormItem.PleaseImportTheBobbyFlow": "請輸行限流限流", @@ -6034,7 +6034,7 @@ "odc.src.page.Project.Sensitive.components.SensitiveRule.components.Preview": "結果預覽", "odc.src.component.Task.DataClearTask.DetailContent.RestrictedFlow": "行限流", "odc.src.component.Task.component.ThrottleFormItem.PleaseLoseTheDataSize": "請輸資料大小限流", - "odc.src.component.helpDoc.CanConfigureTheFilteringConditions": "可使用常量或引用上文中定義的變數來配置過濾條件。範例 1:gmt_create <= '2023-01-01' ,範例 2:gmt_create <= '{bizdate}',其中 bizdate 為變數配置中的變數名,gmt_create 為歸檔表中的欄位。", + "odc.src.component.helpDoc.CanConfigureTheFilteringConditions": "可使用常量或引用上文中定義的變數來配置過濾條件。範例 1:gmt_create <= '2023-01-01' ,範例 2:gmt_create <= '${bizdate}',其中 bizdate 為變數配置中的變數名,gmt_create 為歸檔表中的欄位。", "odc.src.page.Project.Sensitive.components.SensitiveColumn.components.HaveNotCheckedTheSensitive": "尚未勾選敏感列", "odc.src.component.helpDoc.TheDataDataDataData": "每秒操作資料總行限制", "odc.src.page.Project.Sensitive.components.SensitiveColumn.components.TheSelectedSensitiveColumnsDo": "已勾選的敏感列中不包含搜尋索引鍵", @@ -6043,4 +6043,4 @@ "odc.src.component.Task.DataArchiveTask.DetailContent.SuccessfullyModified.1": "修改成功!", "odc.src.component.Task.component.ThrottleFormItem.DataSizeLimit": "資料大小限流", "odc.src.component.Task.DataClearTask.DetailContent.DataSizeLimit": "資料大小限流" -} +} \ No newline at end of file diff --git a/src/page/Secure/Record/RecordPage/interface.ts b/src/page/Secure/Record/RecordPage/interface.ts index 24a151984..b3e43b084 100644 --- a/src/page/Secure/Record/RecordPage/interface.ts +++ b/src/page/Secure/Record/RecordPage/interface.ts @@ -124,6 +124,8 @@ export const AuditEventMetaMap = { [AuditEventType.EXPORT_RESULT_SET]: formatMessage({ id: 'odc.src.page.Secure.Record.RecordPage.ExportResultSet', }), //'导出结果集' + // SQL安全规则管理 + [AuditEventType.SQL_SECURITY_RULE_MANAGEMENT]: 'SQL安全规则管理', }; export const AuditEventActionMap = { // 个人配置 @@ -536,6 +538,8 @@ export const AuditEventActionMap = { [AuditEventActionType.STOP_EXPORT_RESULT_SET_TASK]: formatMessage({ id: 'odc.src.page.Secure.Record.RecordPage.StopExportResultsSetTask', }), //'停止导出结果集任务' + // SQL安全规则管理 + [AuditEventActionType.UPDATE_SQL_SECURITY_RULE]: '更新SQL安全规则', }; export function getEventFilterAndOptions(eventMeta: IAuditEvent[]) { const metas = diff --git a/src/page/Secure/components/RecordPage/interface.ts b/src/page/Secure/components/RecordPage/interface.ts index 3f34c3f9b..cb1d6a609 100644 --- a/src/page/Secure/components/RecordPage/interface.ts +++ b/src/page/Secure/components/RecordPage/interface.ts @@ -124,6 +124,8 @@ export const AuditEventMetaMap = { [AuditEventType.EXPORT_RESULT_SET]: formatMessage({ id: 'odc.src.page.Secure.components.RecordPage.ExportResultSet', }), //'导出结果集' + // SQL安全规则管理 + [AuditEventType.SQL_SECURITY_RULE_MANAGEMENT]: 'SQL安全规则管理', }; export const AuditEventActionMap = { // 个人配置 @@ -536,6 +538,8 @@ export const AuditEventActionMap = { [AuditEventActionType.STOP_EXPORT_RESULT_SET_TASK]: formatMessage({ id: 'odc.src.page.Secure.components.RecordPage.StopExportResultsSetTask', }), //'停止导出结果集任务' + // SQL安全规则管理 + [AuditEventActionType.UPDATE_SQL_SECURITY_RULE]: '更新SQL安全规则', }; export function getEventFilterAndOptions(eventMeta: IAuditEvent[]) { const metas = diff --git a/src/page/Workspace/components/SQLPage/ExecDetail/index.tsx b/src/page/Workspace/components/SQLPage/ExecDetail/index.tsx index db206db70..2fc74f4f6 100644 --- a/src/page/Workspace/components/SQLPage/ExecDetail/index.tsx +++ b/src/page/Workspace/components/SQLPage/ExecDetail/index.tsx @@ -103,46 +103,34 @@ const ExecDetail: React.FC = function (props) { id: 'workspace.window.sql.explain.tab.detail.card.time.label.otherTime', }); - const data = [ - { - name: execTimeLabel, - type: 'bar', - stack: 'total', - label: { - show: true, - }, - emphasis: { - focus: 'series', - }, - barWidth: '30px', - data: [execTime], - }, + const values = [execTime, queueTime, totalTime - queueTime - execTime]; + const names = [execTimeLabel, queueTimeLabel, otherTimeLabel]; - { - name: queueTimeLabel, + const newValues = setMinValues(values); + + const data = newValues.map((newValue, index) => { + return { + name: names[index], type: 'bar', stack: 'total', label: { show: true, + formatter() { + return values[index]; + }, }, emphasis: { focus: 'series', }, - data: [queueTime], - }, - { - name: otherTimeLabel, - type: 'bar', - stack: 'total', - label: { - show: true, - }, - emphasis: { - focus: 'series', + barWidth: '30px', + data: [newValue], + tooltip: { + valueFormatter() { + return values[index]; + }, }, - data: [totalTime - queueTime - execTime], - }, - ]; + }; + }); if (!stackBarPlot.current) { stackBarPlot.current = echarts.init(stackBarBox.current, setting.theme?.chartsTheme); } @@ -173,6 +161,7 @@ const ExecDetail: React.FC = function (props) { }, yAxis: { show: false, + // type: "log", data: [ formatMessage({ id: 'odc.components.SQLPage.TimeConsumptionStatisticsUs', @@ -205,6 +194,18 @@ const ExecDetail: React.FC = function (props) { }; }, [sql, traceId, visible]); + useEffect(() => { + function resize() { + setTimeout(() => { + stackBarPlot.current?.resize?.(); + }, 500); + } + window.addEventListener('resize', resize); + return () => { + window.removeEventListener('resize', resize); + }; + }, []); + return ( = function (props) { }; export default ExecDetail; + +function setMinValues(values: number[]) { + const sum = values.reduce((accumulator, currentValue) => { + return accumulator + currentValue; + }, 0); + const newValues = values.map((value, index) => { + return Math.floor(value * 0.7 + sum * 0.1); + }); + return newValues; +}