Browse Source

[Fix][UI Next][V1.0.0-Alpha] Serial execte proces (#9229)

* add Process execute type for workflow

* fix icon spin
3.0.0/version-upgrade
Devosend 3 years ago committed by GitHub
parent
commit
b2cccc8959
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      dolphinscheduler-ui-next/src/locales/modules/en_US.ts
  2. 6
      dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts
  3. 1
      dolphinscheduler-ui-next/src/service/modules/process-definition/types.ts
  4. 6
      dolphinscheduler-ui-next/src/utils/common.ts
  5. 3
      dolphinscheduler-ui-next/src/views/projects/task/instance/use-table.ts
  6. 19
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx
  7. 2
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/types.ts
  8. 2
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/start-modal.tsx
  9. 1
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx
  10. 1
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx

6
dolphinscheduler-ui-next/src/locales/modules/en_US.ts

@ -597,6 +597,12 @@ const project = {
description: 'Description', description: 'Description',
tenant: 'Tenant', tenant: 'Tenant',
timeout_alert: 'Timeout Alert', timeout_alert: 'Timeout Alert',
process_execute_type: 'Process execute type',
parallel: 'parallel',
serial_wait: 'Serial wait',
serial_discard: 'Serial discard',
serial_priority: 'Serial priority',
recover_serial_wait: 'Recover serial wait',
global_variables: 'Global Variables', global_variables: 'Global Variables',
basic_info: 'Basic Information', basic_info: 'Basic Information',
minute: 'Minute', minute: 'Minute',

6
dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts

@ -593,6 +593,12 @@ const project = {
description: '描述', description: '描述',
tenant: '租户', tenant: '租户',
timeout_alert: '超时告警', timeout_alert: '超时告警',
process_execute_type: '执行策略',
parallel: '并行',
serial_wait: '串行等待',
serial_discard: '串行抛弃',
serial_priority: '串行优先',
recover_serial_wait: '串行恢复',
global_variables: '全局变量', global_variables: '全局变量',
basic_info: '基本信息', basic_info: '基本信息',
minute: '分', minute: '分',

1
dolphinscheduler-ui-next/src/service/modules/process-definition/types.ts

@ -59,6 +59,7 @@ interface ProcessDefinitionReq {
taskDefinitionJson: string taskDefinitionJson: string
taskRelationJson: string taskRelationJson: string
tenantCode: string tenantCode: string
executionType: string
description?: string description?: string
globalParams?: string globalParams?: string
timeout?: number timeout?: number

6
dolphinscheduler-ui-next/src/utils/common.ts

@ -24,7 +24,7 @@ import {
EditOutlined, EditOutlined,
MinusCircleOutlined, MinusCircleOutlined,
CheckCircleFilled, CheckCircleFilled,
LoadingOutlined, Loading3QuartersOutlined,
PauseCircleFilled, PauseCircleFilled,
ClockCircleOutlined, ClockCircleOutlined,
StopFilled, StopFilled,
@ -319,8 +319,8 @@ export const tasksState = (t: any): ITaskStateConfig => ({
id: 14, id: 14,
desc: `${t('project.workflow.serial_wait')}`, desc: `${t('project.workflow.serial_wait')}`,
color: '#5102ce', color: '#5102ce',
icon: LoadingOutlined, icon: Loading3QuartersOutlined,
isSpin: false, isSpin: true,
classNames: 'serial_wait' classNames: 'serial_wait'
} }
}) })

3
dolphinscheduler-ui-next/src/views/projects/task/instance/use-table.ts

@ -333,7 +333,6 @@ export function renderStateCell(state: ITaskState, t: Function) {
NIcon, NIcon,
{ {
color: stateOption.color, color: stateOption.color,
size: 18,
class: stateOption.classNames, class: stateOption.classNames,
style: { style: {
display: 'flex' display: 'flex'
@ -344,7 +343,7 @@ export function renderStateCell(state: ITaskState, t: Function) {
return h(NTooltip, null, { return h(NTooltip, null, {
trigger: () => { trigger: () => {
if (!stateOption.isSpin) return Icon if (!stateOption.isSpin) return Icon
return h(NSpin, { size: 'small' }, { icon: () => Icon }) return h(NSpin, { size: 18 }, { icon: () => Icon })
}, },
default: () => stateOption.desc default: () => stateOption.desc
}) })

19
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx

@ -87,6 +87,7 @@ export default defineComponent({
name: '', name: '',
description: '', description: '',
tenantCode: 'default', tenantCode: 'default',
executionType: 'PARALLEL',
timeoutFlag: false, timeoutFlag: false,
timeout: 0, timeout: 0,
globalParams: [], globalParams: [],
@ -94,6 +95,12 @@ export default defineComponent({
sync: false sync: false
}) })
const formRef = ref() const formRef = ref()
const executeTypeOptions = [
{ value: 'PARALLEL', label: 'parallel' },
{ value: 'SERIAL_WAIT', label: 'Serial wait' },
{ value: 'SERIAL_DISCARD', label: 'Serial discard' },
{ value: 'SERIAL_PRIORITY', label: 'Serial priority' }
]
const rule = { const rule = {
name: { name: {
required: true, required: true,
@ -155,6 +162,7 @@ export default defineComponent({
formValue.value.name = process.name formValue.value.name = process.name
formValue.value.description = process.description formValue.value.description = process.description
formValue.value.tenantCode = process.tenantCode || 'default' formValue.value.tenantCode = process.tenantCode || 'default'
formValue.value.executionType = process.executionType || 'PARALLEL'
if (process.timeout && process.timeout > 0) { if (process.timeout && process.timeout > 0) {
formValue.value.timeoutFlag = true formValue.value.timeoutFlag = true
formValue.value.timeout = process.timeout formValue.value.timeout = process.timeout
@ -214,6 +222,17 @@ export default defineComponent({
/> />
</NFormItem> </NFormItem>
)} )}
{!props.instance && (
<NFormItem
label={t('project.dag.process_execute_type')}
path='executionType'
>
<NSelect
options={executeTypeOptions}
v-model:value={formValue.value.executionType}
/>
</NFormItem>
)}
<NFormItem <NFormItem
label={t('project.dag.global_variables')} label={t('project.dag.global_variables')}
path='globalParams' path='globalParams'

2
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/types.ts

@ -40,6 +40,7 @@ export interface ProcessDefinition {
timeout: number timeout: number
tenantId: number tenantId: number
tenantCode: string tenantCode: string
executionType: string
modifyBy?: any modifyBy?: any
warningGroupId: number warningGroupId: number
} }
@ -142,6 +143,7 @@ export interface SaveForm {
name: string name: string
description: string description: string
tenantCode: string tenantCode: string
executionType: string
timeoutFlag: boolean timeoutFlag: boolean
timeout: number timeout: number
globalParams: GlobalParam[] globalParams: GlobalParam[]

2
dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/start-modal.tsx

@ -226,7 +226,7 @@ export default defineComponent({
> >
<div class={styles.formItem} title={this.row.name}> <div class={styles.formItem} title={this.row.name}>
{this.row.name} {this.row.name}
</div> </div>
</NFormItem> </NFormItem>
<NFormItem <NFormItem
label={t('project.workflow.failure_strategy')} label={t('project.workflow.failure_strategy')}

1
dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx

@ -70,6 +70,7 @@ export default defineComponent({
locations: JSON.stringify(locations), locations: JSON.stringify(locations),
name: saveForm.name, name: saveForm.name,
tenantCode: saveForm.tenantCode, tenantCode: saveForm.tenantCode,
executionType: saveForm.executionType,
description: saveForm.description, description: saveForm.description,
globalParams: JSON.stringify(globalParams), globalParams: JSON.stringify(globalParams),
timeout: saveForm.timeoutFlag ? saveForm.timeout : 0 timeout: saveForm.timeoutFlag ? saveForm.timeout : 0

1
dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx

@ -87,6 +87,7 @@ export default defineComponent({
locations: JSON.stringify(locations), locations: JSON.stringify(locations),
name: saveForm.name, name: saveForm.name,
tenantCode: saveForm.tenantCode, tenantCode: saveForm.tenantCode,
executionType: saveForm.executionType,
description: saveForm.description, description: saveForm.description,
globalParams: JSON.stringify(globalParams), globalParams: JSON.stringify(globalParams),
timeout: saveForm.timeoutFlag ? saveForm.timeout : 0, timeout: saveForm.timeoutFlag ? saveForm.timeout : 0,

Loading…
Cancel
Save