Skip to content

Commit

Permalink
Merge branch 'dev-4.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
HSunboy committed Nov 6, 2023
2 parents 8ce1c7c + 10d0d70 commit 185863b
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 47 deletions.
2 changes: 1 addition & 1 deletion mock/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/d.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/locales/must/strings/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/locales/must/strings/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "数据大小限流",
Expand All @@ -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": "行限流"
}
}
6 changes: 3 additions & 3 deletions src/locales/must/strings/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "請輸行限流限流",
Expand All @@ -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": "已勾選的敏感列中不包含搜尋索引鍵",
Expand All @@ -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": "資料大小限流"
}
}
4 changes: 4 additions & 0 deletions src/page/Secure/Record/RecordPage/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
// 个人配置
Expand Down Expand Up @@ -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 =
Expand Down
4 changes: 4 additions & 0 deletions src/page/Secure/components/RecordPage/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
// 个人配置
Expand Down Expand Up @@ -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 =
Expand Down
71 changes: 41 additions & 30 deletions src/page/Workspace/components/SQLPage/ExecDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,46 +103,34 @@ const ExecDetail: React.FC<IProps> = 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);
}
Expand Down Expand Up @@ -173,6 +161,7 @@ const ExecDetail: React.FC<IProps> = function (props) {
},
yAxis: {
show: false,
// type: "log",
data: [
formatMessage({
id: 'odc.components.SQLPage.TimeConsumptionStatisticsUs',
Expand Down Expand Up @@ -205,6 +194,18 @@ const ExecDetail: React.FC<IProps> = function (props) {
};
}, [sql, traceId, visible]);

useEffect(() => {
function resize() {
setTimeout(() => {
stackBarPlot.current?.resize?.();
}, 500);
}
window.addEventListener('resize', resize);
return () => {
window.removeEventListener('resize', resize);
};
}, []);

return (
<Drawer
title={formatMessage({
Expand Down Expand Up @@ -268,3 +269,13 @@ const ExecDetail: React.FC<IProps> = 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;
}

0 comments on commit 185863b

Please sign in to comment.