You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by wa...@apache.org on 2021/12/20 13:29:14 UTC
[dolphinscheduler] branch dev updated: [Feature][UI Next] Write part of the api method. (#7507)
This is an automated email from the ASF dual-hosted git repository.
wangyizhi 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 0d86a48 [Feature][UI Next] Write part of the api method. (#7507)
0d86a48 is described below
commit 0d86a48d1c3caddf813bbf7f3453e1e7d624c760
Author: songjianet <17...@qq.com>
AuthorDate: Mon Dec 20 21:29:10 2021 +0800
[Feature][UI Next] Write part of the api method. (#7507)
---
.../service/modules/{queues => lineages}/index.ts | 57 ++---
.../{resources/index.ts => lineages/types.ts} | 10 +
.../src/service/modules/process-instances/index.ts | 147 +++++++------
.../src/service/modules/process-instances/types.ts | 2 +-
.../service/modules/process-task-relation/index.ts | 106 ++++++++++
.../{projects => process-task-relation}/types.ts | 44 ++--
.../src/service/modules/projects/index.ts | 92 ++++----
.../src/service/modules/projects/types.ts | 24 +--
.../src/service/modules/queues/index.ts | 50 ++---
.../src/service/modules/queues/types.ts | 12 +-
.../src/service/modules/resources/index.ts | 232 +++++++++++++++++++++
.../src/service/modules/resources/types.ts | 96 +++++++--
.../src/service/modules/schedules/index.ts | 119 +++++++++++
.../{process-instances => schedules}/types.ts | 98 ++++-----
.../src/service/modules/task-definition/index.ts | 143 +++++++++++++
.../modules/{projects => task-definition}/types.ts | 58 ++++--
.../types.ts => task-instances/index.ts} | 56 ++---
.../modules/{queues => task-instances}/types.ts | 27 ++-
.../service/modules/{queues => tenants}/index.ts | 67 +++---
.../service/modules/{queues => tenants}/types.ts | 20 +-
.../{queues/types.ts => ui-plugins/index.ts} | 25 +--
.../{resources/index.ts => ui-plugins/types.ts} | 10 +
.../src/service/modules/users/index.ts | 184 ++++++++++++++++
.../modules/{process-instances => users}/types.ts | 120 ++++++-----
.../modules/{queues => worker-groups}/index.ts | 58 +++---
.../modules/{queues => worker-groups}/types.ts | 17 +-
dolphinscheduler-ui-next/src/service/service.ts | 11 +-
dolphinscheduler-ui-next/src/views/login/index.tsx | 2 +-
28 files changed, 1394 insertions(+), 493 deletions(-)
diff --git a/dolphinscheduler-ui-next/src/service/modules/queues/index.ts b/dolphinscheduler-ui-next/src/service/modules/lineages/index.ts
similarity index 56%
copy from dolphinscheduler-ui-next/src/service/modules/queues/index.ts
copy to dolphinscheduler-ui-next/src/service/modules/lineages/index.ts
index 32e17c5..3b00c7a 100644
--- a/dolphinscheduler-ui-next/src/service/modules/queues/index.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/lineages/index.ts
@@ -16,43 +16,32 @@
*/
import { axios } from '@/service/service'
-import {ListReq, QueueReq, IdReq} from './types'
+import { ProjectCodeReq, WorkFlowNameReq } from './types'
-export function queryQueueListPaging(params: ListReq): any {
- return axios({
- url: `/queues`,
- method: 'get',
- params
- })
+export function queryWorkFlowList(projectCode: ProjectCodeReq): any {
+ return axios({
+ url: `/projects/${projectCode}/lineages/list`,
+ method: 'get',
+ })
}
-export function createQueue(data: QueueReq): any {
- return axios({
- url: `/queues`,
- method: 'post',
- data
- })
+export function queryLineageByWorkFlowName(
+ params: WorkFlowNameReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/lineages/query-by-name`,
+ method: 'get',
+ params,
+ })
}
-export function queryList(): any {
- return axios({
- url: `/queues/list`,
- method: 'get',
- })
-}
-
-export function verifyQueue(data: QueueReq): any {
- return axios({
- url: `/queues/verify`,
- method: 'post',
- data
- })
-}
-
-export function updateQueue(data: QueueReq, id: IdReq): any {
- return axios({
- url: `/queues/${id}`,
- method: 'put',
- data
- })
+export function queryLineageByWorkFlowCode(
+ workFlowCode: WorkFlowNameReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/lineages/${workFlowCode}`,
+ method: 'get',
+ })
}
diff --git a/dolphinscheduler-ui-next/src/service/modules/resources/index.ts b/dolphinscheduler-ui-next/src/service/modules/lineages/types.ts
similarity index 84%
copy from dolphinscheduler-ui-next/src/service/modules/resources/index.ts
copy to dolphinscheduler-ui-next/src/service/modules/lineages/types.ts
index 3e7c6c2..1c748b1 100644
--- a/dolphinscheduler-ui-next/src/service/modules/resources/index.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/lineages/types.ts
@@ -14,3 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+interface ProjectCodeReq {
+ projectCode: number
+}
+
+interface WorkFlowNameReq {
+ workFlowName: string
+}
+
+export { ProjectCodeReq, WorkFlowNameReq }
diff --git a/dolphinscheduler-ui-next/src/service/modules/process-instances/index.ts b/dolphinscheduler-ui-next/src/service/modules/process-instances/index.ts
index 832262b..2371f4a 100644
--- a/dolphinscheduler-ui-next/src/service/modules/process-instances/index.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/process-instances/index.ts
@@ -17,95 +17,114 @@
import { axios } from '@/service/service'
import {
- CodeReq,
- ProcessInstanceListReq,
- BatchDeleteReq,
- SubIdReq,
- TaskReq,
- LongestReq,
- IdReq,
- ProcessInstanceReq
+ CodeReq,
+ ProcessInstanceListReq,
+ BatchDeleteReq,
+ SubIdReq,
+ TaskReq,
+ LongestReq,
+ IdReq,
+ ProcessInstanceReq,
} from './types'
-export function queryProcessInstanceListPaging(params: ProcessInstanceListReq, code: CodeReq): any {
- return axios({
- url: `/projects/${code}/process-instances`,
- method: 'get',
- params,
- })
+export function queryProcessInstanceListPaging(
+ params: ProcessInstanceListReq,
+ code: CodeReq
+): any {
+ return axios({
+ url: `/projects/${code}/process-instances`,
+ method: 'get',
+ params,
+ })
}
-export function batchDeleteProcessInstanceByIds(data: BatchDeleteReq, code: CodeReq): any {
- return axios({
- url: `/projects/${code}/process-instances/batch-delete`,
- method: 'post',
- data,
- })
+export function batchDeleteProcessInstanceByIds(
+ data: BatchDeleteReq,
+ code: CodeReq
+): any {
+ return axios({
+ url: `/projects/${code}/process-instances/batch-delete`,
+ method: 'post',
+ data,
+ })
}
-export function queryParentInstanceBySubId(params: SubIdReq, code: CodeReq): any {
- return axios({
- url: `/projects/${code}/process-instances/query-parent-by-sub`,
- method: 'get',
- params,
- })
+export function queryParentInstanceBySubId(
+ params: SubIdReq,
+ code: CodeReq
+): any {
+ return axios({
+ url: `/projects/${code}/process-instances/query-parent-by-sub`,
+ method: 'get',
+ params,
+ })
}
-export function querySubProcessInstanceByTaskCode(params: TaskReq, code: CodeReq): any {
- return axios({
- url: `/projects/${code}/process-instances/query-sub-by-parent`,
- method: 'get',
- params,
- })
+export function querySubProcessInstanceByTaskCode(
+ params: TaskReq,
+ code: CodeReq
+): any {
+ return axios({
+ url: `/projects/${code}/process-instances/query-sub-by-parent`,
+ method: 'get',
+ params,
+ })
}
-export function queryTopNLongestRunningProcessInstance(params: LongestReq, code: CodeReq): any {
- return axios({
- url: `/projects/${code}/process-instances/top-n`,
- method: 'get',
- params,
- })
+export function queryTopNLongestRunningProcessInstance(
+ params: LongestReq,
+ code: CodeReq
+): any {
+ return axios({
+ url: `/projects/${code}/process-instances/top-n`,
+ method: 'get',
+ params,
+ })
}
export function queryProcessInstanceById(id: IdReq, code: CodeReq): any {
- return axios({
- url: `/projects/${code}/process-instances/${id}`,
- method: 'get',
- })
+ return axios({
+ url: `/projects/${code}/process-instances/${id}`,
+ method: 'get',
+ })
}
-export function updateProcessInstance(data: ProcessInstanceReq, id: IdReq, code: CodeReq): any {
- return axios({
- url: `/projects/${code}/process-instances/${id}`,
- method: 'put',
- data
- })
+export function updateProcessInstance(
+ data: ProcessInstanceReq,
+ id: IdReq,
+ code: CodeReq
+): any {
+ return axios({
+ url: `/projects/${code}/process-instances/${id}`,
+ method: 'put',
+ data,
+ })
}
export function deleteProcessInstanceById(id: IdReq, code: CodeReq): any {
- return axios({
- url: `/projects/${code}/process-instances/${id}`,
- method: 'delete',
- })
+ return axios({
+ url: `/projects/${code}/process-instances/${id}`,
+ method: 'delete',
+ })
}
export function queryTaskListByProcessId(id: IdReq, code: CodeReq): any {
- return axios({
- url: `/projects/${code}/process-instances/${id}/tasks`,
- method: 'get',
- })
+ return axios({
+ url: `/projects/${code}/process-instances/${id}/tasks`,
+ method: 'get',
+ })
}
export function vieGanttTree(id: IdReq, code: CodeReq): any {
- return axios({
- url: `/projects/${code}/process-instances/${id}/view-gantt`,
- method: 'get',
- })
+ return axios({
+ url: `/projects/${code}/process-instances/${id}/view-gantt`,
+ method: 'get',
+ })
}
export function viewVariables(id: IdReq, code: CodeReq): any {
- return axios({
- url: `/projects/${code}/process-instances/${id}/view-variables`,
- method: 'get',
- })
+ return axios({
+ url: `/projects/${code}/process-instances/${id}/view-variables`,
+ method: 'get',
+ })
}
diff --git a/dolphinscheduler-ui-next/src/service/modules/process-instances/types.ts b/dolphinscheduler-ui-next/src/service/modules/process-instances/types.ts
index 488a142..bd1b6f7 100644
--- a/dolphinscheduler-ui-next/src/service/modules/process-instances/types.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/process-instances/types.ts
@@ -90,5 +90,5 @@ export {
TaskReq,
LongestReq,
IdReq,
- ProcessInstanceReq
+ ProcessInstanceReq,
}
diff --git a/dolphinscheduler-ui-next/src/service/modules/process-task-relation/index.ts b/dolphinscheduler-ui-next/src/service/modules/process-task-relation/index.ts
new file mode 100644
index 0000000..047f7e8
--- /dev/null
+++ b/dolphinscheduler-ui-next/src/service/modules/process-task-relation/index.ts
@@ -0,0 +1,106 @@
+/*
+ * 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 {
+ ProjectCodeReq,
+ ProcessDefinitionCodeReq,
+ PreTaskCodesReq,
+ PostTaskCodesReq,
+ TaskCodeReq,
+ SaveReq,
+ MoveReq,
+} from './types'
+import { axios } from '@/service/service'
+
+export function save(data: SaveReq, projectCode: ProjectCodeReq): any {
+ return axios({
+ url: `/projects/${projectCode}/process-task-relation`,
+ method: 'post',
+ data,
+ })
+}
+
+export function moveRelation(data: MoveReq, projectCode: ProjectCodeReq): any {
+ return axios({
+ url: `/projects/${projectCode}/process-task-relation/move`,
+ method: 'post',
+ data,
+ })
+}
+
+export function deleteEdge(data: SaveReq): any {
+ return axios({
+ url: `/projects/${data.projectCode}/process-task-relation/${data.processDefinitionCode}/${data.preTaskCode}/${data.postTaskCode}`,
+ method: 'delete',
+ })
+}
+
+export function deleteRelation(
+ data: ProcessDefinitionCodeReq,
+ projectCode: ProjectCodeReq,
+ taskCode: TaskCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/process-task-relation/${taskCode}`,
+ method: 'delete',
+ data,
+ })
+}
+
+export function queryDownstreamRelation(
+ projectCode: ProjectCodeReq,
+ taskCode: TaskCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/process-task-relation/${taskCode}/downstream`,
+ method: 'get',
+ })
+}
+
+export function deleteDownstreamRelation(
+ data: PostTaskCodesReq,
+ projectCode: ProjectCodeReq,
+ taskCode: TaskCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/process-task-relation/${taskCode}/downstream`,
+ method: 'delete',
+ data,
+ })
+}
+
+export function queryUpstreamRelation(
+ projectCode: ProjectCodeReq,
+ taskCode: TaskCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/process-task-relation/${taskCode}/upstream`,
+ method: 'get',
+ })
+}
+
+export function deleteUpstreamRelation(
+ data: PreTaskCodesReq,
+ projectCode: ProjectCodeReq,
+ taskCode: TaskCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/process-task-relation/${taskCode}/upstream`,
+ method: 'delete',
+ data,
+ })
+}
diff --git a/dolphinscheduler-ui-next/src/service/modules/projects/types.ts b/dolphinscheduler-ui-next/src/service/modules/process-task-relation/types.ts
similarity index 57%
copy from dolphinscheduler-ui-next/src/service/modules/projects/types.ts
copy to dolphinscheduler-ui-next/src/service/modules/process-task-relation/types.ts
index 288f1c1..ad00bf3 100644
--- a/dolphinscheduler-ui-next/src/service/modules/projects/types.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/process-task-relation/types.ts
@@ -15,33 +15,41 @@
* limitations under the License.
*/
-interface ListReq {
- pageNo: number
- pageSize: number
- searchVal?: string
+interface ProjectCodeReq {
+ projectCode: string
}
-interface ProjectsReq {
- description?: string
- projectName?: string
+interface ProcessDefinitionCodeReq {
+ processDefinitionCode: string
}
-interface UserIdReq {
- userId?: number
+interface PreTaskCodesReq {
+ preTaskCodes: string
}
-interface CodeReq {
- code: number
+interface PostTaskCodesReq {
+ postTaskCodes: string
}
-interface UpdateProjectsReq extends ProjectsReq {
- userName?: string
+interface TaskCodeReq {
+ taskCode: string
+}
+
+interface SaveReq extends ProcessDefinitionCodeReq, ProjectCodeReq {
+ postTaskCode: string
+ preTaskCode: string
+}
+
+interface MoveReq extends ProcessDefinitionCodeReq, TaskCodeReq {
+ targetProcessDefinitionCode: string
}
export {
- ListReq,
- ProjectsReq,
- UserIdReq,
- CodeReq,
- UpdateProjectsReq
+ ProjectCodeReq,
+ ProcessDefinitionCodeReq,
+ PreTaskCodesReq,
+ PostTaskCodesReq,
+ TaskCodeReq,
+ SaveReq,
+ MoveReq,
}
diff --git a/dolphinscheduler-ui-next/src/service/modules/projects/index.ts b/dolphinscheduler-ui-next/src/service/modules/projects/index.ts
index 43c2291..4a61102 100644
--- a/dolphinscheduler-ui-next/src/service/modules/projects/index.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/projects/index.ts
@@ -17,77 +17,77 @@
import { axios } from '@/service/service'
import {
- ListReq,
- ProjectsReq,
- UserIdReq,
- CodeReq,
- UpdateProjectsReq
+ ListReq,
+ ProjectsReq,
+ UserIdReq,
+ CodeReq,
+ UpdateProjectsReq,
} from './types'
export function queryProjectListPaging(params: ListReq): any {
- return axios({
- url: `/projects`,
- method: 'get',
- params,
- })
+ return axios({
+ url: `/projects`,
+ method: 'get',
+ params,
+ })
}
export function createProject(data: ProjectsReq): any {
- return axios({
- url: `/projects`,
- method: 'post',
- data,
- })
+ return axios({
+ url: `/projects`,
+ method: 'post',
+ data,
+ })
}
export function queryAuthorizedProject(params: UserIdReq): any {
- return axios({
- url: `/projects/authed-project`,
- method: 'get',
- params,
- })
+ return axios({
+ url: `/projects/authed-project`,
+ method: 'get',
+ params,
+ })
}
export function queryProjectCreatedAndAuthorizedByUser(): any {
- return axios({
- url: `/projects/created-and-authed`,
- method: 'get',
- })
+ return axios({
+ url: `/projects/created-and-authed`,
+ method: 'get',
+ })
}
export function queryAllProjectList(): any {
- return axios({
- url: `/projects/list`,
- method: 'get',
- })
+ return axios({
+ url: `/projects/list`,
+ method: 'get',
+ })
}
export function queryUnauthorizedProject(params: UserIdReq): any {
- return axios({
- url: `/projects/unauth-project`,
- method: 'get',
- params
- })
+ return axios({
+ url: `/projects/unauth-project`,
+ method: 'get',
+ params,
+ })
}
export function queryProjectByCode(code: CodeReq): any {
- return axios({
- url: `/projects/${code}`,
- method: 'get',
- })
+ return axios({
+ url: `/projects/${code}`,
+ method: 'get',
+ })
}
export function updateProject(data: UpdateProjectsReq, code: CodeReq): any {
- return axios({
- url: `/projects/${code}`,
- method: 'put',
- data
- })
+ return axios({
+ url: `/projects/${code}`,
+ method: 'put',
+ data,
+ })
}
export function deleteProject(code: CodeReq): any {
- return axios({
- url: `/projects/${code}`,
- method: 'delete',
- })
+ return axios({
+ url: `/projects/${code}`,
+ method: 'delete',
+ })
}
diff --git a/dolphinscheduler-ui-next/src/service/modules/projects/types.ts b/dolphinscheduler-ui-next/src/service/modules/projects/types.ts
index 288f1c1..3965a24 100644
--- a/dolphinscheduler-ui-next/src/service/modules/projects/types.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/projects/types.ts
@@ -16,32 +16,26 @@
*/
interface ListReq {
- pageNo: number
- pageSize: number
- searchVal?: string
+ pageNo: number
+ pageSize: number
+ searchVal?: string
}
interface ProjectsReq {
- description?: string
- projectName?: string
+ description?: string
+ projectName?: string
}
interface UserIdReq {
- userId?: number
+ userId?: number
}
interface CodeReq {
- code: number
+ code: number
}
interface UpdateProjectsReq extends ProjectsReq {
- userName?: string
+ userName?: string
}
-export {
- ListReq,
- ProjectsReq,
- UserIdReq,
- CodeReq,
- UpdateProjectsReq
-}
+export { ListReq, ProjectsReq, UserIdReq, CodeReq, UpdateProjectsReq }
diff --git a/dolphinscheduler-ui-next/src/service/modules/queues/index.ts b/dolphinscheduler-ui-next/src/service/modules/queues/index.ts
index 32e17c5..a7bf866 100644
--- a/dolphinscheduler-ui-next/src/service/modules/queues/index.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/queues/index.ts
@@ -16,43 +16,43 @@
*/
import { axios } from '@/service/service'
-import {ListReq, QueueReq, IdReq} from './types'
+import { ListReq, QueueReq, IdReq } from './types'
export function queryQueueListPaging(params: ListReq): any {
- return axios({
- url: `/queues`,
- method: 'get',
- params
- })
+ return axios({
+ url: `/queues`,
+ method: 'get',
+ params,
+ })
}
export function createQueue(data: QueueReq): any {
- return axios({
- url: `/queues`,
- method: 'post',
- data
- })
+ return axios({
+ url: `/queues`,
+ method: 'post',
+ data,
+ })
}
export function queryList(): any {
- return axios({
- url: `/queues/list`,
- method: 'get',
- })
+ return axios({
+ url: `/queues/list`,
+ method: 'get',
+ })
}
export function verifyQueue(data: QueueReq): any {
- return axios({
- url: `/queues/verify`,
- method: 'post',
- data
- })
+ return axios({
+ url: `/queues/verify`,
+ method: 'post',
+ data,
+ })
}
export function updateQueue(data: QueueReq, id: IdReq): any {
- return axios({
- url: `/queues/${id}`,
- method: 'put',
- data
- })
+ return axios({
+ url: `/queues/${id}`,
+ method: 'put',
+ data,
+ })
}
diff --git a/dolphinscheduler-ui-next/src/service/modules/queues/types.ts b/dolphinscheduler-ui-next/src/service/modules/queues/types.ts
index f214bfa..11b34b8 100644
--- a/dolphinscheduler-ui-next/src/service/modules/queues/types.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/queues/types.ts
@@ -16,18 +16,18 @@
*/
interface ListReq {
- pageNo: number
- pageSize: number
- searchVal?: string
+ pageNo: number
+ pageSize: number
+ searchVal?: string
}
interface QueueReq {
- queue: string
- queueName: string
+ queue: string
+ queueName: string
}
interface IdReq {
- id: number
+ id: number
}
export { ListReq, QueueReq, IdReq }
diff --git a/dolphinscheduler-ui-next/src/service/modules/resources/index.ts b/dolphinscheduler-ui-next/src/service/modules/resources/index.ts
index 3e7c6c2..9fce316 100644
--- a/dolphinscheduler-ui-next/src/service/modules/resources/index.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/resources/index.ts
@@ -14,3 +14,235 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+import { axios } from '@/service/service'
+import {
+ FileReq,
+ ResourceTypeReq,
+ UdfTypeReq,
+ NameReq,
+ FileNameReq,
+ FullNameReq,
+ IdReq,
+ ContentReq,
+ DescriptionReq,
+ CreateReq,
+ UserIdReq,
+ OnlineCreateReq,
+ ProgramTypeReq,
+ ListReq,
+ ViewResourceReq,
+ ResourceIdReq,
+ UdfFuncReq,
+} from './types'
+
+export function queryResourceListPaging(
+ params: ListReq & IdReq & ResourceTypeReq
+): any {
+ return axios({
+ url: '/resources',
+ method: 'get',
+ params,
+ })
+}
+
+export function createResource(
+ data: CreateReq & FileNameReq & NameReq & ResourceTypeReq
+): any {
+ return axios({
+ url: '/resources',
+ method: 'post',
+ data,
+ })
+}
+
+export function authorizedFile(params: UserIdReq): any {
+ return axios({
+ url: '/resources/authed-file',
+ method: 'get',
+ params,
+ })
+}
+
+export function authorizeResourceTree(params: UserIdReq): any {
+ return axios({
+ url: '/resources/authed-resource-tree',
+ method: 'get',
+ params,
+ })
+}
+
+export function authUDFFunc(params: UserIdReq): any {
+ return axios({
+ url: '/resources/authed-udf-func',
+ method: 'get',
+ params,
+ })
+}
+
+export function createDirectory(
+ data: CreateReq & NameReq & ResourceTypeReq
+): any {
+ return axios({
+ url: '/resources/directory',
+ method: 'post',
+ data,
+ })
+}
+
+export function queryResourceList(params: ResourceTypeReq): any {
+ return axios({
+ url: '/resources/list',
+ method: 'get',
+ params,
+ })
+}
+
+export function onlineCreateResource(
+ data: OnlineCreateReq & FileNameReq & ResourceTypeReq
+): any {
+ return axios({
+ url: '/resources/online-create',
+ method: 'post',
+ data,
+ })
+}
+
+export function queryResourceByProgramType(
+ params: ResourceTypeReq & ProgramTypeReq
+): any {
+ return axios({
+ url: '/resources/query-by-type',
+ method: 'get',
+ params,
+ })
+}
+
+export function queryUdfFuncListPaging(params: ListReq): any {
+ return axios({
+ url: '/resources/udf-func',
+ method: 'get',
+ params,
+ })
+}
+
+export function queryUdfFuncList(params: UdfTypeReq): any {
+ return axios({
+ url: '/resources/udf-func/list',
+ method: 'get',
+ params,
+ })
+}
+
+export function verifyUdfFuncName(params: NameReq): any {
+ return axios({
+ url: '/resources/udf-func/verify-name',
+ method: 'get',
+ params,
+ })
+}
+
+export function deleteUdfFunc(id: IdReq): any {
+ return axios({
+ url: `/resources/udf-func/${id}`,
+ method: 'delete',
+ })
+}
+
+export function unAuthUDFFunc(params: UserIdReq): any {
+ return axios({
+ url: `/resources/unauth-udf-func`,
+ method: 'get',
+ params,
+ })
+}
+
+export function verifyResourceName(params: FullNameReq & ResourceTypeReq): any {
+ return axios({
+ url: '/resources/verify-name',
+ method: 'get',
+ params,
+ })
+}
+
+export function queryResource(
+ params: FullNameReq & ResourceTypeReq,
+ id: IdReq
+): any {
+ return axios({
+ url: `/resources/verify-name/${id}`,
+ method: 'get',
+ params,
+ })
+}
+
+export function updateResource(
+ data: NameReq & ResourceTypeReq,
+ id: IdReq
+): any {
+ return axios({
+ url: `/resources/${id}`,
+ method: 'put',
+ data,
+ })
+}
+
+export function deleteResource(id: IdReq): any {
+ return axios({
+ url: `/resources/${id}`,
+ method: 'delete',
+ })
+}
+
+export function downloadResource(id: IdReq): any {
+ return axios({
+ url: `/resources/${id}/download`,
+ method: 'get',
+ })
+}
+
+export function viewUIUdfFunction(id: IdReq): any {
+ return axios({
+ url: `/resources/${id}/udf-func`,
+ method: 'get',
+ })
+}
+
+export function updateResourceContent(data: ContentReq, id: IdReq): any {
+ return axios({
+ url: `/resources/${id}/update-content`,
+ method: 'put',
+ data,
+ })
+}
+
+export function viewResource(params: ViewResourceReq, id: IdReq): any {
+ return axios({
+ url: `/resources/${id}/view`,
+ method: 'get',
+ params,
+ })
+}
+
+export function createUdfFunc(
+ data: UdfFuncReq,
+ resourceId: ResourceIdReq
+): any {
+ return axios({
+ url: `/resources/${resourceId}/udf-func`,
+ method: 'post',
+ data,
+ })
+}
+
+export function updateUdfFunc(
+ data: UdfFuncReq,
+ resourceId: ResourceIdReq,
+ id: IdReq
+): any {
+ return axios({
+ url: `/resources/${resourceId}/udf-func/${id}`,
+ method: 'put',
+ data,
+ })
+}
diff --git a/dolphinscheduler-ui-next/src/service/modules/resources/types.ts b/dolphinscheduler-ui-next/src/service/modules/resources/types.ts
index b98d0f7..79ec58b 100644
--- a/dolphinscheduler-ui-next/src/service/modules/resources/types.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/resources/types.ts
@@ -16,40 +16,96 @@
*/
interface FileReq {
- file: any
+ file: any
}
-interface TypeReq {
- type: 'FILE' | 'UDF'
+interface ResourceTypeReq {
+ type: 'FILE' | 'UDF'
}
-interface NameReqReq {
- name: string
+interface UdfTypeReq {
+ type: 'HIVE' | 'SPARK'
+}
+
+interface NameReq {
+ name: string
}
interface FileNameReq {
- fileName: string
+ fileName: string
}
-interface ListReq {
- id: number
- pageNo: number
- pageSize: number
- type: 'FILE' | 'UDF'
- searchVal?: string
+interface FullNameReq {
+ fullName: string
}
-interface CreateReq extends TypeReq {
- currentDir: string
- pid: number
- description?: string
+interface IdReq {
+ id: number
+}
+
+interface ContentReq {
+ content: string
+}
+
+interface DescriptionReq {
+ description?: string
+}
+
+interface CreateReq extends ResourceTypeReq, DescriptionReq {
+ currentDir: string
+ pid: number
}
interface UserIdReq {
- userId: number
+ userId: number
+}
+
+interface OnlineCreateReq extends CreateReq, ContentReq {
+ suffix: string
+}
+
+interface ProgramTypeReq {
+ programType: 'JAVA' | 'SCALA' | 'PYTHON'
+}
+
+interface ListReq {
+ pageNo: number
+ pageSize: number
+ searchVal?: string
+}
+
+interface ViewResourceReq {
+ limit: number
+ skipLineNum: number
+}
+
+interface ResourceIdReq {
+ resourceId: number
+}
+
+interface UdfFuncReq extends UdfTypeReq, DescriptionReq {
+ className: string
+ funcName: string
+ argTypes?: string
+ database?: string
}
-interface OnlineCreateReq extends CreateReq {
- content: string
- suffix: string
+export {
+ FileReq,
+ ResourceTypeReq,
+ UdfTypeReq,
+ NameReq,
+ FileNameReq,
+ FullNameReq,
+ IdReq,
+ ContentReq,
+ DescriptionReq,
+ CreateReq,
+ UserIdReq,
+ OnlineCreateReq,
+ ProgramTypeReq,
+ ListReq,
+ ViewResourceReq,
+ ResourceIdReq,
+ UdfFuncReq,
}
diff --git a/dolphinscheduler-ui-next/src/service/modules/schedules/index.ts b/dolphinscheduler-ui-next/src/service/modules/schedules/index.ts
new file mode 100644
index 0000000..6b6aaca
--- /dev/null
+++ b/dolphinscheduler-ui-next/src/service/modules/schedules/index.ts
@@ -0,0 +1,119 @@
+/*
+ * 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 { axios } from '@/service/service'
+import {
+ ProjectCodeReq,
+ IdReq,
+ CodeReq,
+ ListReq,
+ ProcessDefinitionCodeReq,
+ ScheduleReq,
+ WorkerGroupIdReq,
+ ScheduleListReq,
+ CreateScheduleReq,
+ DeleteScheduleReq,
+} from './types'
+
+export function queryScheduleListPaging(
+ params: ScheduleListReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/schedules`,
+ method: 'get',
+ params,
+ })
+}
+
+export function createSchedule(
+ data: CreateScheduleReq & WorkerGroupIdReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/schedules`,
+ method: 'post',
+ data,
+ })
+}
+
+export function queryScheduleList(projectCode: ProjectCodeReq): any {
+ return axios({
+ url: `/projects/${projectCode}/schedules/list`,
+ method: 'post',
+ })
+}
+
+export function previewSchedule(
+ data: ScheduleReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/schedules/preview`,
+ method: 'post',
+ data,
+ })
+}
+
+export function updateScheduleByProcessDefinitionCode(
+ data: CreateScheduleReq,
+ projectCode: ProjectCodeReq,
+ code: CodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/schedules/update/${code}`,
+ method: 'put',
+ data,
+ })
+}
+
+export function updateSchedule(
+ data: CreateScheduleReq,
+ projectCode: ProjectCodeReq,
+ id: IdReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/schedules/${id}`,
+ method: 'put',
+ data,
+ })
+}
+
+export function deleteScheduleById(
+ data: DeleteScheduleReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/schedules/${data.id}`,
+ method: 'delete',
+ data,
+ })
+}
+
+export function offline(projectCode: ProjectCodeReq, id: IdReq): any {
+ return axios({
+ url: `/projects/${projectCode}/schedules/${id}/offline`,
+ method: 'post',
+ })
+}
+
+export function online(projectCode: ProjectCodeReq, id: IdReq): any {
+ return axios({
+ url: `/projects/${projectCode}/schedules/${id}/online`,
+ method: 'post',
+ })
+}
diff --git a/dolphinscheduler-ui-next/src/service/modules/process-instances/types.ts b/dolphinscheduler-ui-next/src/service/modules/schedules/types.ts
similarity index 57%
copy from dolphinscheduler-ui-next/src/service/modules/process-instances/types.ts
copy to dolphinscheduler-ui-next/src/service/modules/schedules/types.ts
index 488a142..722018f 100644
--- a/dolphinscheduler-ui-next/src/service/modules/process-instances/types.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/schedules/types.ts
@@ -15,30 +15,53 @@
* limitations under the License.
*/
-interface CodeReq {
+interface ProjectCodeReq {
projectCode: number
}
-interface ProcessInstanceListReq {
+interface IdReq {
+ id: number
+}
+
+interface CodeReq {
+ code: number
+}
+
+interface ListReq {
pageNo: number
pageSize: number
- endDate?: string
- executorName?: string
- host?: string
- processDefineCode?: number
- processDefiniteCode?: string
searchVal?: string
- startDate?: string
- stateType?: string
}
-interface BatchDeleteReq {
- processInstanceIds: string
- projectName: string
+interface ProcessDefinitionCodeReq {
+ processDefinitionCode: number
+}
+
+interface ScheduleReq {
+ schedule?: string
+}
+
+interface WorkerGroupIdReq {
+ workerGroupId?: number
+}
+
+interface ScheduleListReq extends ListReq, ProcessDefinitionCodeReq {
+ processDefinitionId: number
+}
+
+interface CreateScheduleReq extends ScheduleReq, ProcessDefinitionCodeReq {
+ environmentCode?: number
+ failureStrategy?: 'END' | 'CONTINUE'
+ processInstancePriority?: 'HIGHEST' | 'HIGH' | 'MEDIUM' | 'LOW' | 'LOWEST'
+ warningGroupId?: number
+ warningType?: 'NONE' | 'SUCCESS' | 'FAILURE' | 'ALL'
+ workerGroup?: string
+}
+
+interface DeleteScheduleReq extends IdReq {
alertGroup?: string
createTime?: string
email?: string
- id?: number
phone?: string
queue?: string
queueName?: string
@@ -48,47 +71,18 @@ interface BatchDeleteReq {
updateTime?: string
userName?: string
userPassword?: string
- userType?: string
-}
-
-interface SubIdReq {
- subId: number
-}
-
-interface TaskReq {
- taskCode: string
- taskId: number
-}
-
-interface LongestReq {
- endTime: string
- size: number
- startTime: string
-}
-
-interface IdReq {
- id: number
-}
-
-interface ProcessInstanceReq {
- syncDefine: string
- flag?: string
- globalParams?: string
- locations?: string
- scheduleTime?: string
- taskDefinitionJson?: string
- taskRelationJson?: string
- tenantCode?: string
- timeout?: string
+ userType?: 'ADMIN_USER' | 'GENERAL_USER'
}
export {
- CodeReq,
- ProcessInstanceListReq,
- BatchDeleteReq,
- SubIdReq,
- TaskReq,
- LongestReq,
+ ProjectCodeReq,
IdReq,
- ProcessInstanceReq
+ CodeReq,
+ ListReq,
+ ProcessDefinitionCodeReq,
+ ScheduleReq,
+ WorkerGroupIdReq,
+ ScheduleListReq,
+ CreateScheduleReq,
+ DeleteScheduleReq,
}
diff --git a/dolphinscheduler-ui-next/src/service/modules/task-definition/index.ts b/dolphinscheduler-ui-next/src/service/modules/task-definition/index.ts
new file mode 100644
index 0000000..102c207
--- /dev/null
+++ b/dolphinscheduler-ui-next/src/service/modules/task-definition/index.ts
@@ -0,0 +1,143 @@
+/*
+ * 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 { axios } from '@/service/service'
+import {
+ PageReq,
+ ListReq,
+ ProjectCodeReq,
+ TaskDefinitionListReq,
+ TaskDefinitionJsonReq,
+ GenNumReq,
+ CodeReq,
+ TaskDefinitionJsonObjReq,
+ ReleaseStateReq,
+ VersionReq,
+} from './types'
+
+export function queryTaskDefinitionListPaging(
+ params: TaskDefinitionListReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/task-definition`,
+ method: 'get',
+ params,
+ })
+}
+
+export function save(
+ data: TaskDefinitionJsonReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/task-definition`,
+ method: 'post',
+ data,
+ })
+}
+
+export function genTaskCodeList(
+ params: GenNumReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/task-definition/gen-task-codes`,
+ method: 'get',
+ params,
+ })
+}
+
+export function queryTaskDefinitionByCode(
+ code: CodeReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/task-definition/${code}`,
+ method: 'get',
+ })
+}
+
+export function update(
+ data: TaskDefinitionJsonObjReq,
+ code: CodeReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/task-definition/${code}`,
+ method: 'put',
+ data,
+ })
+}
+
+export function deleteTaskDefinition(
+ data: TaskDefinitionJsonObjReq,
+ code: CodeReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/task-definition/${code}`,
+ method: 'put',
+ data,
+ })
+}
+
+export function releaseTaskDefinition(
+ data: ReleaseStateReq,
+ code: CodeReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/task-definition/${code}/release`,
+ method: 'post',
+ data,
+ })
+}
+
+export function queryVersions(
+ params: PageReq,
+ code: CodeReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/task-definition/${code}/versions`,
+ method: 'get',
+ params,
+ })
+}
+
+export function switchVersion(
+ version: VersionReq,
+ code: CodeReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/task-definition/${code}/versions/${version}`,
+ method: 'get',
+ })
+}
+
+export function deleteVersion(
+ version: VersionReq,
+ code: CodeReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/task-definition/${code}/versions/${version}`,
+ method: 'delete',
+ })
+}
diff --git a/dolphinscheduler-ui-next/src/service/modules/projects/types.ts b/dolphinscheduler-ui-next/src/service/modules/task-definition/types.ts
similarity index 53%
copy from dolphinscheduler-ui-next/src/service/modules/projects/types.ts
copy to dolphinscheduler-ui-next/src/service/modules/task-definition/types.ts
index 288f1c1..9726500 100644
--- a/dolphinscheduler-ui-next/src/service/modules/projects/types.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/task-definition/types.ts
@@ -15,33 +15,57 @@
* limitations under the License.
*/
-interface ListReq {
- pageNo: number
- pageSize: number
- searchVal?: string
+interface PageReq {
+ pageNo: number
+ pageSize: number
}
-interface ProjectsReq {
- description?: string
- projectName?: string
+interface ListReq extends PageReq {
+ searchVal?: string
}
-interface UserIdReq {
- userId?: number
+interface ProjectCodeReq {
+ projectCode: number
+}
+
+interface TaskDefinitionListReq extends ListReq {
+ taskType?: string
+ userId?: number
+}
+
+interface TaskDefinitionJsonReq {
+ taskDefinitionJson: string
+}
+
+interface GenNumReq {
+ genNum: number
}
interface CodeReq {
- code: number
+ code: number
+}
+
+interface TaskDefinitionJsonObjReq {
+ taskDefinitionJsonObj: string
+}
+
+interface ReleaseStateReq {
+ releaseState: 'OFFLINE' | 'ONLINE'
}
-interface UpdateProjectsReq extends ProjectsReq {
- userName?: string
+interface VersionReq {
+ version: number
}
export {
- ListReq,
- ProjectsReq,
- UserIdReq,
- CodeReq,
- UpdateProjectsReq
+ PageReq,
+ ListReq,
+ ProjectCodeReq,
+ TaskDefinitionListReq,
+ TaskDefinitionJsonReq,
+ GenNumReq,
+ CodeReq,
+ TaskDefinitionJsonObjReq,
+ ReleaseStateReq,
+ VersionReq,
}
diff --git a/dolphinscheduler-ui-next/src/service/modules/resources/types.ts b/dolphinscheduler-ui-next/src/service/modules/task-instances/index.ts
similarity index 61%
copy from dolphinscheduler-ui-next/src/service/modules/resources/types.ts
copy to dolphinscheduler-ui-next/src/service/modules/task-instances/index.ts
index b98d0f7..24609f4 100644
--- a/dolphinscheduler-ui-next/src/service/modules/resources/types.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/task-instances/index.ts
@@ -15,41 +15,23 @@
* limitations under the License.
*/
-interface FileReq {
- file: any
-}
-
-interface TypeReq {
- type: 'FILE' | 'UDF'
-}
-
-interface NameReqReq {
- name: string
-}
-
-interface FileNameReq {
- fileName: string
-}
-
-interface ListReq {
- id: number
- pageNo: number
- pageSize: number
- type: 'FILE' | 'UDF'
- searchVal?: string
-}
-
-interface CreateReq extends TypeReq {
- currentDir: string
- pid: number
- description?: string
-}
-
-interface UserIdReq {
- userId: number
-}
-
-interface OnlineCreateReq extends CreateReq {
- content: string
- suffix: string
+import { axios } from '@/service/service'
+import { ProjectCodeReq, IdReq, TaskListReq } from './types'
+
+export function queryTaskListPaging(
+ params: TaskListReq,
+ projectCode: ProjectCodeReq
+): any {
+ return axios({
+ url: `/projects/${projectCode}/task-instances`,
+ method: 'get',
+ params,
+ })
+}
+
+export function forceSuccess(id: IdReq, projectCode: ProjectCodeReq): any {
+ return axios({
+ url: `/projects/${projectCode}/task-instances/${id}/force-success`,
+ method: 'post',
+ })
}
diff --git a/dolphinscheduler-ui-next/src/service/modules/queues/types.ts b/dolphinscheduler-ui-next/src/service/modules/task-instances/types.ts
similarity index 69%
copy from dolphinscheduler-ui-next/src/service/modules/queues/types.ts
copy to dolphinscheduler-ui-next/src/service/modules/task-instances/types.ts
index f214bfa..3dbc7b2 100644
--- a/dolphinscheduler-ui-next/src/service/modules/queues/types.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/task-instances/types.ts
@@ -15,19 +15,26 @@
* limitations under the License.
*/
-interface ListReq {
- pageNo: number
- pageSize: number
- searchVal?: string
+interface ProjectCodeReq {
+ projectCode: number
}
-interface QueueReq {
- queue: string
- queueName: string
+interface IdReq {
+ id: number
}
-interface IdReq {
- id: number
+interface TaskListReq {
+ pageNo: number
+ pageSize: number
+ endDate?: string
+ executorName?: string
+ host?: string
+ processInstanceId?: number
+ processInstanceName?: string
+ searchVal?: string
+ startDate?: string
+ stateType?: string
+ taskName?: string
}
-export { ListReq, QueueReq, IdReq }
+export { ProjectCodeReq, IdReq, TaskListReq }
diff --git a/dolphinscheduler-ui-next/src/service/modules/queues/index.ts b/dolphinscheduler-ui-next/src/service/modules/tenants/index.ts
similarity index 50%
copy from dolphinscheduler-ui-next/src/service/modules/queues/index.ts
copy to dolphinscheduler-ui-next/src/service/modules/tenants/index.ts
index 32e17c5..025282e 100644
--- a/dolphinscheduler-ui-next/src/service/modules/queues/index.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/tenants/index.ts
@@ -16,43 +16,50 @@
*/
import { axios } from '@/service/service'
-import {ListReq, QueueReq, IdReq} from './types'
+import { ListReq, TenantCodeReq, TenantReq, IdReq } from './types'
-export function queryQueueListPaging(params: ListReq): any {
- return axios({
- url: `/queues`,
- method: 'get',
- params
- })
+export function queryTenantListPaging(params: ListReq): any {
+ return axios({
+ url: '/tenants',
+ method: 'get',
+ params,
+ })
}
-export function createQueue(data: QueueReq): any {
- return axios({
- url: `/queues`,
- method: 'post',
- data
- })
+export function createTenant(data: TenantReq): any {
+ return axios({
+ url: '/tenants',
+ method: 'post',
+ data,
+ })
}
-export function queryList(): any {
- return axios({
- url: `/queues/list`,
- method: 'get',
- })
+export function queryTenantList(): any {
+ return axios({
+ url: '/tenants/list',
+ method: 'get',
+ })
}
-export function verifyQueue(data: QueueReq): any {
- return axios({
- url: `/queues/verify`,
- method: 'post',
- data
- })
+export function verifyTenantCode(params: TenantCodeReq): any {
+ return axios({
+ url: '/tenants/verify-code',
+ method: 'get',
+ params,
+ })
}
-export function updateQueue(data: QueueReq, id: IdReq): any {
- return axios({
- url: `/queues/${id}`,
- method: 'put',
- data
- })
+export function updateTenant(data: TenantCodeReq, id: IdReq): any {
+ return axios({
+ url: `/tenants/${id}`,
+ method: 'put',
+ data,
+ })
+}
+
+export function deleteTenantById(id: IdReq): any {
+ return axios({
+ url: `/tenants/${id}`,
+ method: 'delete',
+ })
}
diff --git a/dolphinscheduler-ui-next/src/service/modules/queues/types.ts b/dolphinscheduler-ui-next/src/service/modules/tenants/types.ts
similarity index 76%
copy from dolphinscheduler-ui-next/src/service/modules/queues/types.ts
copy to dolphinscheduler-ui-next/src/service/modules/tenants/types.ts
index f214bfa..59d7d2f 100644
--- a/dolphinscheduler-ui-next/src/service/modules/queues/types.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/tenants/types.ts
@@ -16,18 +16,22 @@
*/
interface ListReq {
- pageNo: number
- pageSize: number
- searchVal?: string
+ pageNo: number
+ pageSize: number
+ searchVal?: string
}
-interface QueueReq {
- queue: string
- queueName: string
+interface TenantCodeReq {
+ tenantCode: string
+}
+
+interface TenantReq extends TenantCodeReq {
+ queueId: number
+ description?: string
}
interface IdReq {
- id: number
+ id: number
}
-export { ListReq, QueueReq, IdReq }
+export { ListReq, TenantCodeReq, TenantReq, IdReq }
diff --git a/dolphinscheduler-ui-next/src/service/modules/queues/types.ts b/dolphinscheduler-ui-next/src/service/modules/ui-plugins/index.ts
similarity index 68%
copy from dolphinscheduler-ui-next/src/service/modules/queues/types.ts
copy to dolphinscheduler-ui-next/src/service/modules/ui-plugins/index.ts
index f214bfa..9b55be3 100644
--- a/dolphinscheduler-ui-next/src/service/modules/queues/types.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/ui-plugins/index.ts
@@ -15,19 +15,20 @@
* limitations under the License.
*/
-interface ListReq {
- pageNo: number
- pageSize: number
- searchVal?: string
-}
+import { axios } from '@/service/service'
+import { PluginTypeReq, IdReq } from './types'
-interface QueueReq {
- queue: string
- queueName: string
+export function queryUiPluginsByType(params: PluginTypeReq): any {
+ return axios({
+ url: '/ui-plugins/query-by-type',
+ method: 'get',
+ params,
+ })
}
-interface IdReq {
- id: number
+export function queryUiPluginDetailById(id: IdReq): any {
+ return axios({
+ url: `/ui-plugins/${id}`,
+ method: 'get',
+ })
}
-
-export { ListReq, QueueReq, IdReq }
diff --git a/dolphinscheduler-ui-next/src/service/modules/resources/index.ts b/dolphinscheduler-ui-next/src/service/modules/ui-plugins/types.ts
similarity index 85%
copy from dolphinscheduler-ui-next/src/service/modules/resources/index.ts
copy to dolphinscheduler-ui-next/src/service/modules/ui-plugins/types.ts
index 3e7c6c2..82bec60 100644
--- a/dolphinscheduler-ui-next/src/service/modules/resources/index.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/ui-plugins/types.ts
@@ -14,3 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+interface PluginTypeReq {
+ pluginType: 'ALERT' | 'REGISTER' | 'TASK'
+}
+
+interface IdReq {
+ id: number
+}
+
+export { PluginTypeReq, IdReq }
diff --git a/dolphinscheduler-ui-next/src/service/modules/users/index.ts b/dolphinscheduler-ui-next/src/service/modules/users/index.ts
new file mode 100644
index 0000000..8f4e0ff
--- /dev/null
+++ b/dolphinscheduler-ui-next/src/service/modules/users/index.ts
@@ -0,0 +1,184 @@
+/*
+ * 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 { axios } from '@/service/service'
+import {
+ UserNameReq,
+ UserNamesReq,
+ AlertGroupIdReq,
+ UserReq,
+ IdReq,
+ UserIdReq,
+ GrantDataSourceReq,
+ GrantResourceReq,
+ GrantProject,
+ ProjectCodeReq,
+ GrantUDFReq,
+ ListAllReq,
+ ListReq,
+ RegisterUserReq,
+} from './types'
+
+export function activateUser(data: UserNameReq): any {
+ return axios({
+ url: '/users/activate',
+ method: 'post',
+ data,
+ })
+}
+
+export function authorizedUser(params: AlertGroupIdReq): any {
+ return axios({
+ url: '/users/authed-user',
+ method: 'get',
+ params,
+ })
+}
+
+export function batchActivateUser(data: UserNamesReq): any {
+ return axios({
+ url: '/users/batch/activate',
+ method: 'post',
+ data,
+ })
+}
+
+export function createUser(data: UserReq): any {
+ return axios({
+ url: '/users/create',
+ method: 'post',
+ data,
+ })
+}
+
+export function delUserById(data: IdReq): any {
+ return axios({
+ url: '/users/delete',
+ method: 'post',
+ data,
+ })
+}
+
+export function getUserInfo(): any {
+ return axios({
+ url: '/users/get-user-info',
+ method: 'get',
+ })
+}
+
+export function grantDataSource(data: GrantDataSourceReq): any {
+ return axios({
+ url: '/users/grant-datasource',
+ method: 'post',
+ data,
+ })
+}
+
+export function grantResource(data: GrantResourceReq): any {
+ return axios({
+ url: '/users/grant-file',
+ method: 'post',
+ data,
+ })
+}
+
+export function grantProject(data: GrantProject): any {
+ return axios({
+ url: '/users/grant-project',
+ method: 'post',
+ data,
+ })
+}
+
+export function grantProjectByCode(data: ProjectCodeReq & UserIdReq): any {
+ return axios({
+ url: '/users/grant-project-by-code',
+ method: 'post',
+ data,
+ })
+}
+
+export function grantUDFFunc(data: GrantUDFReq & UserIdReq): any {
+ return axios({
+ url: '/users/grant-udf-func',
+ method: 'post',
+ data,
+ })
+}
+
+export function listUser(): any {
+ return axios({
+ url: '/users/list',
+ method: 'get',
+ })
+}
+
+export function listAll(params: ListAllReq): any {
+ return axios({
+ url: '/users/list-all',
+ method: 'get',
+ params,
+ })
+}
+
+export function queryUserList(params: ListReq): any {
+ return axios({
+ url: '/users/list-paging',
+ method: 'get',
+ params,
+ })
+}
+
+export function registerUser(data: RegisterUserReq): any {
+ return axios({
+ url: '/users/register',
+ method: 'post',
+ data,
+ })
+}
+
+export function revokeProject(data: ProjectCodeReq & UserIdReq): any {
+ return axios({
+ url: '/users/revoke-project',
+ method: 'post',
+ data,
+ })
+}
+
+export function unauthorizedUser(params: AlertGroupIdReq): any {
+ return axios({
+ url: '/users/unauth-user',
+ method: 'get',
+ params,
+ })
+}
+
+export function updateUser(data: IdReq & UserReq): any {
+ return axios({
+ url: '/users/update',
+ method: 'post',
+ data,
+ })
+}
+
+export function verifyUserName(params: UserNameReq): any {
+ return axios({
+ url: '/users/verify-user-name',
+ method: 'get',
+ params,
+ })
+}
diff --git a/dolphinscheduler-ui-next/src/service/modules/process-instances/types.ts b/dolphinscheduler-ui-next/src/service/modules/users/types.ts
similarity index 53%
copy from dolphinscheduler-ui-next/src/service/modules/process-instances/types.ts
copy to dolphinscheduler-ui-next/src/service/modules/users/types.ts
index 488a142..65a5e34 100644
--- a/dolphinscheduler-ui-next/src/service/modules/process-instances/types.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/users/types.ts
@@ -15,80 +15,92 @@
* limitations under the License.
*/
-interface CodeReq {
- projectCode: number
+interface UserNameReq {
+ userName?: string
}
-interface ProcessInstanceListReq {
- pageNo: number
- pageSize: number
- endDate?: string
- executorName?: string
- host?: string
- processDefineCode?: number
- processDefiniteCode?: string
- searchVal?: string
- startDate?: string
- stateType?: string
+interface UserNamesReq {
+ userNames?: string
}
-interface BatchDeleteReq {
- processInstanceIds: string
- projectName: string
- alertGroup?: string
- createTime?: string
- email?: string
- id?: number
+interface AlertGroupIdReq {
+ alertgroupId: string
+}
+
+interface UserReq {
+ email: string
+ tenantId: number
+ userName: string
+ userPassword: string
phone?: string
queue?: string
- queueName?: string
state?: number
- tenantCode?: string
- tenantId?: number
- updateTime?: string
- userName?: string
- userPassword?: string
- userType?: string
}
-interface SubIdReq {
- subId: number
+interface IdReq {
+ id: number
}
-interface TaskReq {
- taskCode: string
- taskId: number
+interface UserIdReq {
+ userId: number
}
-interface LongestReq {
- endTime: string
- size: number
- startTime: string
+interface GrantDataSourceReq extends UserIdReq {
+ datasourceIds: string
}
-interface IdReq {
- id: number
+interface GrantResourceReq extends UserIdReq {
+ resourceIds: string
}
-interface ProcessInstanceReq {
- syncDefine: string
- flag?: string
- globalParams?: string
- locations?: string
- scheduleTime?: string
- taskDefinitionJson?: string
- taskRelationJson?: string
+interface GrantProject extends UserIdReq {
+ projectIds: string
+}
+
+interface ProjectCodeReq {
+ projectCode: string
+}
+
+interface GrantUDFReq {
+ udfIds: string
+}
+
+interface ListAllReq extends UserReq {
+ alertGroup?: string
+ createTime?: string
+ id?: number
+ queueName?: string
tenantCode?: string
- timeout?: string
+ updateTime?: string
+ userType?: 'ADMIN_USER' | 'GENERAL_USER'
+}
+
+interface ListReq {
+ pageNo: number
+ pageSize: number
+ searchVal?: string
+}
+
+interface RegisterUserReq {
+ email: string
+ repeatPassword: string
+ userName: string
+ userPassword: string
}
export {
- CodeReq,
- ProcessInstanceListReq,
- BatchDeleteReq,
- SubIdReq,
- TaskReq,
- LongestReq,
+ UserNameReq,
+ UserNamesReq,
+ AlertGroupIdReq,
+ UserReq,
IdReq,
- ProcessInstanceReq
+ UserIdReq,
+ GrantDataSourceReq,
+ GrantResourceReq,
+ GrantProject,
+ ProjectCodeReq,
+ GrantUDFReq,
+ ListAllReq,
+ ListReq,
+ RegisterUserReq,
}
diff --git a/dolphinscheduler-ui-next/src/service/modules/queues/index.ts b/dolphinscheduler-ui-next/src/service/modules/worker-groups/index.ts
similarity index 54%
copy from dolphinscheduler-ui-next/src/service/modules/queues/index.ts
copy to dolphinscheduler-ui-next/src/service/modules/worker-groups/index.ts
index 32e17c5..ff11f14 100644
--- a/dolphinscheduler-ui-next/src/service/modules/queues/index.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/worker-groups/index.ts
@@ -16,43 +16,41 @@
*/
import { axios } from '@/service/service'
-import {ListReq, QueueReq, IdReq} from './types'
+import { ListReq, WorkerGroupReq, IdReq } from './types'
-export function queryQueueListPaging(params: ListReq): any {
- return axios({
- url: `/queues`,
- method: 'get',
- params
- })
+export function queryAllWorkerGroupsPaging(params: ListReq): any {
+ return axios({
+ url: '/worker-groups',
+ method: 'get',
+ params,
+ })
}
-export function createQueue(data: QueueReq): any {
- return axios({
- url: `/queues`,
- method: 'post',
- data
- })
+export function saveWorkerGroup(data: WorkerGroupReq): any {
+ return axios({
+ url: '/worker-groups',
+ method: 'post',
+ data,
+ })
}
-export function queryList(): any {
- return axios({
- url: `/queues/list`,
- method: 'get',
- })
+export function queryAllWorkerGroups(): any {
+ return axios({
+ url: '/worker-groups/all',
+ method: 'get',
+ })
}
-export function verifyQueue(data: QueueReq): any {
- return axios({
- url: `/queues/verify`,
- method: 'post',
- data
- })
+export function queryWorkerAddressList(): any {
+ return axios({
+ url: '/worker-groups/worker-address-list',
+ method: 'get',
+ })
}
-export function updateQueue(data: QueueReq, id: IdReq): any {
- return axios({
- url: `/queues/${id}`,
- method: 'put',
- data
- })
+export function deleteById(id: IdReq): any {
+ return axios({
+ url: `/worker-groups/${id}`,
+ method: 'delete',
+ })
}
diff --git a/dolphinscheduler-ui-next/src/service/modules/queues/types.ts b/dolphinscheduler-ui-next/src/service/modules/worker-groups/types.ts
similarity index 81%
copy from dolphinscheduler-ui-next/src/service/modules/queues/types.ts
copy to dolphinscheduler-ui-next/src/service/modules/worker-groups/types.ts
index f214bfa..4520a2d 100644
--- a/dolphinscheduler-ui-next/src/service/modules/queues/types.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/worker-groups/types.ts
@@ -16,18 +16,19 @@
*/
interface ListReq {
- pageNo: number
- pageSize: number
- searchVal?: string
+ pageNo: number
+ pageSize: number
+ searchVal?: string
}
-interface QueueReq {
- queue: string
- queueName: string
+interface WorkerGroupReq {
+ addrList: string
+ name: string
+ id?: number
}
interface IdReq {
- id: number
+ id: number
}
-export { ListReq, QueueReq, IdReq }
+export { ListReq, WorkerGroupReq, IdReq }
diff --git a/dolphinscheduler-ui-next/src/service/service.ts b/dolphinscheduler-ui-next/src/service/service.ts
index b3f0fe6..38b045e 100644
--- a/dolphinscheduler-ui-next/src/service/service.ts
+++ b/dolphinscheduler-ui-next/src/service/service.ts
@@ -25,8 +25,8 @@ const baseRequestConfig: AxiosRequestConfig = {
return qs.stringify(params, { arrayFormat: 'repeat' })
},
paramsSerializer: (params) => {
- return qs.stringify(params, { arrayFormat: 'repeat'})
- }
+ return qs.stringify(params, { arrayFormat: 'repeat' })
+ },
}
const service = axios.create(baseRequestConfig)
@@ -42,15 +42,16 @@ service.interceptors.request.use((config: AxiosRequestConfig<any>) => {
// The response to intercept
service.interceptors.response.use((res: AxiosResponse) => {
-
// No code will be processed
if (res.data.code === undefined) {
return res.data
}
switch (res.data.code) {
- case 0: return res.data.data
- default: throw new Error(`${res.data.msg}: ${res.config.url}`)
+ case 0:
+ return res.data.data
+ default:
+ throw new Error(`${res.data.msg}: ${res.config.url}`)
}
}, err)
diff --git a/dolphinscheduler-ui-next/src/views/login/index.tsx b/dolphinscheduler-ui-next/src/views/login/index.tsx
index ebd7d42..7708ada 100644
--- a/dolphinscheduler-ui-next/src/views/login/index.tsx
+++ b/dolphinscheduler-ui-next/src/views/login/index.tsx
@@ -61,7 +61,7 @@ const login = defineComponent({
const handleLogin = () => {
state.loginFormRef.validate((valid: any) => {
if (!valid) {
- queryLog({...state.loginForm}).then((res: Response) => {
+ queryLog({ ...state.loginForm }).then((res: Response) => {
console.log('res', res)
router.push({ path: 'home' })
})