Skip to content

Commit

Permalink
Merge branch 'dev-4.3.2' into dev-4.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
HSunboy committed Nov 14, 2024
2 parents 400d844 + 065967d commit 4c8692c
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/component/Task/DataArchiveTask/CreateModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ const CreateModal: React.FC<IProps> = (props) => {
<Radio.Group options={InsertActionOptions} />
</Form.Item>
<ShardingStrategyItem />
<ThrottleFormItem />
<ThrottleFormItem isShowDataSizeLimit={true} />
</FormItemPanel>
<DescriptionInput />
</Form>
Expand Down
5 changes: 3 additions & 2 deletions src/component/Task/component/ActionBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
SubTaskStatus,
TaskDetail,
TaskExecStrategy,
TaskOperationType,
TaskRecord,
TaskRecordParameters,
TaskStatus,
Expand Down Expand Up @@ -492,7 +493,7 @@ const ActionBar: React.FC<IProps> = inject(
taskType: TaskType.ALTER_SCHEDULE,
parameters: {
taskId: task?.id,
operationType: 'TERMINATION',
operationType: TaskOperationType.TERMINATED,
},
});
props?.onReload?.();
Expand Down Expand Up @@ -1068,7 +1069,7 @@ const ActionBar: React.FC<IProps> = inject(
break;
}
case TaskStatus.APPROVAL_EXPIRED:
case TaskStatus.TERMINATION: {
case TaskStatus.TERMINATED: {
if (isOperator) {
tools = [viewBtn];
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const operationTypeMap = {
id: 'odc.component.CommonTaskDetailModal.TaskOperationRecord.DisableATask',
defaultMessage: '停用任务',
}), //停用任务
[TaskOperationType.TERMINATION]: formatMessage({
[TaskOperationType.TERMINATED]: formatMessage({
id: 'odc.component.CommonTaskDetailModal.TaskOperationRecord.TerminateATask',
defaultMessage: '终止任务',
}), //终止任务
Expand Down
2 changes: 1 addition & 1 deletion src/component/Task/component/Status/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ export const cycleStatus = {
}), //已禁用
},

[TaskStatus.TERMINATION]: {
[TaskStatus.TERMINATED]: {
icon: (
<StopFilled
style={{
Expand Down
43 changes: 43 additions & 0 deletions src/component/Task/component/ThrottleFormItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,22 @@ import HelpDoc from '@/component/helpDoc';
import setting from '@/store/setting';
import { Form, InputNumber, Space } from 'antd';
import React from 'react';
import { TaskType } from '@/d.ts';
interface IProps {
initialValue?: {
rowLimit?: number;
dataSizeLimit?: number;
};
maxRowLimit?: number;
maxDataSizeLimit?: number;
isShowDataSizeLimit?: boolean;
}
const ThrottleFormItem: React.FC<IProps> = (props) => {
const {
initialValue,
maxRowLimit = setting.maxSingleTaskRowLimit,
maxDataSizeLimit = setting.maxSingleTaskDataSizeLimit,
isShowDataSizeLimit,
} = props;
return (
<Form.Item
Expand Down Expand Up @@ -82,6 +85,46 @@ const ThrottleFormItem: React.FC<IProps> = (props) => {
<span>Rows/s</span>
</Space>
</Form.Item>
{isShowDataSizeLimit ? (
<Form.Item
label={
<Space size={2}>
<span>
{
formatMessage({
id: 'odc.src.component.Task.component.ThrottleFormItem.DataSizeLimit',
defaultMessage: '数据大小限流',
}) /* 数据大小限流 */
}
</span>
<HelpDoc leftText isTip doc="TaskLmitData" />
</Space>
}
required
>
<Space size={4} align="center">
<Form.Item
name="dataSizeLimit"
style={{
marginBottom: 0,
}}
rules={[
{
required: true,
message: formatMessage({
id: 'odc.src.component.Task.component.ThrottleFormItem.PleaseLoseTheDataSize',
defaultMessage: '请输数据大小限流',
}), //'请输数据大小限流'
},
]}
initialValue={initialValue?.dataSizeLimit}
>
<InputNumber min={1} max={maxDataSizeLimit} precision={1} />
</Form.Item>
<span>MB/s</span>
</Space>
</Form.Item>
) : null}
</Space>
</Form.Item>
);
Expand Down
4 changes: 2 additions & 2 deletions src/d.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2962,7 +2962,7 @@ export enum TaskOperationType {
CREATE = 'CREATE',
UPDATE = 'UPDATE',
PAUSE = 'PAUSE',
TERMINATION = 'TERMINATION',
TERMINATED = 'TERMINATED',
RESUME = 'RESUME',
}

Expand Down Expand Up @@ -3042,7 +3042,7 @@ export enum TaskStatus {
// 周期任务独有的状态
PAUSE = 'PAUSE',
ENABLED = 'ENABLED',
TERMINATION = 'TERMINATION',
TERMINATED = 'TERMINATED',
TIMEOUT = 'TIMEOUT',
PRE_CHECK_FAILED = 'PRE_CHECK_FAILED',
CREATING = 'CREATING',
Expand Down

0 comments on commit 4c8692c

Please sign in to comment.