Browse Source

[Feature][UI Next] Add apis. (#7463)

3.0.0/version-upgrade
songjianet 3 years ago committed by GitHub
parent
commit
b54482cbb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-ui-next/src/App.tsx
  2. 2
      dolphinscheduler-ui-next/src/locales/modules/en_US.ts
  3. 2
      dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts
  4. 12
      dolphinscheduler-ui-next/src/router/index.ts
  5. 8
      dolphinscheduler-ui-next/src/router/routes.ts
  6. 73
      dolphinscheduler-ui-next/src/service/modules/alert-group/index.ts
  7. 37
      dolphinscheduler-ui-next/src/service/modules/alert-group/types.ts
  8. 81
      dolphinscheduler-ui-next/src/service/modules/alert-plugin/index.ts
  9. 50
      dolphinscheduler-ui-next/src/service/modules/alert-plugin/types.ts
  10. 118
      dolphinscheduler-ui-next/src/service/modules/data-source/index.ts
  11. 69
      dolphinscheduler-ui-next/src/service/modules/data-source/types.ts
  12. 80
      dolphinscheduler-ui-next/src/service/modules/environment/index.ts
  13. 49
      dolphinscheduler-ui-next/src/service/modules/environment/types.ts
  14. 54
      dolphinscheduler-ui-next/src/service/modules/executors/index.ts
  15. 75
      dolphinscheduler-ui-next/src/service/modules/executors/types.ts
  16. 35
      dolphinscheduler-ui-next/src/service/modules/log/index.ts
  17. 27
      dolphinscheduler-ui-next/src/service/modules/log/types.ts
  18. 27
      dolphinscheduler-ui-next/src/service/modules/login/index.ts
  19. 23
      dolphinscheduler-ui-next/src/service/modules/login/types.ts
  20. 39
      dolphinscheduler-ui-next/src/service/modules/monitor/index.ts
  21. 16
      dolphinscheduler-ui-next/src/service/modules/monitor/types.ts
  22. 244
      dolphinscheduler-ui-next/src/service/modules/process-definition/index.ts
  23. 82
      dolphinscheduler-ui-next/src/service/modules/process-definition/types.ts
  24. 16
      dolphinscheduler-ui-next/src/service/modules/process-instances/index.ts
  25. 71
      dolphinscheduler-ui-next/src/service/modules/process-instances/types.ts
  26. 57
      dolphinscheduler-ui-next/src/service/modules/projects-analysis/index.ts
  27. 27
      dolphinscheduler-ui-next/src/service/modules/projects-analysis/types.ts
  28. 25
      dolphinscheduler-ui-next/src/service/modules/sign-out/index.ts
  29. 16
      dolphinscheduler-ui-next/src/service/modules/sign-out/types.ts
  30. 51
      dolphinscheduler-ui-next/src/service/modules/token/index.ts
  31. 51
      dolphinscheduler-ui-next/src/service/modules/token/types.ts
  32. 2
      dolphinscheduler-ui-next/src/service/service.ts
  33. 2
      dolphinscheduler-ui-next/src/utils/index.ts
  34. 14
      dolphinscheduler-ui-next/src/views/home/index.tsx
  35. 50
      dolphinscheduler-ui-next/src/views/login/index.tsx

2
dolphinscheduler-ui-next/src/App.tsx

@ -36,6 +36,8 @@ const App = defineComponent({
const themeOverrides: GlobalThemeOverrides =
themeList[this.currentTheme ? 'dark' : 'light']
console.log(themeOverrides)
return (
<NConfigProvider
theme={this.currentTheme}

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

@ -21,7 +21,7 @@ const login = {
username_tips: 'Please enter your username',
password: 'Password',
password_tips: 'Please enter your password',
signin: 'Sign In'
signin: 'Sign In',
}
export default {

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

@ -21,7 +21,7 @@ const login = {
username_tips: '请输入用户名',
password: '密码',
password_tips: '请输入密码',
signin: '登录'
signin: '登录',
}
export default {

12
dolphinscheduler-ui-next/src/router/index.ts

@ -15,7 +15,13 @@
* limitations under the License.
*/
import { createRouter, createWebHistory, RouteRecordRaw, NavigationGuardNext, RouteLocationNormalized } from 'vue-router'
import {
createRouter,
createWebHistory,
RouteRecordRaw,
NavigationGuardNext,
RouteLocationNormalized,
} from 'vue-router'
import routes from './routes'
// NProgress
@ -24,7 +30,7 @@ import 'nprogress/nprogress.css'
const router = createRouter({
history: createWebHistory(),
routes
routes,
})
/**
@ -46,4 +52,4 @@ router.afterEach(() => {
NProgress.done()
})
export default router
export default router

8
dolphinscheduler-ui-next/src/router/routes.ts

@ -44,15 +44,15 @@ const basePage: RouteRecordRaw[] = [
/**
* Login page
*/
const loginPage: RouteRecordRaw[] = [
const loginPage: RouteRecordRaw[] = [
{
path: '/login',
name: 'login',
component: components['login']
}
component: components['login'],
},
]
const routes: RouteRecordRaw[] = [...basePage, ...loginPage]
// 重新组织后导出
export default routes
export default routes

73
dolphinscheduler-ui-next/src/service/modules/alert-group/index.ts

@ -0,0 +1,73 @@
/*
* 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 { ListReq, GroupNameReq, IdReq, GroupReq } from './types'
export function queryAlertGroupListPaging(params: ListReq): any {
return axios({
url: '/alert-groups',
method: 'get',
params,
})
}
export function createAlertGroup(data: GroupReq): any {
return axios({
url: '/alert-groups',
method: 'post',
data,
})
}
export function listAlertGroupById(): any {
return axios({
url: '/alert-groups/list',
method: 'get',
})
}
export function queryAlertGroupById(data: IdReq): any {
return axios({
url: '/alert-groups/query',
method: 'post',
data,
})
}
export function verifyGroupName(params: GroupNameReq): any {
return axios({
url: '/alert-groups/verify-name',
method: 'get',
params,
})
}
export function updateAlertGroup(data: GroupReq, id: IdReq): any {
return axios({
url: `/alert-groups/${id}`,
method: 'put',
data,
})
}
export function delAlertGroupById(id: IdReq): any {
return axios({
url: `/alert-groups/${id}`,
method: 'delete',
})
}

37
dolphinscheduler-ui-next/src/service/modules/alert-group/types.ts

@ -0,0 +1,37 @@
/*
* 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.
*/
interface ListReq {
pageNo: number
pageSize: number
searchVal?: string
}
interface GroupNameReq {
groupName: string
}
interface IdReq {
id: number
}
interface GroupReq extends GroupNameReq {
alertInstanceIds: string
description?: string
}
export { ListReq, GroupNameReq, IdReq, GroupReq }

81
dolphinscheduler-ui-next/src/service/modules/alert-plugin/index.ts

@ -0,0 +1,81 @@
/*
* 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 {
ListReq,
PluginInstanceReq,
InstanceNameReq,
IdReq,
UpdatePluginInstanceReq,
} from './types'
export function queryAlertPluginInstanceListPaging(params: ListReq): any {
return axios({
url: '/alert-plugin-instances',
method: 'get',
params,
})
}
export function createAlertPluginInstance(data: PluginInstanceReq): any {
return axios({
url: '/alert-plugin-instances',
method: 'post',
data,
})
}
export function queryAlertPluginInstanceList(): any {
return axios({
url: '/alert-plugin-instances/list',
method: 'get',
})
}
export function verifyAlertInstanceName(params: InstanceNameReq): any {
return axios({
url: '/alert-plugin-instances/verify-name',
method: 'get',
params,
})
}
export function getAlertPluginInstance(id: IdReq): any {
return axios({
url: `/alert-plugin-instances/${id}`,
method: 'get',
})
}
export function updateAlertPluginInstance(
data: UpdatePluginInstanceReq,
id: IdReq
): any {
return axios({
url: `/alert-plugin-instances/${id}`,
method: 'put',
data,
})
}
export function deleteAlertPluginInstance(id: IdReq): any {
return axios({
url: `/alert-plugin-instances/${id}`,
method: 'delete',
})
}

50
dolphinscheduler-ui-next/src/service/modules/alert-plugin/types.ts

@ -0,0 +1,50 @@
/*
* 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.
*/
interface ListReq {
pageNo: number
pageSize: number
searchVal?: string
}
interface PluginInstanceReq {
instanceName: string
pluginDefineId: number
pluginInstanceParams: string
}
interface InstanceNameReq {
alertInstanceName: string
}
interface IdReq {
id: number
}
interface UpdatePluginInstanceReq {
alertPluginInstanceId: number
instanceName: string
pluginInstanceParams: string
}
export {
ListReq,
PluginInstanceReq,
InstanceNameReq,
IdReq,
UpdatePluginInstanceReq,
}

118
dolphinscheduler-ui-next/src/service/modules/data-source/index.ts

@ -0,0 +1,118 @@
/*
* 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 {
ListReq,
DataSourceReq,
UserIdReq,
TypeReq,
NameReq,
IdReq,
} from './types'
export function queryDataSourceListPaging(params: ListReq): any {
return axios({
url: '/datasources',
method: 'get',
params,
})
}
export function createDataSource(data: DataSourceReq): any {
return axios({
url: '/datasources',
method: 'post',
data,
})
}
export function authedDatasource(params: UserIdReq): any {
return axios({
url: '/datasources/authed-datasource',
method: 'get',
params,
})
}
export function connectDataSource(data: DataSourceReq): any {
return axios({
url: '/datasources/connect',
method: 'post',
data,
})
}
export function getKerberosStartupState(): any {
return axios({
url: '/datasources/kerberos-startup-state',
method: 'get',
})
}
export function queryDataSourceList(params: TypeReq): any {
return axios({
url: '/datasources/list',
method: 'get',
params,
})
}
export function unAuthDatasource(params: UserIdReq): any {
return axios({
url: '/datasources/unauth-datasource',
method: 'get',
params,
})
}
export function verifyDataSourceName(params: NameReq): any {
return axios({
url: '/datasources/verify-name',
method: 'get',
params,
})
}
export function queryDataSource(id: IdReq): any {
return axios({
url: `/datasources/${id}`,
method: 'get',
})
}
export function updateDataSource(data: DataSourceReq, id: IdReq): any {
return axios({
url: `/datasources/${id}`,
method: 'put',
data,
})
}
export function deleteDataSource(id: IdReq): any {
return axios({
url: `/datasources/${id}`,
method: 'delete',
})
}
export function connectionTest(id: IdReq): any {
return axios({
url: `/datasources/${id}/connect-test`,
method: 'get',
})
}

69
dolphinscheduler-ui-next/src/service/modules/data-source/types.ts

@ -0,0 +1,69 @@
/*
* 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.
*/
type DataBase =
| 'MYSQL'
| 'POSTGRESQL'
| 'HIVE'
| 'SPARK'
| 'CLICKHOUSE'
| 'ORACLE'
| 'SQLSERVER'
| 'DB2'
| 'PRESTO'
| 'H2'
interface DataSource {
database?: string
host?: string
id?: number
name?: string
note?: string
other?: object
password?: string
port?: number
type?: DataBase
userName?: string
}
interface ListReq {
pageNo: number
pageSize: number
searchVal?: string
}
interface DataSourceReq {
dataSourceParam: DataSource
}
interface UserIdReq {
userId: number
}
interface TypeReq {
type: DataBase
}
interface NameReq {
name: string
}
interface IdReq {
id: number
}
export { ListReq, DataSourceReq, UserIdReq, TypeReq, NameReq, IdReq }

80
dolphinscheduler-ui-next/src/service/modules/environment/index.ts

@ -0,0 +1,80 @@
/*
* 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 {
EnvironmentReq,
EnvironmentCodeReq,
EnvironmentNameReq,
ListReq,
CodeReq,
} from './types'
export function createEnvironment(data: EnvironmentReq): any {
return axios({
url: '/environment/create',
method: 'post',
data,
})
}
export function deleteEnvironmentByCode(data: EnvironmentCodeReq): any {
return axios({
url: '/environment/delete',
method: 'post',
data,
})
}
export function queryEnvironmentListPaging(params: ListReq): any {
return axios({
url: '/environment/list-paging',
method: 'get',
params,
})
}
export function queryEnvironmentByCode(params: EnvironmentCodeReq): any {
return axios({
url: '/environment/query-by-code',
method: 'get',
params,
})
}
export function queryAllEnvironmentList(): any {
return axios({
url: '/environment/query-environment-list',
method: 'get',
})
}
export function updateEnvironment(data: EnvironmentReq & CodeReq): any {
return axios({
url: '/environment/update',
method: 'post',
data,
})
}
export function verifyEnvironment(data: EnvironmentNameReq): any {
return axios({
url: '/environment/verify-environment',
method: 'post',
data,
})
}

49
dolphinscheduler-ui-next/src/service/modules/environment/types.ts

@ -0,0 +1,49 @@
/*
* 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.
*/
interface EnvironmentReq {
config: string
name: string
description?: string
workerGroups?: string
}
interface EnvironmentCodeReq {
environmentCode: number
}
interface EnvironmentNameReq {
environmentName: string
}
interface ListReq {
pageNo: number
pageSize: number
searchVal?: string
}
interface CodeReq {
code: number
}
export {
EnvironmentReq,
EnvironmentCodeReq,
EnvironmentNameReq,
ListReq,
CodeReq,
}

54
dolphinscheduler-ui-next/src/service/modules/executors/index.ts

@ -0,0 +1,54 @@
/*
* 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 {
ExecuteReq,
ProjectCodeReq,
ProcessDefinitionCodeReq,
ProcessInstanceReq,
} from './types'
export function execute(data: ExecuteReq, code: ProjectCodeReq): any {
return axios({
url: `/projects/${code}/executors/execute`,
method: 'post',
data,
})
}
export function startCheckProcessDefinition(
data: ProcessDefinitionCodeReq,
code: ProjectCodeReq
): any {
return axios({
url: `/projects/${code}/executors/start-check`,
method: 'post',
data,
})
}
export function startProcessInstance(
data: ProcessInstanceReq,
code: ProjectCodeReq
): any {
return axios({
url: `/projects/${code}/executors/start-process-instance`,
method: 'post',
data,
})
}

75
dolphinscheduler-ui-next/src/service/modules/executors/types.ts

@ -0,0 +1,75 @@
/*
* 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.
*/
type Execute =
| 'NONE'
| 'REPEAT_RUNNING'
| 'RECOVER_SUSPENDED_PROCESS'
| 'START_FAILURE_TASK_PROCESS'
| 'STOP'
| 'PAUSE'
type Exec =
| 'START_PROCESS'
| 'START_CURRENT_TASK_PROCESS'
| 'RECOVER_TOLERANCE_FAULT_PROCESS'
| 'RECOVER_SUSPENDED_PROCESS'
| 'START_FAILURE_TASK_PROCESS'
| 'COMPLEMENT_DATA'
| 'SCHEDULER'
| 'REPEAT_RUNNING'
| 'PAUSE'
| 'STOP'
| 'RECOVER_WAITING_THREAD'
interface ExecuteReq {
executeType: Execute
processInstanceId: number
}
interface ProjectCodeReq {
projectCode: number
}
interface ProcessDefinitionCodeReq {
processDefinitionCode: number
}
interface ProcessInstanceReq extends ProcessDefinitionCodeReq {
failureStrategy: 'END' | 'CONTINUE'
processInstancePriority: 'HIGHEST' | 'HIGH' | 'MEDIUM' | 'LOW' | 'LOWEST'
scheduleTime: string
warningGroupId: number
warningType: 'NONE' | 'SUCCESS' | 'FAILURE' | 'ALL'
dryRun?: number
environmentCode?: number
execType?: Exec
expectedParallelismNumber?: number
runMode?: 'RUN_MODE_SERIAL' | 'RUN_MODE_PARALLEL'
startNodeList?: string
startParams?: string
taskDependType?: 'TASK_ONLY' | 'TASK_PRE' | 'TASK_POST'
timeout?: number
workerGroup?: string
}
export {
ExecuteReq,
ProjectCodeReq,
ProcessDefinitionCodeReq,
ProcessInstanceReq,
}

35
dolphinscheduler-ui-next/src/service/modules/log/index.ts

@ -0,0 +1,35 @@
/*
* 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 { IdReq, LogReq } from './types'
export function queryLog(params: LogReq): any {
return axios({
url: '/log/detail',
method: 'get',
params,
})
}
export function downloadTaskLog(params: IdReq): any {
return axios({
url: '/log/download-log',
method: 'get',
params,
})
}

27
dolphinscheduler-ui-next/src/service/modules/log/types.ts

@ -0,0 +1,27 @@
/*
* 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.
*/
interface IdReq {
taskInstanceId: number
}
interface LogReq extends IdReq {
limit: number
skipLineNum: number
}
export { IdReq, LogReq }

27
dolphinscheduler-ui-next/src/service/modules/login/index.ts

@ -0,0 +1,27 @@
/*
* 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 { LoginReq } from './types'
export function queryLog(data: LoginReq): any {
return axios({
url: '/login',
method: 'post',
data,
})
}

23
dolphinscheduler-ui-next/src/service/modules/login/types.ts

@ -0,0 +1,23 @@
/*
* 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.
*/
interface LoginReq {
userName: string
userPassword: string
}
export { LoginReq }

39
dolphinscheduler-ui-next/src/service/modules/monitor/index.ts

@ -0,0 +1,39 @@
/*
* 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'
export function queryDatabaseState(): any {
return axios({
url: '/monitor/databases',
method: 'get',
})
}
export function listMaster(): any {
return axios({
url: '/monitor/masters',
method: 'get',
})
}
export function listWorker(): any {
return axios({
url: '/monitor/workers',
method: 'get',
})
}

16
dolphinscheduler-ui-next/src/service/modules/monitor/types.ts

@ -0,0 +1,16 @@
/*
* 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.
*/

244
dolphinscheduler-ui-next/src/service/modules/process-definition/index.ts

@ -0,0 +1,244 @@
/*
* 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 {
CodeReq,
CodesReq,
FileReq,
NameReq,
ReleaseStateReq,
VersionReq,
LimitReq,
PageReq,
ListReq,
ProcessDefinitionReq,
TargetCodeReq,
} from './types'
export function queryListPaging(params: PageReq & ListReq, code: CodeReq): any {
return axios({
url: `/projects/${code}/process-definition`,
method: 'get',
params,
})
}
export function createProcessDefinition(
data: ProcessDefinitionReq & NameReq,
code: CodeReq
): any {
return axios({
url: `/projects/${code}/process-definition`,
method: 'post',
data,
})
}
export function queryAllByProjectCode(code: CodeReq): any {
return axios({
url: `/projects/${code}/process-definition/all`,
method: 'post',
})
}
export function batchCopyByCodes(
data: TargetCodeReq & CodesReq,
code: CodeReq
): any {
return axios({
url: `/projects/${code}/process-definition/batch-copy`,
method: 'post',
data,
})
}
export function batchDeleteByCodes(data: CodesReq, code: CodeReq): any {
return axios({
url: `/projects/${code}/process-definition/batch-delete`,
method: 'post',
data,
})
}
export function batchExportByCodes(data: CodesReq, code: CodeReq): any {
return axios({
url: `/projects/${code}/process-definition/batch-export`,
method: 'post',
data,
})
}
export function batchMoveByCodes(
data: TargetCodeReq & CodesReq,
code: CodeReq
): any {
return axios({
url: `/projects/${code}/process-definition/batch-move`,
method: 'post',
data,
})
}
export function getTaskListByDefinitionCodes(
params: CodesReq,
code: CodeReq
): any {
return axios({
url: `/projects/${code}/process-definition/batch-query-tasks`,
method: 'get',
params,
})
}
export function importProcessDefinition(data: FileReq, code: CodeReq): any {
return axios({
url: `/projects/${code}/process-definition/import`,
method: 'post',
data,
})
}
export function queryList(code: CodeReq): any {
return axios({
url: `/projects/${code}/process-definition/list`,
method: 'get',
})
}
export function queryProcessDefinitionByName(
params: NameReq,
code: CodeReq
): any {
return axios({
url: `/projects/${code}/process-definition/query-by-name`,
method: 'get',
params,
})
}
export function querySimpleList(code: CodeReq): any {
return axios({
url: `/projects/${code}/process-definition/simple-list`,
method: 'get',
})
}
export function verifyName(params: NameReq, code: CodeReq): any {
return axios({
url: `/projects/${code}/process-definition/verify-name`,
method: 'get',
params,
})
}
export function queryProcessDefinitionByCode(
code: CodeReq,
processCode: CodeReq
): any {
return axios({
url: `/projects/${code}/process-definition/${processCode}`,
method: 'get',
})
}
export function update(
data: ProcessDefinitionReq & NameReq & ReleaseStateReq,
code: CodeReq,
processCode: CodeReq
): any {
return axios({
url: `/projects/${code}/process-definition/${processCode}`,
method: 'put',
data,
})
}
export function deleteByCode(code: CodeReq, processCode: CodeReq): any {
return axios({
url: `/projects/${code}/process-definition/${processCode}`,
method: 'delete',
})
}
export function release(
data: NameReq & ReleaseStateReq,
code: CodeReq,
processCode: CodeReq
): any {
return axios({
url: `/projects/${code}/process-definition/${processCode}/release`,
method: 'post',
data,
})
}
export function getTasksByDefinitionCode(
code: CodeReq,
processCode: CodeReq
): any {
return axios({
url: `/projects/${code}/process-definition/${processCode}/tasks`,
method: 'get',
})
}
export function queryVersions(
params: PageReq,
code: CodeReq,
processCode: CodeReq
): any {
return axios({
url: `/projects/${code}/process-definition/${processCode}/versions`,
method: 'get',
params,
})
}
export function switchVersion(
code: CodeReq,
processCode: CodeReq,
version: VersionReq
): any {
return axios({
url: `/projects/${code}/process-definition/${processCode}/versions/${version}`,
method: 'get',
})
}
export function deleteVersion(
code: CodeReq,
processCode: CodeReq,
version: VersionReq
): any {
return axios({
url: `/projects/${code}/process-definition/${processCode}/versions/${version}`,
method: 'delete',
})
}
export function viewTree(
code: CodeReq,
processCode: CodeReq,
params: LimitReq
): any {
return axios({
url: `/projects/${code}/process-definition/${processCode}/view-tree`,
method: 'get',
params,
})
}

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

@ -0,0 +1,82 @@
/*
* 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.
*/
interface CodeReq {
projectCode: number
}
interface CodesReq {
codes: string
}
interface FileReq {
file: any
}
interface NameReq {
name: string
}
interface ReleaseStateReq {
releaseState: 'OFFLINE' | 'ONLINE'
}
interface VersionReq {
version: number
}
interface LimitReq {
limit: number
}
interface PageReq {
pageNo: number
pageSize: number
}
interface ListReq extends PageReq {
searchVal?: string
userId?: number
}
interface ProcessDefinitionReq extends NameReq {
locations: string
taskDefinitionJson: string
taskRelationJson: string
tenantCode: string
description?: string
globalParams?: string
timeout?: number
}
interface TargetCodeReq {
targetProjectCode: number
}
export {
CodeReq,
CodesReq,
FileReq,
NameReq,
ReleaseStateReq,
VersionReq,
LimitReq,
PageReq,
ListReq,
ProcessDefinitionReq,
TargetCodeReq,
}

16
dolphinscheduler-ui-next/src/service/modules/process-instances/index.ts

@ -0,0 +1,16 @@
/*
* 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.
*/

71
dolphinscheduler-ui-next/src/service/modules/process-instances/types.ts

@ -0,0 +1,71 @@
/*
* 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.
*/
interface CodeReq {
projectCode: number
}
interface ProcessInstanceListReq {
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
alertGroup?: string
createTime?: string
email?: string
id?: number
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 TaskReq {
taskCode: string
taskId: number
}
interface LongestReq {
endTime: string
size: number
startTime: string
}
interface IdReq {
id: number
}

57
dolphinscheduler-ui-next/src/service/modules/projects-analysis/index.ts

@ -0,0 +1,57 @@
/*
* 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 { CodeReq, StateReq } from './types'
export function countCommandState(): any {
return axios({
url: '/projects/analysis/command-state-count',
method: 'get',
})
}
export function countDefinitionByUser(params: CodeReq): any {
return axios({
url: '/projects/analysis/define-user-count',
method: 'get',
params,
})
}
export function countProcessInstanceState(params: StateReq): any {
return axios({
url: '/projects/analysis/process-state-count',
method: 'get',
params,
})
}
export function countQueueState(): any {
return axios({
url: '/projects/analysis/queue-count',
method: 'get',
})
}
export function countTaskState(params: StateReq): any {
return axios({
url: '/projects/analysis/task-state-count',
method: 'get',
params,
})
}

27
dolphinscheduler-ui-next/src/service/modules/projects-analysis/types.ts

@ -0,0 +1,27 @@
/*
* 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.
*/
interface CodeReq {
projectCode?: number
}
interface StateReq extends CodeReq {
endDate?: string
startDate?: string
}
export { CodeReq, StateReq }

25
dolphinscheduler-ui-next/src/service/modules/sign-out/index.ts

@ -0,0 +1,25 @@
/*
* 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'
export function signOut(): any {
return axios({
url: '/signOut',
method: 'post',
})
}

16
dolphinscheduler-ui-next/src/service/modules/sign-out/types.ts

@ -0,0 +1,16 @@
/*
* 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.
*/

51
dolphinscheduler-ui-next/src/service/modules/token/index.ts

@ -0,0 +1,51 @@
/*
* 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 { ListReq, TokenReq, UserReq, UpdateTokenReq } from './types'
export function queryAccessTokenList(params: ListReq): any {
return axios({
url: '/access-tokens',
method: 'get',
params,
})
}
export function createToken(data: TokenReq): any {
return axios({
url: '/access-tokens',
method: 'post',
data,
})
}
export function queryAccessTokenByUser(params: UserReq): any {
return axios({
url: '/access-tokens',
method: 'get',
params,
})
}
export function updateToken(data: UpdateTokenReq): any {
return axios({
url: '/access-tokens',
method: 'put',
data,
})
}

51
dolphinscheduler-ui-next/src/service/modules/token/types.ts

@ -0,0 +1,51 @@
/*
* 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.
*/
interface ListReq {
pageNo: number
pageSize: number
searchVal?: string
}
interface TokenReq {
expireTime: string
userId: number
token?: string
}
interface UserReq {
userId?: number
}
interface UpdateTokenReq extends TokenReq {
id: number
alertGroup?: string
createTime?: string
email?: string
phone?: string
queue?: string
queueName?: string
state?: number
tenantCode?: string
tenantId?: number
updateTime?: string
userName?: string
userPassword?: string
userType?: string
}
export { ListReq, TokenReq, UserReq, UpdateTokenReq }

2
dolphinscheduler-ui-next/src/service/service.ts

@ -18,7 +18,7 @@
import axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios'
const baseRequestConfig: AxiosRequestConfig = {
baseURL: '/',
baseURL: '/dolphinscheduler',
timeout: 10000,
}

2
dolphinscheduler-ui-next/src/utils/index.ts

@ -18,7 +18,7 @@
import classification from './classification'
const utils = {
classification
classification,
}
export default utils

14
dolphinscheduler-ui-next/src/views/home/index.tsx

@ -19,11 +19,9 @@ import { defineComponent } from 'vue'
import styles from './index.module.scss'
export default defineComponent({
name: 'home',
setup() {},
render() {
return <div class={styles.container}>
Home Test
</div>
}
})
name: 'home',
setup() {},
render() {
return <div class={styles.container}>Home Test</div>
},
})

50
dolphinscheduler-ui-next/src/views/login/index.tsx

@ -35,21 +35,21 @@ const Login = defineComponent({
rules: {
username: {
trigger: ['input', 'blur'],
validator () {
validator() {
if (state.loginForm.username === '') {
return new Error(`${t('login.username_tips')}`)
}
}
},
},
password: {
trigger: ['input', 'blur'],
validator () {
validator() {
if (state.loginForm.password === '') {
return new Error(`${t('login.password_tips')}`)
}
}
}
} as FormRules
},
},
} as FormRules,
})
const handleChange = (value: string) => {
@ -67,16 +67,20 @@ const Login = defineComponent({
})
}
return { t, locale, handleChange, handleLogin, ...toRefs(state)}
return { t, locale, handleChange, handleLogin, ...toRefs(state) }
},
render() {
return (
<div class={styles.container}>
<div class={styles['language-switch']}>
<NSwitch onUpdateValue={this.handleChange} checked-value="en_US" unchecked-value="zh_CN">
<NSwitch
onUpdateValue={this.handleChange}
checked-value='en_US'
unchecked-value='zh_CN'
>
{{
checked: () => 'en_US',
unchecked: () =>'zh_CN'
checked: () => 'en_US',
unchecked: () => 'zh_CN',
}}
</NSwitch>
</div>
@ -85,28 +89,36 @@ const Login = defineComponent({
<div class={styles['logo-img']}></div>
</div>
<div class={styles['form-model']}>
<NForm rules={this.rules} ref="loginFormRef">
<NFormItem label={this.t('login.username')} label-style={{color:'black'}} path="username">
<NForm rules={this.rules} ref='loginFormRef'>
<NFormItem
label={this.t('login.username')}
label-style={{ color: 'black' }}
path='username'
>
<NInput
type="text"
size="large"
type='text'
size='large'
v-model={[this.loginForm.username, 'value']}
placeholder={this.t('login.username_tips')}
autofocus
onKeydown={withKeys(this.handleLogin, ['enter'])}
/>
</NFormItem>
<NFormItem label={this.t('login.password')} label-style={{color:'black'}} path="password">
<NFormItem
label={this.t('login.password')}
label-style={{ color: 'black' }}
path='password'
>
<NInput
type="password"
size="large"
type='password'
size='large'
v-model={[this.loginForm.password, 'value']}
placeholder={this.t('login.password_tips')}
onKeydown={withKeys(this.handleLogin, ['enter'])}
/>
</NFormItem>
</NForm>
<NButton round type="primary" onClick={this.handleLogin}>
<NButton round type='primary' onClick={this.handleLogin}>
{this.t('login.signin')}
</NButton>
</div>
@ -116,4 +128,4 @@ const Login = defineComponent({
},
})
export default Login
export default Login

Loading…
Cancel
Save