Browse Source

[Feature][UI Next] Add the form of python task to the module of next ui. (#8438)

* add the form of python task

* developed the form of python task
3.0.0/version-upgrade
calvin 3 years ago committed by GitHub
parent
commit
7da84e4aa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-ui-next/docs/e2e/data-source.md
  2. 2
      dolphinscheduler-ui-next/docs/e2e/login.md
  3. 1
      dolphinscheduler-ui-next/docs/e2e/navbar.md
  4. 22
      dolphinscheduler-ui-next/docs/e2e/project.md
  5. 19
      dolphinscheduler-ui-next/docs/e2e/resource.md
  6. 13
      dolphinscheduler-ui-next/docs/e2e/security.md
  7. 4
      dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-delay-time.ts
  8. 2
      dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-type.ts
  9. 2
      dolphinscheduler-ui-next/src/views/projects/task/components/node/format-data.ts
  10. 83
      dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-python.ts
  11. 2
      dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-shell.ts
  12. 9
      dolphinscheduler-ui-next/src/views/projects/task/components/node/use-task.ts
  13. 1
      dolphinscheduler-ui-next/src/views/projects/task/definition/index.tsx
  14. 13
      dolphinscheduler-ui-next/src/views/security/worker-group-manage/index.tsx

2
dolphinscheduler-ui-next/docs/e2e/data-source.md

@ -1,7 +1,7 @@
### data source
| check | class |
|--------------------|--------------------------------|
| ------------------ | ------------------------------ |
| :white_check_mark: | data-source-items |
| | el-popconfirm |
| | el-button--primary |

2
dolphinscheduler-ui-next/docs/e2e/login.md

@ -1,7 +1,7 @@
### login
| check | class |
|--------------------|----------------|
| ------------------ | --------------- |
| :white_check_mark: | input-user-name |
| :white_check_mark: | input-password |
| :white_check_mark: | btn-login |

1
dolphinscheduler-ui-next/docs/e2e/navbar.md

@ -1,6 +1,7 @@
### navbar
id:
- [ ] tabProject
- [ ] tabSecurity
- [ ] tabResource

22
dolphinscheduler-ui-next/docs/e2e/project.md

@ -1,6 +1,7 @@
### project
class:
- [ ] items-project
- [ ] el-popconfirm
- [ ] el-button--primary
@ -8,6 +9,7 @@ class:
- [ ] delete
id:
- [ ] btnCreateProject
- [ ] inputProjectName
- [ ] btnSubmit
@ -15,6 +17,7 @@ id:
#### detail
class:
- [ ] tab-process-definition
- [ ] tab-process-instance
- [ ] tab-task-instance
@ -22,6 +25,7 @@ class:
#### workflow save dialog
class:
- [ ] input-param-key
- [ ] input-param-val
- [ ] option-tenants
@ -29,6 +33,7 @@ class:
- [ ] add-dp
id:
- [ ] inputName
- [ ] btnSubmit
- [ ] selectTenant
@ -36,11 +41,13 @@ id:
#### workflow run dialog
id:
- [ ] btnSubmit
#### workflow instance tab
class:
- [ ] items-workflow-instances
- [ ] select-all
- [ ] btn-delete-all
@ -54,22 +61,26 @@ class:
#### workflow format dialog
class:
- [ ] el-dialog__wrapper
- [ ] el-dialog\_\_wrapper
- [ ] el-button--primary
#### workflow form
class:
- [ ] graph-format
- [ ] task-item-`type`
- [ ] dag-container
id:
- [ ] btnSave
#### workflow definition tab
class:
- [ ] select-all
- [ ] btn-delete-all
- [ ] el-popconfirm
@ -81,11 +92,13 @@ class:
- [ ] btn-cancel-publish
id:
- [ ] btnCreateProcess
#### task instance tab
class:
- [ ] items-task-instances
- [ ] task-instance-state
- [ ] task-instance-name
@ -93,18 +106,21 @@ class:
#### switch task form
class:
- [ ] switch-task
- [ ] switch-else
- [ ] el-input__inner
- [ ] el-input\_\_inner
- [ ] option-else-branches
- [ ] option-if-branches
id:
- [ ] btnAddIfBranch
#### switch task if branch
class:
- [ ] switch-task
- [ ] switch-list
- [ ] el-input
@ -112,6 +128,7 @@ class:
#### task node form
class:
- [ ] input-param-key
- [ ] input-param-val
- [ ] pre_tasks-model
@ -121,5 +138,6 @@ class:
- [ ] option-pre-tasks
id:
- [ ] inputNodeName
- [ ] btnSubmit

19
dolphinscheduler-ui-next/docs/e2e/resource.md

@ -3,11 +3,13 @@
#### file manage
class:
- [ ] items
- [ ] el-popconfirm
- [ ] el-button--primary
id:
- [ ] btnCreateDirectory
- [ ] btnCreateFile
- [ ] btnUploadFile
@ -19,6 +21,7 @@ id:
##### create directory
id:
- [ ] inputDirectoryName
- [ ] inputDescription
- [ ] btnSubmit
@ -27,6 +30,7 @@ id:
##### rename directory
id:
- [ ] inputName
- [ ] inputDescription
- [ ] btnSubmit
@ -35,6 +39,7 @@ id:
##### create file
id:
- [ ] inputFileName
- [ ] btnSubmit
- [ ] btnCancel
@ -42,6 +47,7 @@ id:
##### upload file
id:
- [ ] btnUpload
- [ ] btnSubmit
- [ ] btnCancel
@ -49,11 +55,13 @@ id:
#### function manage
class:
- [ ] udf-function-items
- [ ] el-popconfirm
- [ ] el-button--primary
id:
- [ ] btnCreateUdfFunction
- [ ] btnRename
- [ ] btnDelete
@ -61,9 +69,11 @@ id:
##### create unf function
class:
- [ ] vue-treeselect__menu
- [ ] vue-treeselect\_\_menu
id:
- [ ] inputFunctionName
- [ ] inputClassName
- [ ] btnUdfResourceDropDown
@ -74,6 +84,7 @@ id:
##### rename udf function
id:
- [ ] inputFunctionName
- [ ] inputClassName
- [ ] inputDescription
@ -83,6 +94,7 @@ id:
#### resource
class:
- [ ] tab-file-manage
- [ ] tab-udf-resource-manage
- [ ] tab-function-resource-manage
@ -90,11 +102,13 @@ class:
#### udf manage
class:
- [ ] udf-items
- [ ] el-popconfirm
- [ ] el-button--primary
id:
- [ ] btnCreateDirectory
- [ ] btnUploadUdf
- [ ] btnDownload
@ -104,6 +118,7 @@ id:
##### rename directory
id:
- [ ] inputName
- [ ] inputDescription
- [ ] btnSubmit
@ -112,6 +127,7 @@ id:
##### upload file
id:
- [ ] btnUpload
- [ ] btnSubmit
- [ ] btnCancel
@ -119,6 +135,7 @@ id:
##### create directory
id:
- [ ] inputDirectoryName
- [ ] inputDescription
- [ ] btnSubmit

13
dolphinscheduler-ui-next/docs/e2e/security.md

@ -1,6 +1,7 @@
### security
class:
- [ ] tab-tenant-manage
- [ ] tab-user-manage
- [ ] tab-worker-group-manage
@ -11,6 +12,7 @@ class:
#### tenant manage
class:
- [ ] items
- [ ] el-popconfirm
- [ ] el-button--primary
@ -19,6 +21,7 @@ class:
- [ ] delete
id:
- [ ] btnCreateTenant
- [ ] inputTenantCode
- [ ] selectQueue
@ -29,6 +32,7 @@ id:
#### user manage
class:
- [ ] items
- [ ] el-popconfirm
- [ ] el-button--primary
@ -37,6 +41,7 @@ class:
- [ ] delete
id:
- [ ] btnCreateUser
- [ ] inputUserName
- [ ] inputUserPassword
@ -52,7 +57,7 @@ id:
#### worker group manage
| check | class |
|--------------------|--------------------------------|
| ------------------ | ----------------------- |
| :white_check_mark: | items |
| | el-popconfirm |
| | el-button--primary |
@ -68,7 +73,7 @@ id:
#### queue manage
| check | class |
|--------------------|--------------------------------|
| ------------------ | ----------------- |
| :white_check_mark: | items |
| :white_check_mark: | queue-name |
| :white_check_mark: | edit |
@ -81,7 +86,7 @@ id:
#### environment manage
| check | class |
|--------------------|--------------------------------|
| ------------------ | ------------------------------ |
| :white_check_mark: | items |
| | el-popconfirm |
| | el-button--primary |
@ -99,7 +104,7 @@ id:
#### token manage
| check | class |
|--------------------|--------------------|
| ------------------ | ------------------ |
| :white_check_mark: | items |
| | el-popconfirm |
| | el-button--primary |

4
dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-delay-time.ts

@ -18,7 +18,7 @@
import { useI18n } from 'vue-i18n'
import type { IJsonItem } from '../types'
export function useDelayTime(): IJsonItem {
export function useDelayTime(model: { [field: string]: any }): IJsonItem {
const { t } = useI18n()
return {
type: 'input-number',
@ -28,6 +28,6 @@ export function useDelayTime(): IJsonItem {
slots: {
suffix: () => t('project.node.minute')
},
value: 0
value: model.delayExecutionTime ? model.delayExecutionTime : 0
}
}

2
dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-type.ts

@ -43,6 +43,6 @@ export function useTaskType(
required: true,
message: t('project.node.task_type_tips')
},
value: 'SHELL'
value: model.taskType ? model.taskType : 'SHELL'
}
}

2
dolphinscheduler-ui-next/src/views/projects/task/components/node/format-data.ts

@ -43,7 +43,7 @@ export function formatParams(data: INodeData): {
'processName'
]),
code: data.code,
delayTime: data.delayTime ? '0' : String(data.delayTime),
delayTime: data.delayTime ? String(data.delayTime) : '0',
environmentCode: data.environmentCode || -1,
failRetryTimes: data.failRetryTimes ? String(data.failRetryTimes) : '0',
failRetryInterval: data.failRetryTimes

83
dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-python.ts

@ -0,0 +1,83 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { reactive } from 'vue'
import * as Fields from '../fields/index'
import type { IJsonItem, INodeData } from '../types'
import { ITaskData } from '../types'
export function usePython({
projectCode,
from = 0,
readonly,
data
}: {
projectCode: number
from?: number
readonly?: boolean
data?: ITaskData
}) {
const model = reactive({
name: '',
taskType: 'PYTHON',
flag: 'YES',
description: '',
timeoutFlag: false,
localParams: [],
environmentCode: null,
failRetryInterval: 1,
failRetryTimes: 0,
workerGroup: 'default',
delayTime: 0,
timeout: 30,
rawScript: ''
} as INodeData)
let extra: IJsonItem[] = []
if (from === 1) {
extra = [
Fields.useTaskType(model, readonly),
Fields.useProcessName({
model,
projectCode,
isCreate: !data?.id,
from,
processName: data?.processName,
code: data?.code
})
]
}
return {
json: [
Fields.useName(),
...extra,
Fields.useRunFlag(),
Fields.useDescription(),
Fields.useTaskPriority(),
Fields.useWorkerGroup(),
Fields.useEnvironmentName(model, !model.id),
...Fields.useTaskGroup(model, projectCode),
...Fields.useFailed(),
Fields.useDelayTime(model),
...Fields.useTimeoutAlarm(model),
...Fields.useShell(model),
Fields.usePreTasks(model)
] as IJsonItem[],
model
}
}

2
dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-shell.ts

@ -71,7 +71,7 @@ export function useShell({
Fields.useEnvironmentName(model, !data?.id),
...Fields.useTaskGroup(model, projectCode),
...Fields.useFailed(),
Fields.useDelayTime(),
Fields.useDelayTime(model),
...Fields.useTimeoutAlarm(model),
...Fields.useShell(model),
Fields.usePreTasks(model)

9
dolphinscheduler-ui-next/src/views/projects/task/components/node/use-task.ts

@ -16,6 +16,7 @@
*/
import { useShell } from './tasks/use-shell'
import { usePython } from './tasks/use-python'
import { IJsonItem, INodeData, ITaskData } from './types'
export function useTask({
@ -39,5 +40,13 @@ export function useTask({
data
})
}
if (taskType === 'PYTHON') {
node = usePython({
projectCode,
from,
readonly,
data
})
}
return node
}

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

@ -77,6 +77,7 @@ const TaskDefinition = defineComponent({
requestData()
}
const onCreate = () => {
task.taskReadonly = false
onToggleShow(true)
}
const onTaskCancel = () => {

13
dolphinscheduler-ui-next/src/views/security/worker-group-manage/index.tsx

@ -106,7 +106,12 @@ const workerGroupManage = defineComponent({
<NCard>
<div class={styles['search-card']}>
<div>
<NButton size='small' type='primary' onClick={handleModalChange} class='btn-create-worker-group'>
<NButton
size='small'
type='primary'
onClick={handleModalChange}
class='btn-create-worker-group'
>
{t('security.worker_group.create_worker_group')}
</NButton>
</div>
@ -130,7 +135,11 @@ const workerGroupManage = defineComponent({
</div>
</NCard>
<Card class={styles['table-card']}>
<NDataTable row-class-name='items' columns={this.columns} data={this.tableData} />
<NDataTable
row-class-name='items'
columns={this.columns}
data={this.tableData}
/>
<div class={styles.pagination}>
<NPagination
v-model:page={this.page}

Loading…
Cancel
Save