You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by so...@apache.org on 2022/02/19 02:56:42 UTC

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

This is an automated email from the ASF dual-hosted git repository.

songjian pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 7da84e4  [Feature][UI Next] Add the form of python task to the module of next ui. (#8438)
7da84e4 is described below

commit 7da84e4aa19bb664681c89e111db0a7d7c75ef2b
Author: calvin <ji...@163.com>
AuthorDate: Sat Feb 19 10:56:34 2022 +0800

    [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
---
 dolphinscheduler-ui-next/docs/e2e/data-source.md   |  6 +--
 dolphinscheduler-ui-next/docs/e2e/login.md         |  8 +--
 dolphinscheduler-ui-next/docs/e2e/navbar.md        |  1 +
 dolphinscheduler-ui-next/docs/e2e/project.md       | 22 +++++++-
 dolphinscheduler-ui-next/docs/e2e/resource.md      | 19 ++++++-
 dolphinscheduler-ui-next/docs/e2e/security.md      | 63 ++++++++++++----------
 .../src/components/crontab/index.module.scss       | 10 ++--
 .../task/components/node/fields/use-delay-time.ts  |  4 +-
 .../task/components/node/fields/use-task-type.ts   |  2 +-
 .../projects/task/components/node/format-data.ts   |  2 +-
 .../node/tasks/{use-shell.ts => use-python.ts}     | 10 ++--
 .../task/components/node/tasks/use-shell.ts        |  2 +-
 .../projects/task/components/node/use-task.ts      |  9 ++++
 .../src/views/projects/task/definition/index.tsx   |  1 +
 .../projects/workflow/instance/index.module.scss   |  2 +-
 .../views/security/worker-group-manage/index.tsx   | 13 ++++-
 16 files changed, 118 insertions(+), 56 deletions(-)

diff --git a/dolphinscheduler-ui-next/docs/e2e/data-source.md b/dolphinscheduler-ui-next/docs/e2e/data-source.md
index f93098d..adde210 100644
--- a/dolphinscheduler-ui-next/docs/e2e/data-source.md
+++ b/dolphinscheduler-ui-next/docs/e2e/data-source.md
@@ -1,10 +1,10 @@
 ### data source
 
 | check              | class                          |
-|--------------------|--------------------------------|
+| ------------------ | ------------------------------ |
 | :white_check_mark: | data-source-items              |
-|  | el-popconfirm                  |
-|  | el-button--primary             |
+|                    | el-popconfirm                  |
+|                    | el-button--primary             |
 | :white_check_mark: | options-datasource-type        |
 | :white_check_mark: | btn-create-data-source         |
 | :white_check_mark: | dialog-create-data-source      |
diff --git a/dolphinscheduler-ui-next/docs/e2e/login.md b/dolphinscheduler-ui-next/docs/e2e/login.md
index fb1cc92..7f3e5e1 100644
--- a/dolphinscheduler-ui-next/docs/e2e/login.md
+++ b/dolphinscheduler-ui-next/docs/e2e/login.md
@@ -1,7 +1,7 @@
 ### login
 
-| check              | class          |
-|--------------------|----------------|
+| check              | class           |
+| ------------------ | --------------- |
 | :white_check_mark: | input-user-name |
-| :white_check_mark: | input-password |
-| :white_check_mark: | btn-login |
+| :white_check_mark: | input-password  |
+| :white_check_mark: | btn-login       |
diff --git a/dolphinscheduler-ui-next/docs/e2e/navbar.md b/dolphinscheduler-ui-next/docs/e2e/navbar.md
index 0fdd33d..17bc69d 100644
--- a/dolphinscheduler-ui-next/docs/e2e/navbar.md
+++ b/dolphinscheduler-ui-next/docs/e2e/navbar.md
@@ -1,6 +1,7 @@
 ### navbar
 
 id:
+
 - [ ] tabProject
 - [ ] tabSecurity
 - [ ] tabResource
diff --git a/dolphinscheduler-ui-next/docs/e2e/project.md b/dolphinscheduler-ui-next/docs/e2e/project.md
index 4cb9c9a..582a832 100644
--- a/dolphinscheduler-ui-next/docs/e2e/project.md
+++ b/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
diff --git a/dolphinscheduler-ui-next/docs/e2e/resource.md b/dolphinscheduler-ui-next/docs/e2e/resource.md
index 8a65841..452a2a2 100644
--- a/dolphinscheduler-ui-next/docs/e2e/resource.md
+++ b/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
diff --git a/dolphinscheduler-ui-next/docs/e2e/security.md b/dolphinscheduler-ui-next/docs/e2e/security.md
index b581ff9..16e37cd 100644
--- a/dolphinscheduler-ui-next/docs/e2e/security.md
+++ b/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
@@ -51,40 +56,40 @@ id:
 
 #### worker group manage
 
-| check              | class                          |
-|--------------------|--------------------------------|
-| :white_check_mark: | items                          |
-|  | el-popconfirm                  |
-|  | el-button--primary             |
-| :white_check_mark: | name                           |
-| :white_check_mark: | edit                           |
-| :white_check_mark: | delete                         |
-| :white_check_mark: | btn-create-worker-group        |
-| :white_check_mark: | input-worker-group-name        |
-| :white_check_mark: | select-worker-address          |
-| :white_check_mark: | btn-submit                     |
-| :white_check_mark: | btn-cancel                     |
+| check              | class                   |
+| ------------------ | ----------------------- |
+| :white_check_mark: | items                   |
+|                    | el-popconfirm           |
+|                    | el-button--primary      |
+| :white_check_mark: | name                    |
+| :white_check_mark: | edit                    |
+| :white_check_mark: | delete                  |
+| :white_check_mark: | btn-create-worker-group |
+| :white_check_mark: | input-worker-group-name |
+| :white_check_mark: | select-worker-address   |
+| :white_check_mark: | btn-submit              |
+| :white_check_mark: | btn-cancel              |
 
 #### queue manage
 
-| check              | class                          |
-|--------------------|--------------------------------|
-| :white_check_mark: | items                          |
-| :white_check_mark: | queue-name                     |
-| :white_check_mark: | edit                           |
-| :white_check_mark: | btn-create-queue               |
-| :white_check_mark: | input-queue-name               |
-| :white_check_mark: | input-queue-value              |
-| :white_check_mark: | btn-submit                     |
-| :white_check_mark: | btn-cancel                     |
+| check              | class             |
+| ------------------ | ----------------- |
+| :white_check_mark: | items             |
+| :white_check_mark: | queue-name        |
+| :white_check_mark: | edit              |
+| :white_check_mark: | btn-create-queue  |
+| :white_check_mark: | input-queue-name  |
+| :white_check_mark: | input-queue-value |
+| :white_check_mark: | btn-submit        |
+| :white_check_mark: | btn-cancel        |
 
 #### environment manage
 
 | check              | class                          |
-|--------------------|--------------------------------|
+| ------------------ | ------------------------------ |
 | :white_check_mark: | items                          |
-|  | el-popconfirm                  |
-|  | el-button--primary             |
+|                    | el-popconfirm                  |
+|                    | el-button--primary             |
 | :white_check_mark: | environment-name               |
 | :white_check_mark: | edit                           |
 | :white_check_mark: | delete                         |
@@ -99,10 +104,10 @@ id:
 #### token manage
 
 | check              | class              |
-|--------------------|--------------------|
+| ------------------ | ------------------ |
 | :white_check_mark: | items              |
-|  | el-popconfirm      |
-|  | el-button--primary |
+|                    | el-popconfirm      |
+|                    | el-button--primary |
 | :white_check_mark: | username           |
 | :white_check_mark: | token              |
 | :white_check_mark: | input-username     |
diff --git a/dolphinscheduler-ui-next/src/components/crontab/index.module.scss b/dolphinscheduler-ui-next/src/components/crontab/index.module.scss
index 8c3fb30..93440f2 100644
--- a/dolphinscheduler-ui-next/src/components/crontab/index.module.scss
+++ b/dolphinscheduler-ui-next/src/components/crontab/index.module.scss
@@ -15,9 +15,9 @@
  * limitations under the License.
  */
 
- .crontab-list {
-   display: flex;
-   .crontab-list-item {
+.crontab-list {
+  display: flex;
+  .crontab-list-item {
     display: flex;
     vertical-align: middle;
     align-items: center;
@@ -25,5 +25,5 @@
     > div {
       margin: 5px;
     }
-   }
- }
\ No newline at end of file
+  }
+}
diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-delay-time.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-delay-time.ts
index 7a304d6..18af039 100644
--- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-delay-time.ts
+++ b/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
   }
 }
diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-type.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-type.ts
index 9450550..026cd97 100644
--- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-type.ts
+++ b/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'
   }
 }
diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/format-data.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/format-data.ts
index 717a303..892238c 100644
--- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/format-data.ts
+++ b/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
diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-shell.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-python.ts
similarity index 89%
copy from dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-shell.ts
copy to dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-python.ts
index 865ae87..b747e37 100644
--- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-shell.ts
+++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-python.ts
@@ -17,9 +17,10 @@
 
 import { reactive } from 'vue'
 import * as Fields from '../fields/index'
-import type { IJsonItem, INodeData, ITaskData } from '../types'
+import type { IJsonItem, INodeData } from '../types'
+import { ITaskData } from '../types'
 
-export function useShell({
+export function usePython({
   projectCode,
   from = 0,
   readonly,
@@ -32,6 +33,7 @@ export function useShell({
 }) {
   const model = reactive({
     name: '',
+    taskType: 'PYTHON',
     flag: 'YES',
     description: '',
     timeoutFlag: false,
@@ -68,10 +70,10 @@ export function useShell({
       Fields.useDescription(),
       Fields.useTaskPriority(),
       Fields.useWorkerGroup(),
-      Fields.useEnvironmentName(model, !data?.id),
+      Fields.useEnvironmentName(model, !model.id),
       ...Fields.useTaskGroup(model, projectCode),
       ...Fields.useFailed(),
-      Fields.useDelayTime(),
+      Fields.useDelayTime(model),
       ...Fields.useTimeoutAlarm(model),
       ...Fields.useShell(model),
       Fields.usePreTasks(model)
diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-shell.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-shell.ts
index 865ae87..5c4b99d 100644
--- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-shell.ts
+++ b/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)
diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/use-task.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/use-task.ts
index c0b5d03..258988c 100644
--- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/use-task.ts
+++ b/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
 }
diff --git a/dolphinscheduler-ui-next/src/views/projects/task/definition/index.tsx b/dolphinscheduler-ui-next/src/views/projects/task/definition/index.tsx
index 74022da..022e830 100644
--- a/dolphinscheduler-ui-next/src/views/projects/task/definition/index.tsx
+++ b/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 = () => {
diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/instance/index.module.scss b/dolphinscheduler-ui-next/src/views/projects/workflow/instance/index.module.scss
index 7622b8b..cfaee42 100644
--- a/dolphinscheduler-ui-next/src/views/projects/workflow/instance/index.module.scss
+++ b/dolphinscheduler-ui-next/src/views/projects/workflow/instance/index.module.scss
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
- .content {
+.content {
   width: 100%;
 
   .card {
diff --git a/dolphinscheduler-ui-next/src/views/security/worker-group-manage/index.tsx b/dolphinscheduler-ui-next/src/views/security/worker-group-manage/index.tsx
index d1534a0..4ad51f0 100644
--- a/dolphinscheduler-ui-next/src/views/security/worker-group-manage/index.tsx
+++ b/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}