Browse Source

align the workflow execution status with those from backend (#13243)

3.2.0-release
calvin 2 years ago committed by GitHub
parent
commit
3ecb4dbe24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 124
      dolphinscheduler-ui/src/common/common.ts
  2. 25
      dolphinscheduler-ui/src/common/types.ts
  3. 5
      dolphinscheduler-ui/src/locales/en_US/project.ts
  4. 4
      dolphinscheduler-ui/src/locales/zh_CN/project.ts
  5. 4
      dolphinscheduler-ui/src/views/projects/workflow/instance/components/process-instance-condition.tsx

124
dolphinscheduler-ui/src/common/common.ts

@ -36,7 +36,7 @@ import {
} from '@vicons/antd' } from '@vicons/antd'
import { format, parseISO } from 'date-fns' import { format, parseISO } from 'date-fns'
import _ from 'lodash' import _ from 'lodash'
import { ITaskStateConfig } from './types' import { ITaskStateConfig, IWorkflowExecutionStateConfig } from './types'
/** /**
* Intelligent display kb m * Intelligent display kb m
*/ */
@ -142,6 +142,21 @@ export const stateType = (t: any) => [
})) }))
] ]
/**
* State code table
*/
export const workflowExecutionStateType = (t: any) => [
{
value: '',
label: `${t('project.workflow.all_status')}`
},
...Object.entries(workflowExecutionState(t)).map(([key, item]) => ({
value: key,
label: item.desc
}))
]
/** /**
* Stream task state * Stream task state
*/ */
@ -317,6 +332,113 @@ export const tasksState = (t: any): ITaskStateConfig => ({
} }
}) })
/**
* Workflow execution status
* @id id
* @desc tooltip
* @color color
* @icon icon
* @isSpin is loading (Need to execute the code block to write if judgment)
*/
export const workflowExecutionState = (t: any): IWorkflowExecutionStateConfig => ({
SUBMITTED_SUCCESS: {
id: 0,
desc: `${t('project.workflow.submit_success')}`,
color: '#A9A9A9',
icon: IssuesCloseOutlined,
isSpin: false,
classNames: 'submitted_success'
},
RUNNING_EXECUTION: {
id: 1,
desc: `${t('project.workflow.executing')}`,
color: '#0097e0',
icon: SettingFilled,
isSpin: true,
classNames: 'running_execution'
},
READY_PAUSE: {
id: 2,
desc: `${t('project.workflow.ready_to_pause')}`,
color: '#07b1a3',
icon: SettingOutlined,
isSpin: false,
classNames: 'ready_pause'
},
PAUSE: {
id: 3,
desc: `${t('project.workflow.pause')}`,
color: '#057c72',
icon: PauseCircleOutlined,
isSpin: false,
classNames: 'pause'
},
READY_STOP: {
id: 4,
desc: `${t('project.workflow.ready_to_stop')}`,
color: '#FE0402',
icon: StopFilled,
isSpin: false,
classNames: 'ready_stop'
},
STOP: {
id: 5,
desc: `${t('project.workflow.stop')}`,
color: '#e90101',
icon: StopOutlined,
isSpin: false,
classNames: 'stop'
},
FAILURE: {
id: 6,
desc: `${t('project.workflow.failed')}`,
color: '#000000',
icon: CloseCircleOutlined,
isSpin: false,
classNames: 'failed'
},
SUCCESS: {
id: 7,
desc: `${t('project.workflow.success')}`,
color: '#95DF96',
icon: CheckCircleOutlined,
isSpin: false,
classNames: 'success'
},
DELAY_EXECUTION: {
id: 12,
desc: `${t('project.workflow.delay_execution')}`,
color: '#5102ce',
icon: PauseCircleFilled,
isSpin: false,
classNames: 'delay_execution'
},
SERIAL_WAIT: {
id: 14,
desc: `${t('project.workflow.serial_wait')}`,
color: '#5102ce',
icon: Loading3QuartersOutlined,
isSpin: true,
classNames: 'serial_wait'
},
READY_BLOCK: {
id: 15,
desc: `${t('project.workflow.ready_to_block')}`,
color: '#5101be',
icon: SendOutlined,
isSpin: false,
classNames: 'pending'
},
BLOCK: {
id: 16,
desc: `${t('project.workflow.block')}`,
color: '#5101be',
icon: HistoryOutlined,
isSpin: false,
classNames: 'pending'
}
})
/** /**
* A simple uuid generator, support prefix and template pattern. * A simple uuid generator, support prefix and template pattern.
* *

25
dolphinscheduler-ui/src/common/types.ts

@ -35,6 +35,20 @@ export type ITaskState =
| 'DISPATCH' | 'DISPATCH'
| 'PENDING' | 'PENDING'
export type IWorkflowExecutionState =
| 'SUBMITTED_SUCCESS'
| 'RUNNING_EXECUTION'
| 'READY_PAUSE'
| 'PAUSE'
| 'READY_STOP'
| 'STOP'
| 'FAILURE'
| 'SUCCESS'
| 'DELAY_EXECUTION'
| 'SERIAL_WAIT'
| 'READY_BLOCK'
| 'BLOCK'
export type ITaskStateConfig = { export type ITaskStateConfig = {
[key in ITaskState]: { [key in ITaskState]: {
id: number id: number
@ -45,3 +59,14 @@ export type ITaskStateConfig = {
classNames?: string classNames?: string
} }
} }
export type IWorkflowExecutionStateConfig = {
[key in IWorkflowExecutionState]: {
id: number
desc: string
color: string
icon: Component
isSpin: boolean
classNames?: string
}
}

5
dolphinscheduler-ui/src/locales/en_US/project.ts

@ -143,6 +143,7 @@ export default {
switch_version: 'Switch To This Version', switch_version: 'Switch To This Version',
confirm_switch_version: 'Confirm Switch To This Version?', confirm_switch_version: 'Confirm Switch To This Version?',
current_version: 'Current Version', current_version: 'Current Version',
run_type: 'Run Type',
scheduling_time: 'Scheduling Time', scheduling_time: 'Scheduling Time',
duration: 'Duration', duration: 'Duration',
run_times: 'Run Times', run_times: 'Run Times',
@ -212,7 +213,9 @@ export default {
workflow_relation_no_data_result_title: workflow_relation_no_data_result_title:
'Can not find any relations of workflows.', 'Can not find any relations of workflows.',
workflow_relation_no_data_result_desc: workflow_relation_no_data_result_desc:
'There is not any workflows. Please create a workflow, and then visit this page again.' 'There is not any workflows. Please create a workflow, and then visit this page again.',
ready_to_block: 'Ready to block',
block: 'Block',
}, },
task: { task: {
on_line: 'Online', on_line: 'Online',

4
dolphinscheduler-ui/src/locales/zh_CN/project.ts

@ -213,7 +213,9 @@ export default {
project_tips: '请选择项目', project_tips: '请选择项目',
workflow_relation_no_data_result_title: '工作流关系不存在', workflow_relation_no_data_result_title: '工作流关系不存在',
workflow_relation_no_data_result_desc: workflow_relation_no_data_result_desc:
'目前没有任何工作流,请先创建工作流,再访问该页面' '目前没有任何工作流,请先创建工作流,再访问该页面',
ready_to_block: '准备锁定',
block: '锁定',
}, },
task: { task: {
on_line: '线上', on_line: '线上',

4
dolphinscheduler-ui/src/views/projects/workflow/instance/components/process-instance-condition.tsx

@ -20,7 +20,7 @@ import { NInput, NButton, NDatePicker, NSelect, NIcon, NSpace } from 'naive-ui'
import { defineComponent, getCurrentInstance, ref } from 'vue' import { defineComponent, getCurrentInstance, ref } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { format } from 'date-fns' import { format } from 'date-fns'
import { stateType } from '@/common/common' import { workflowExecutionStateType } from '@/common/common'
export default defineComponent({ export default defineComponent({
name: 'ProcessInstanceCondition', name: 'ProcessInstanceCondition',
@ -88,7 +88,7 @@ export default defineComponent({
}, },
render() { render() {
const { t } = useI18n() const { t } = useI18n()
const options = stateType(t) const options = workflowExecutionStateType(t)
return ( return (
<NSpace justify='end'> <NSpace justify='end'>

Loading…
Cancel
Save