Browse Source

[Feature][UI] Support to view and manage all timing settings of a project. (#14178)

3.2.0-release
calvin 1 year ago committed by GitHub
parent
commit
4c2e57cfb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java
  2. 16
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
  3. 14
      dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ScheduleMapper.java
  4. 19
      dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ScheduleMapper.xml
  5. 38
      dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/ScheduleMapperTest.java
  6. 2
      dolphinscheduler-ui/src/common/column-width-config.ts
  7. 7
      dolphinscheduler-ui/src/common/common.ts
  8. 19
      dolphinscheduler-ui/src/components/input-search/index.tsx
  9. 8
      dolphinscheduler-ui/src/layouts/content/components/navbar/index.tsx
  10. 4
      dolphinscheduler-ui/src/layouts/content/components/sidebar/use-menuClick.ts
  11. 21
      dolphinscheduler-ui/src/layouts/content/use-dataList.ts
  12. 12
      dolphinscheduler-ui/src/locales/en_US/datasource.ts
  13. 2
      dolphinscheduler-ui/src/locales/en_US/input-search.ts
  14. 3
      dolphinscheduler-ui/src/locales/en_US/menu.ts
  15. 3
      dolphinscheduler-ui/src/locales/en_US/project.ts
  16. 2
      dolphinscheduler-ui/src/locales/en_US/resource.ts
  17. 2
      dolphinscheduler-ui/src/locales/en_US/security.ts
  18. 12
      dolphinscheduler-ui/src/locales/zh_CN/datasource.ts
  19. 2
      dolphinscheduler-ui/src/locales/zh_CN/input-search.ts
  20. 1
      dolphinscheduler-ui/src/locales/zh_CN/menu.ts
  21. 1
      dolphinscheduler-ui/src/locales/zh_CN/project.ts
  22. 2
      dolphinscheduler-ui/src/locales/zh_CN/security.ts
  23. 11
      dolphinscheduler-ui/src/router/modules/projects.ts
  24. 34
      dolphinscheduler-ui/src/service/modules/data-source/types.ts
  25. 6
      dolphinscheduler-ui/src/service/modules/process-definition/index.ts
  26. 1
      dolphinscheduler-ui/src/service/modules/process-instances/index.ts
  27. 12
      dolphinscheduler-ui/src/service/modules/projects/index.ts
  28. 49
      dolphinscheduler-ui/src/service/modules/resources/index.ts
  29. 2
      dolphinscheduler-ui/src/service/modules/resources/types.ts
  30. 2
      dolphinscheduler-ui/src/service/modules/schedules/types.ts
  31. 5
      dolphinscheduler-ui/src/service/modules/task-instances/index.ts
  32. 47
      dolphinscheduler-ui/src/utils/environmental-distinction.ts
  33. 7
      dolphinscheduler-ui/src/utils/tree-format.ts
  34. 8
      dolphinscheduler-ui/src/views/data-quality/rule/index.tsx
  35. 6
      dolphinscheduler-ui/src/views/data-quality/task-result/index.tsx
  36. 126
      dolphinscheduler-ui/src/views/datasource/list/detail.tsx
  37. 5
      dolphinscheduler-ui/src/views/datasource/list/use-columns.ts
  38. 48
      dolphinscheduler-ui/src/views/datasource/list/use-form.ts
  39. 2
      dolphinscheduler-ui/src/views/datasource/list/use-table.ts
  40. 36
      dolphinscheduler-ui/src/views/login/index.tsx
  41. 2
      dolphinscheduler-ui/src/views/login/use-login.ts
  42. 4
      dolphinscheduler-ui/src/views/profile/use-form.ts
  43. 18
      dolphinscheduler-ui/src/views/projects/list/index.tsx
  44. 2
      dolphinscheduler-ui/src/views/projects/list/use-table.ts
  45. 14
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-cache.ts
  46. 108
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-custom-labels.ts
  47. 2
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datasource.ts
  48. 115
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datasync.ts
  49. 466
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datax.ts
  50. 4
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-dependent-timeout.ts
  51. 7
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-dms.ts
  52. 6
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-environment-name.ts
  53. 3
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-flink.ts
  54. 14
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-hive-cli.ts
  55. 4
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-linkis.ts
  56. 2
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-namespace.ts
  57. 2
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-resources.ts
  58. 32
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-sea-tunnel.ts
  59. 2
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-zeppelin.ts
  60. 14
      dolphinscheduler-ui/src/views/projects/task/components/node/format-data.ts
  61. 110
      dolphinscheduler-ui/src/views/projects/task/components/node/tasks/use-datasync.ts
  62. 2
      dolphinscheduler-ui/src/views/projects/task/components/node/tasks/use-dms.ts
  63. 2
      dolphinscheduler-ui/src/views/projects/task/components/node/tasks/use-linkis.ts
  64. 46
      dolphinscheduler-ui/src/views/projects/task/components/node/tasks/use-sea-tunnel.ts
  65. 6
      dolphinscheduler-ui/src/views/projects/task/components/node/types.ts
  66. 14
      dolphinscheduler-ui/src/views/projects/task/definition/use-table.ts
  67. 2
      dolphinscheduler-ui/src/views/projects/task/instance/batch-task.tsx
  68. 1
      dolphinscheduler-ui/src/views/projects/task/instance/index.tsx
  69. 28
      dolphinscheduler-ui/src/views/projects/task/instance/use-table.ts
  70. 2
      dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-config.ts
  71. 79
      dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-context-menu.tsx
  72. 51
      dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-sidebar.tsx
  73. 58
      dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-toolbar.tsx
  74. 37
      dolphinscheduler-ui/src/views/projects/workflow/components/dag/index.tsx
  75. 16
      dolphinscheduler-ui/src/views/projects/workflow/components/dag/use-canvas-init.ts
  76. 21
      dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/dag-canvas.tsx
  77. 20
      dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/dag-sidebar.tsx
  78. 16
      dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/index.tsx
  79. 79
      dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/task/index.tsx
  80. 7
      dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/task/use-form-field.ts
  81. 2
      dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/task/use-form-request.ts
  82. 4
      dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/task/use-task-form.ts
  83. 5
      dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/use-sidebar.ts
  84. 2
      dolphinscheduler-ui/src/views/projects/workflow/definition/components/use-modal.ts
  85. 8
      dolphinscheduler-ui/src/views/projects/workflow/definition/create/index.tsx
  86. 10
      dolphinscheduler-ui/src/views/projects/workflow/definition/index.tsx
  87. 4
      dolphinscheduler-ui/src/views/projects/workflow/definition/timing/index.tsx
  88. 2
      dolphinscheduler-ui/src/views/projects/workflow/definition/timing/types.ts
  89. 59
      dolphinscheduler-ui/src/views/projects/workflow/definition/timing/use-table.ts
  90. 2
      dolphinscheduler-ui/src/views/projects/workflow/definition/use-table.ts
  91. 19
      dolphinscheduler-ui/src/views/projects/workflow/instance/components/variables-view.tsx
  92. 2
      dolphinscheduler-ui/src/views/projects/workflow/instance/use-table.ts
  93. 17
      dolphinscheduler-ui/src/views/projects/workflow/relation/index.tsx
  94. 87
      dolphinscheduler-ui/src/views/projects/workflow/timing/components/timing-condition.tsx
  95. 116
      dolphinscheduler-ui/src/views/projects/workflow/timing/index.tsx
  96. 22
      dolphinscheduler-ui/src/views/projects/workflow/timing/types.ts
  97. 2
      dolphinscheduler-ui/src/views/resource/components/resource/create/use-form.ts
  98. 4
      dolphinscheduler-ui/src/views/resource/components/resource/edit/index.tsx
  99. 17
      dolphinscheduler-ui/src/views/resource/components/resource/edit/use-edit.ts
  100. 2
      dolphinscheduler-ui/src/views/resource/components/resource/folder/index.tsx
  101. Some files were not shown because too many files have changed in this diff Show More

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/SchedulerController.java

@ -250,7 +250,7 @@ public class SchedulerController extends BaseController {
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryScheduleListPaging(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@RequestParam long processDefinitionCode,
@RequestParam(value = "processDefinitionCode", required = false, defaultValue = "0") long processDefinitionCode,
@RequestParam(value = "searchVal", required = false) String searchVal,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {

16
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java

@ -568,16 +568,20 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe
return result;
}
ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefineCode);
if (processDefinition == null || projectCode != processDefinition.getProjectCode()) {
log.error("Process definition does not exist, processDefinitionCode:{}.", processDefineCode);
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, String.valueOf(processDefineCode));
return result;
if (processDefineCode != 0) {
ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefineCode);
if (processDefinition == null || projectCode != processDefinition.getProjectCode()) {
log.error("Process definition does not exist, processDefinitionCode:{}.", processDefineCode);
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, String.valueOf(processDefineCode));
return result;
}
}
Page<Schedule> page = new Page<>(pageNo, pageSize);
IPage<Schedule> schedulePage =
scheduleMapper.queryByProcessDefineCodePaging(page, processDefineCode, searchVal);
scheduleMapper.queryByProjectAndProcessDefineCodePaging(page, projectCode, processDefineCode,
searchVal);
List<ScheduleVo> scheduleList = new ArrayList<>();
for (Schedule schedule : schedulePage.getRecords()) {

14
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ScheduleMapper.java

@ -63,6 +63,20 @@ public interface ScheduleMapper extends BaseMapper<Schedule> {
@Param("processDefinitionCode") long processDefinitionCode,
@Param("searchVal") String searchVal);
/**
* scheduler page
*
* @param page page
* @param projectCode projectCode
* @param processDefinitionCode processDefinitionCode
* @param searchVal searchVal
* @return scheduler IPage
*/
IPage<Schedule> queryByProjectAndProcessDefineCodePaging(IPage<Schedule> page,
@Param("projectCode") long projectCode,
@Param("processDefinitionCode") long processDefinitionCode,
@Param("searchVal") String searchVal);
/**
* Filter schedule
*

19
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ScheduleMapper.xml

@ -44,6 +44,25 @@
</if>
order by s.update_time desc
</select>
<select id="queryByProjectAndProcessDefineCodePaging" resultType="org.apache.dolphinscheduler.dao.entity.Schedule">
select p_f.name as process_definition_name, p.name as project_name,u.user_name,e.name as environment_name,
<include refid="baseSqlV2">
<property name="alias" value="s"/>
</include>
from t_ds_schedules s
join t_ds_process_definition p_f on s.process_definition_code = p_f.code
join t_ds_project as p on p_f.project_code = p.code
join t_ds_user as u on s.user_id = u.id
left join t_ds_environment as e on s.environment_code = e.code
where 1=1
<if test="projectCode != 0">
and p.code = #{projectCode}
</if>
<if test="processDefinitionCode != 0">
and s.process_definition_code = #{processDefinitionCode}
</if>
order by s.update_time desc
</select>
<select id="querySchedulerListByProjectName" resultType="org.apache.dolphinscheduler.dao.entity.Schedule">
select p_f.name as process_definition_name, p_f.description as definition_description, p.name as project_name,u.user_name, s.*
from t_ds_schedules s

38
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/ScheduleMapperTest.java

@ -141,6 +141,44 @@ public class ScheduleMapperTest extends BaseDaoTest {
Assertions.assertNotEquals(scheduleIPage.getSize(), 0);
}
/**
* test page
*/
@Test
public void testQueryByProjectAndProcessDefineIdPaging() {
User user = new User();
user.setUserName("ut name");
userMapper.insert(user);
Project project = new Project();
project.setName("ut project");
project.setUserId(user.getId());
project.setCode(1L);
project.setUpdateTime(new Date());
project.setCreateTime(new Date());
projectMapper.insert(project);
ProcessDefinition processDefinition = new ProcessDefinition();
processDefinition.setCode(1L);
processDefinition.setProjectCode(project.getCode());
processDefinition.setUserId(user.getId());
processDefinition.setLocations("");
processDefinition.setCreateTime(new Date());
processDefinition.setUpdateTime(new Date());
processDefinitionMapper.insert(processDefinition);
Schedule schedule = insertOne();
schedule.setUserId(user.getId());
schedule.setProcessDefinitionCode(processDefinition.getCode());
scheduleMapper.updateById(schedule);
Page<Schedule> page = new Page(1, 3);
IPage<Schedule> scheduleIPage = scheduleMapper.queryByProjectAndProcessDefineCodePaging(page, project.getCode(),
processDefinition.getCode(), "");
Assertions.assertNotEquals(scheduleIPage.getSize(), 0);
}
/**
* test query schedule list by project name
*/

2
dolphinscheduler-ui/src/common/column-width-config.ts

@ -98,7 +98,7 @@ export const COLUMN_WIDTH_CONFIG = {
tag: {
width: 160
},
checkbox:{
checkbox: {
width: 20
},
copy: {

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

@ -154,7 +154,6 @@ export const workflowExecutionStateType = (t: any) => [
}))
]
/**
* Stream task state
*/
@ -271,7 +270,7 @@ export const tasksState = (t: any): ITaskStateConfig => ({
icon: SendOutlined,
isSpin: false,
classNames: 'dispatch'
},
}
})
/**
@ -282,7 +281,9 @@ export const tasksState = (t: any): ITaskStateConfig => ({
* @icon icon
* @isSpin is loading (Need to execute the code block to write if judgment)
*/
export const workflowExecutionState = (t: any): IWorkflowExecutionStateConfig => ({
export const workflowExecutionState = (
t: any
): IWorkflowExecutionStateConfig => ({
SUBMITTED_SUCCESS: {
id: 0,
desc: `${t('project.workflow.submit_success')}`,

19
dolphinscheduler-ui/src/components/input-search/index.tsx

@ -28,8 +28,8 @@ const props = {
const Search = defineComponent({
name: 'Search',
emits: ['search','clear'],
props: props,
emits: ['search', 'clear'],
setup(props, ctx) {
const { t } = useI18n()
@ -40,14 +40,15 @@ const Search = defineComponent({
ctx.emit('clear', (ev.target as HTMLInputElement)?.value || '')
}
return () => (
<NInput
size='small'
clearable
placeholder = {props.placeholder?props.placeholder:t('input_search.placeholder')}
onKeydown={withKeys(onKeyDown, ['enter'])}
onClear = {onClear}
/>
<NInput
size='small'
clearable
placeholder={
props.placeholder ? props.placeholder : t('input_search.placeholder')
}
onKeydown={withKeys(onKeyDown, ['enter'])}
onClear={onClear}
/>
)
}
})

8
dolphinscheduler-ui/src/layouts/content/components/navbar/index.tsx

@ -85,9 +85,11 @@ const Navbar = defineComponent({
<div class={styles.settings}>
<NButton quaternary onClick={this.handleUISettingClick}>
{{
icon: () => <NIcon size='16'>
<SettingOutlined />
</NIcon>,
icon: () => (
<NIcon size='16'>
<SettingOutlined />
</NIcon>
),
default: this.t('menu.ui_setting')
}}
</NButton>

4
dolphinscheduler-ui/src/layouts/content/components/sidebar/use-menuClick.ts

@ -15,7 +15,7 @@
* limitations under the License.
*/
import {LocationQueryRaw, useRouter} from 'vue-router'
import { LocationQueryRaw, useRouter } from 'vue-router'
import type { Router } from 'vue-router'
import { MenuOption } from 'naive-ui'
@ -25,7 +25,7 @@ export function useMenuClick() {
const handleMenuClick = (key: string, menuOption: MenuOption) => {
router.push({
path: `${key}`,
query: menuOption.payload? menuOption.payload as LocationQueryRaw: {}
query: menuOption.payload ? (menuOption.payload as LocationQueryRaw) : {}
})
}

21
dolphinscheduler-ui/src/layouts/content/use-dataList.ts

@ -102,10 +102,12 @@ export function useDataList() {
icon: renderIcon(ProfileOutlined),
children: [
{
label: t('menu.project_overview') + (projectName? `[${projectName}]` : ''),
label:
t('menu.project_overview') +
(projectName ? `[${projectName}]` : ''),
key: `/projects/${projectCode}`,
icon: renderIcon(FundProjectionScreenOutlined),
payload: {projectName:projectName}
payload: { projectName: projectName }
},
{
label: t('menu.workflow'),
@ -115,17 +117,22 @@ export function useDataList() {
{
label: t('menu.workflow_relation'),
key: `/projects/${projectCode}/workflow/relation`,
payload: {projectName:projectName}
payload: { projectName: projectName }
},
{
label: t('menu.workflow_definition'),
key: `/projects/${projectCode}/workflow-definition`,
payload: {projectName:projectName}
payload: { projectName: projectName }
},
{
label: t('menu.workflow_instance'),
key: `/projects/${projectCode}/workflow/instances`,
payload: {projectName:projectName}
payload: { projectName: projectName }
},
{
label: t('menu.workflow_timing'),
key: `/projects/${projectCode}/workflow/timings`,
payload: { projectName: projectName }
}
]
},
@ -137,12 +144,12 @@ export function useDataList() {
{
label: t('menu.task_definition'),
key: `/projects/${projectCode}/task/definitions`,
payload: {projectName:projectName}
payload: { projectName: projectName }
},
{
label: t('menu.task_instance'),
key: `/projects/${projectCode}/task/instances`,
payload: {projectName:projectName}
payload: { projectName: projectName }
}
]
}

12
dolphinscheduler-ui/src/locales/en_US/datasource.ts

@ -90,10 +90,10 @@ export default {
clientSecret: 'ClientSecret',
OAuth_token_endpoint: 'OAuth 2.0 token endpoint',
endpoint_tips: 'Please enter OAuth Token',
AccessKeyID:'AccessKeyID',
AccessKeyID_tips:'Please input AccessKeyID',
SecretAccessKey:'SecretAccessKey',
SecretAccessKey_tips:'Please input SecretAccessKey',
dbUser:'DbUser',
dbUser_tips:'Please input DbUser',
AccessKeyID: 'AccessKeyID',
AccessKeyID_tips: 'Please input AccessKeyID',
SecretAccessKey: 'SecretAccessKey',
SecretAccessKey_tips: 'Please input SecretAccessKey',
dbUser: 'DbUser',
dbUser_tips: 'Please input DbUser'
}

2
dolphinscheduler-ui/src/locales/en_US/input-search.ts

@ -16,5 +16,5 @@
*/
export default {
placeholder: 'Please enter keyword'
placeholder: 'Please enter keyword'
}

3
dolphinscheduler-ui/src/locales/en_US/menu.ts

@ -27,6 +27,7 @@ export default {
workflow: 'Workflow',
workflow_definition: 'Workflow Definition',
workflow_instance: 'Workflow Instance',
workflow_timing: 'Workflow Timing',
task: 'Task',
task_instance: 'Task Instance',
task_definition: 'Task Definition',
@ -57,5 +58,5 @@ export default {
data_quality: 'Data Quality',
task_result: 'Task Result',
rule: 'Rule management',
ui_setting: 'UI Setting',
ui_setting: 'UI Setting'
}

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

@ -65,6 +65,7 @@ export default {
workflow_publish_status: 'Workflow Publish Status',
schedule_publish_status: 'Schedule Publish Status',
workflow_definition: 'Workflow Definition',
workflow_timing: 'Workflow Timing',
workflow_instance: 'Workflow Instance',
status: 'Status',
create_time: 'Create Time',
@ -82,7 +83,7 @@ export default {
copy_workflow: 'Copy Workflow',
copy_workflow_name: 'Copy workflow name',
visit_workflow_instances: 'Visit workflow instances',
cron_manage: 'Cron manage',
cron_manage: 'Timing Management',
delete: 'Delete',
tree_view: 'Tree View',
tree_limit: 'Limit Size',

2
dolphinscheduler-ui/src/locales/en_US/resource.ts

@ -59,7 +59,7 @@ export default {
udf_resources: 'UDF resources',
upload_udf_resources: 'Upload UDF Resources',
udf_source_name: 'UDF Resource Name',
user_name: 'Resource userName',
user_name: 'Resource userName'
},
function: {
udf_function: 'UDF Function',

2
dolphinscheduler-ui/src/locales/en_US/security.ts

@ -152,7 +152,7 @@ export default {
namespace: 'Namespace',
revoke_auth: 'Revoke',
grant_read: 'Grant Read',
grant_all:'Grant All',
grant_all: 'Grant All',
authorize_project: 'Project Authorize',
authorize_resource: 'Resource Authorize',
authorize_namespace: 'Namespace Authorize',

12
dolphinscheduler-ui/src/locales/zh_CN/datasource.ts

@ -87,10 +87,10 @@ export default {
clientSecret: 'ClientSecret',
OAuth_token_endpoint: 'OAuth 2.0 token endpoint',
endpoint_tips: '请输入OAuth',
AccessKeyID:'AccessKeyID',
AccessKeyID_tips:'请输入AccessKeyID',
SecretAccessKey:'SecretAccessKey',
SecretAccessKey_tips:'请输入SecretAccessKey',
dbUser:'DbUser',
dbUser_tips:'请输入DbUser',
AccessKeyID: 'AccessKeyID',
AccessKeyID_tips: '请输入AccessKeyID',
SecretAccessKey: 'SecretAccessKey',
SecretAccessKey_tips: '请输入SecretAccessKey',
dbUser: 'DbUser',
dbUser_tips: '请输入DbUser'
}

2
dolphinscheduler-ui/src/locales/zh_CN/input-search.ts

@ -16,5 +16,5 @@
*/
export default {
placeholder: '请输入关键词'
placeholder: '请输入关键词'
}

1
dolphinscheduler-ui/src/locales/zh_CN/menu.ts

@ -28,6 +28,7 @@ export default {
workflow: '工作流',
workflow_definition: '工作流定义',
workflow_instance: '工作流实例',
workflow_timing: '工作流定时',
task: '任务',
task_instance: '任务实例',
task_definition: '任务定义',

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

@ -66,6 +66,7 @@ export default {
schedule_publish_status: '定时状态',
workflow_definition: '工作流定义',
workflow_instance: '工作流实例',
workflow_timing: '工作流定时',
status: '状态',
create_time: '创建时间',
update_time: '更新时间',

2
dolphinscheduler-ui/src/locales/zh_CN/security.ts

@ -150,7 +150,7 @@ export default {
namespace: '命名空间',
revoke_auth: '撤销权限',
grant_read: '授予读权限',
grant_all:'授予所有权限',
grant_all: '授予所有权限',
authorize_project: '项目授权',
authorize_resource: '资源授权',
authorize_namespace: '命名空间授权',

11
dolphinscheduler-ui/src/router/modules/projects.ts

@ -111,6 +111,17 @@ export default {
auth: []
}
},
{
path: '/projects/:projectCode/workflow/timings',
name: 'workflow-timing-list',
component: components['projects-workflow-timing'],
meta: {
title: '工作流定时管理',
activeMenu: 'projects',
showSide: true,
auth: []
}
},
{
path: '/projects/:projectCode/workflow/instances',
name: 'workflow-instance-list',

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

@ -37,23 +37,23 @@ type IDataBase =
| 'SNOWFLAKE'
type IDataBaseLabel =
| 'MYSQL'
| 'POSTGRESQL'
| 'HIVE'
| 'SPARK'
| 'CLICKHOUSE'
| 'ORACLE'
| 'SQLSERVER'
| 'DB2'
| 'PRESTO'
| 'REDSHIFT'
| 'ATHENA'
| 'TRINO'
| 'AZURESQL'
| 'STARROCKS'
| 'DAMENG'
| 'OCEANBASE'
| 'SSH'
| 'MYSQL'
| 'POSTGRESQL'
| 'HIVE'
| 'SPARK'
| 'CLICKHOUSE'
| 'ORACLE'
| 'SQLSERVER'
| 'DB2'
| 'PRESTO'
| 'REDSHIFT'
| 'ATHENA'
| 'TRINO'
| 'AZURESQL'
| 'STARROCKS'
| 'DAMENG'
| 'OCEANBASE'
| 'SSH'
interface IDataSource {
id?: number

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

@ -248,10 +248,12 @@ export function viewTree(
})
}
export function viewProcessDefinitionVariables(code: number, processCode: number): any {
export function viewProcessDefinitionVariables(
code: number,
processCode: number
): any {
return axios({
url: `/projects/${code}/process-definition/${processCode}/view-variables`,
method: 'get'
})
}

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

@ -130,4 +130,3 @@ export function viewVariables(id: number, code: number): any {
method: 'get'
})
}

12
dolphinscheduler-ui/src/service/modules/projects/index.ts

@ -16,7 +16,13 @@
*/
import { axios } from '@/service/service'
import { ListReq, ListIdReq, ProjectsReq, UserIdReq, UpdateProjectsReq } from './types'
import {
ListReq,
ListIdReq,
ProjectsReq,
UserIdReq,
UpdateProjectsReq
} from './types'
export function queryProjectListPaging(params: ListReq): any {
return axios({
@ -26,7 +32,9 @@ export function queryProjectListPaging(params: ListReq): any {
})
}
export function queryProjectWithAuthorizedLevelListPaging(params: ListIdReq): any {
export function queryProjectWithAuthorizedLevelListPaging(
params: ListIdReq
): any {
return axios({
url: '/projects/project-with-authorized-level-list-paging',
method: 'get',

49
dolphinscheduler-ui/src/service/modules/resources/index.ts

@ -45,9 +45,7 @@ export function queryResourceListPaging(
})
}
export function queryBaseDir(
params: ResourceTypeReq
): any {
export function queryBaseDir(params: ResourceTypeReq): any {
return axios({
url: '/resources/base-dir',
method: 'get',
@ -56,20 +54,20 @@ export function queryBaseDir(
}
export function queryCurrentResourceByFileName(
params: ResourceTypeReq & FileNameReq & TenantCodeReq,
params: ResourceTypeReq & FileNameReq & TenantCodeReq
): any {
return axios({
url: `/resources/query-file-name`,
url: '/resources/query-file-name',
method: 'get',
params
})
}
export function queryCurrentResourceByFullName(
params: ResourceTypeReq & FullNameReq & TenantCodeReq,
params: ResourceTypeReq & FullNameReq & TenantCodeReq
): any {
return axios({
url: `/resources/query-full-name`,
url: '/resources/query-full-name',
method: 'get',
params
})
@ -195,21 +193,19 @@ export function verifyResourceName(params: FullNameReq & ResourceTypeReq): any {
})
}
export function doesResourceExist(
params: FullNameReq & ResourceTypeReq,
): any {
export function doesResourceExist(params: FullNameReq & ResourceTypeReq): any {
return axios({
url: `/resources/verify-name`,
url: '/resources/verify-name',
method: 'get',
params
})
}
export function updateResource(
data: NameReq & ResourceTypeReq & DescriptionReq & FullNameReq & TenantCodeReq,
data: NameReq & ResourceTypeReq & DescriptionReq & FullNameReq & TenantCodeReq
): any {
return axios({
url: `/resources`,
url: '/resources',
method: 'put',
data
})
@ -217,14 +213,14 @@ export function updateResource(
export function deleteResource(params: FullNameReq & TenantCodeReq): any {
return axios({
url: `/resources`,
url: '/resources',
method: 'delete',
params
})
}
export function downloadResource(params: FullNameReq): void {
utils.downloadFile(`resources/download`, params)
utils.downloadFile('resources/download', params)
}
export function viewUIUdfFunction(id: IdReq): any {
@ -234,36 +230,35 @@ export function viewUIUdfFunction(id: IdReq): any {
})
}
export function updateResourceContent(data: ContentReq & TenantCodeReq & FullNameReq): any {
export function updateResourceContent(
data: ContentReq & TenantCodeReq & FullNameReq
): any {
return axios({
url: `/resources/update-content`,
url: '/resources/update-content',
method: 'put',
data
})
}
export function viewResource(params: ViewResourceReq & FullNameReq & TenantCodeReq): any {
export function viewResource(
params: ViewResourceReq & FullNameReq & TenantCodeReq
): any {
return axios({
url: `/resources/view`,
url: '/resources/view',
method: 'get',
params
})
}
export function createUdfFunc(
data: UdfFuncReq
): any {
export function createUdfFunc(data: UdfFuncReq): any {
return axios({
url: `/resources/udf-func`,
url: '/resources/udf-func',
method: 'post',
data
})
}
export function updateUdfFunc(
data: UdfFuncReq,
id: number
): any {
export function updateUdfFunc(data: UdfFuncReq, id: number): any {
return axios({
url: `/resources/udf-func/${id}`,
method: 'put',

2
dolphinscheduler-ui/src/service/modules/resources/types.ts

@ -36,7 +36,7 @@ interface FileNameReq {
fileName: string
}
interface TenantCodeReq{
interface TenantCodeReq {
tenantCode: string
}

2
dolphinscheduler-ui/src/service/modules/schedules/types.ts

@ -34,7 +34,7 @@ interface ListReq {
}
interface ProcessDefinitionCodeReq {
processDefinitionCode: number
processDefinitionCode?: number
}
interface ScheduleReq {

5
dolphinscheduler-ui/src/service/modules/task-instances/index.ts

@ -55,7 +55,10 @@ export function savePoint(projectCode: number, taskId: number): any {
})
}
export function removeTaskInstanceCache(projectCode: number, taskId: number): any {
export function removeTaskInstanceCache(
projectCode: number,
taskId: number
): any {
return axios({
url: `projects/${projectCode}/task-instances/${taskId}/remove-cache`,
method: 'delete'

47
dolphinscheduler-ui/src/utils/environmental-distinction.ts

@ -15,31 +15,30 @@
* limitations under the License.
*/
import {h} from "vue";
import {NTag} from "naive-ui";
import { h } from 'vue'
import { NTag } from 'naive-ui'
export function renderEnvironmentalDistinctionCell(
testFlag: number | undefined,
t: Function
testFlag: number | undefined,
t: Function
) {
if (testFlag === 0) {
return h(
NTag,
{ type: 'success', size: 'small' },
{
default: () => t('datasource.on_line')
}
)
} else if (testFlag === 1) {
return h(
NTag,
{ type: 'warning', size: 'small' },
{
default: () => t('datasource.test')
}
)
} else {
return '-'
}
if (testFlag === 0) {
return h(
NTag,
{ type: 'success', size: 'small' },
{
default: () => t('datasource.on_line')
}
)
} else if (testFlag === 1) {
return h(
NTag,
{ type: 'warning', size: 'small' },
{
default: () => t('datasource.test')
}
)
} else {
return '-'
}
}

7
dolphinscheduler-ui/src/utils/tree-format.ts

@ -16,7 +16,12 @@
*/
const removeUselessChildren = (
list: { children?: []; directory?: boolean; disabled?: boolean; dirctory?: boolean }[]
list: {
children?: []
directory?: boolean
disabled?: boolean
dirctory?: boolean
}[]
) => {
if (!list.length) return
list.forEach((item) => {

8
dolphinscheduler-ui/src/views/data-quality/rule/index.tsx

@ -22,7 +22,7 @@ import {
ref,
toRefs
} from 'vue'
import {NSpace, NButton, NIcon, NDataTable, NPagination} from 'naive-ui'
import { NSpace, NButton, NIcon, NDataTable, NPagination } from 'naive-ui'
import { SearchOutlined } from '@vicons/antd'
import { useTable } from './use-table'
import Card from '@/components/card'
@ -113,11 +113,7 @@ const TaskResult = defineComponent({
placeholder={t('data_quality.rule.name')}
onSearch={onSearch}
/>
<NButton
size='small'
type='primary'
onClick={onSearch}
>
<NButton size='small' type='primary' onClick={onSearch}>
<NIcon>
<SearchOutlined />
</NIcon>

6
dolphinscheduler-ui/src/views/data-quality/task-result/index.tsx

@ -91,9 +91,9 @@ const TaskResult = defineComponent({
<Card>
<NSpace justify='end'>
<Search
v-model:value={this.searchVal}
placeholder={t('data_quality.task_result.task_name')}
onSearch={onSearch}
v-model:value={this.searchVal}
placeholder={t('data_quality.task_result.task_name')}
onSearch={onSearch}
/>
<NSelect
v-model={[this.ruleType, 'value']}

126
dolphinscheduler-ui/src/views/datasource/list/detail.tsx

@ -108,7 +108,8 @@ const DetailModal = defineComponent({
() => props.show,
async () => {
state.detailForm.type = props.selectType
state.detailForm.label = props.selectType === 'HIVE' ? 'HIVE/IMPALA' : props.selectType
state.detailForm.label =
props.selectType === 'HIVE' ? 'HIVE/IMPALA' : props.selectType
props.show &&
state.detailForm.type &&
(await changeType(
@ -116,7 +117,9 @@ const DetailModal = defineComponent({
datasourceType[state.detailForm.type]
))
props.show && props.id && setFieldsValue(await queryById(props.id))
props.show && state.detailForm.testFlag == 0 && await getSameTypeTestDataSource()
props.show &&
state.detailForm.testFlag == 0 &&
(await getSameTypeTestDataSource())
}
)
@ -124,12 +127,13 @@ const DetailModal = defineComponent({
() => props.selectType,
async () => {
state.detailForm.type = props.selectType
state.detailForm.label = props.selectType === 'HIVE' ? 'HIVE/IMPALA' : props.selectType
state.detailForm.label =
props.selectType === 'HIVE' ? 'HIVE/IMPALA' : props.selectType
state.detailForm.type &&
(await changeType(
state.detailForm.type,
datasourceType[state.detailForm.type]
))
(await changeType(
state.detailForm.type,
datasourceType[state.detailForm.type]
))
}
)
@ -205,8 +209,18 @@ const DetailModal = defineComponent({
show-require-mark
>
<div class={[styles.typeBox, !!id && styles.disabledBox]}>
<div v-model={[detailForm.type, 'value']}>{detailForm.label}</div>
<div class={[styles['text-color'], 'btn-data-source-type-drop-down']} onClick={handleSourceModalOpen}>{t('datasource.select')}</div>
<div v-model={[detailForm.type, 'value']}>
{detailForm.label}
</div>
<div
class={[
styles['text-color'],
'btn-data-source-type-drop-down'
]}
onClick={handleSourceModalOpen}
>
{t('datasource.select')}
</div>
</div>
</NFormItem>
<NFormItem
@ -290,14 +304,18 @@ const DetailModal = defineComponent({
</NFormItem>
{/* 验证条件选择 */}
<NFormItem
v-show={showMode}
label={t('datasource.validation')}
path='mode'
show-require-mark
v-show={showMode}
label={t('datasource.validation')}
path='mode'
show-require-mark
>
<NSelect
v-model={[detailForm.mode, 'value']}
options={detailForm.type === 'REDSHIFT' ? redShitModeOptions : modeOptions}
v-model={[detailForm.mode, 'value']}
options={
detailForm.type === 'REDSHIFT'
? redShitModeOptions
: modeOptions
}
></NSelect>
</NFormItem>
{/* SqlPassword */}
@ -329,7 +347,9 @@ const DetailModal = defineComponent({
</NFormItem>
{/* ActiveDirectoryPassword */}
<NFormItem
v-show={showMode && detailForm.mode === 'ActiveDirectoryPassword'}
v-show={
showMode && detailForm.mode === 'ActiveDirectoryPassword'
}
label={t('datasource.Azure_AD_username')}
path='userName'
show-require-mark
@ -342,7 +362,9 @@ const DetailModal = defineComponent({
/>
</NFormItem>
<NFormItem
v-show={showMode && detailForm.mode === 'ActiveDirectoryPassword'}
v-show={
showMode && detailForm.mode === 'ActiveDirectoryPassword'
}
label={t('datasource.Azure_AD_password')}
path='password'
show-require-mark
@ -369,7 +391,10 @@ const DetailModal = defineComponent({
</NFormItem>
{/* ActiveDirectoryServicePrincipal */}
<NFormItem
v-show={showMode && detailForm.mode === 'ActiveDirectoryServicePrincipal'}
v-show={
showMode &&
detailForm.mode === 'ActiveDirectoryServicePrincipal'
}
label={t('datasource.clientId')}
path='userName'
show-require-mark
@ -382,7 +407,10 @@ const DetailModal = defineComponent({
/>
</NFormItem>
<NFormItem
v-show={showMode && detailForm.mode === 'ActiveDirectoryServicePrincipal'}
v-show={
showMode &&
detailForm.mode === 'ActiveDirectoryServicePrincipal'
}
label={t('datasource.clientSecret')}
path='password'
show-require-mark
@ -528,17 +556,17 @@ const DetailModal = defineComponent({
/>
</NFormItem>
<NFormItem
v-show={showAwsRegion}
label={t('datasource.aws_region')}
path='awsRegion'
show-require-mark
v-show={showAwsRegion}
label={t('datasource.aws_region')}
path='awsRegion'
show-require-mark
>
<NInput
allowInput={this.trim}
v-model={[detailForm.awsRegion, 'value']}
type='text'
maxlength={60}
placeholder={t('datasource.aws_region_tips')}
allowInput={this.trim}
v-model={[detailForm.awsRegion, 'value']}
type='text'
maxlength={60}
placeholder={t('datasource.aws_region_tips')}
/>
</NFormItem>
<NFormItem
@ -557,19 +585,19 @@ const DetailModal = defineComponent({
/>
</NFormItem>
{detailForm.type === 'SNOWFLAKE' && (
<NFormItem
label={t('datasource.datawarehouse')}
path='datawarehouse'
show-require-mark
>
<NInput
allowInput={this.trim}
class='input-datawarehouse'
v-model={[detailForm.datawarehouse, 'value']}
maxlength={60}
placeholder={t('datasource.datawarehouse_tips')}
/>
</NFormItem>
<NFormItem
label={t('datasource.datawarehouse')}
path='datawarehouse'
show-require-mark
>
<NInput
allowInput={this.trim}
class='input-datawarehouse'
v-model={[detailForm.datawarehouse, 'value']}
maxlength={60}
placeholder={t('datasource.datawarehouse_tips')}
/>
</NFormItem>
)}
<NFormItem
v-show={showConnectType}
@ -655,16 +683,16 @@ const DetailModal = defineComponent({
/>
</NFormItem>
<NFormItem
v-show={showPublicKey}
label='PublicKey'
path='publicKey'
v-show={showPublicKey}
label='PublicKey'
path='publicKey'
>
<NInput
v-model={[detailForm.publicKey, 'value']}
type='textarea'
autosize={{
minRows: 4
}}
v-model={[detailForm.publicKey, 'value']}
type='textarea'
autosize={{
minRows: 4
}}
/>
</NFormItem>
</NForm>

5
dolphinscheduler-ui/src/views/datasource/list/use-columns.ts

@ -34,7 +34,7 @@ import {
calculateTableWidth,
DefaultTableWidth
} from '@/common/column-width-config'
import {renderEnvironmentalDistinctionCell} from "@/utils/environmental-distinction";
import { renderEnvironmentalDistinctionCell } from '@/utils/environmental-distinction'
export function useColumns(onCallback: Function) {
const { t } = useI18n()
@ -118,7 +118,8 @@ export function useColumns(onCallback: Function) {
circle: true,
type: 'info',
size: 'small',
onClick: () => void onCallback(rowData.id, 'edit', rowData)
onClick: () =>
void onCallback(rowData.id, 'edit', rowData)
},
{
default: () =>

48
dolphinscheduler-ui/src/views/datasource/list/use-form.ts

@ -220,25 +220,25 @@ export function useForm(id?: number) {
} as FormRules,
modeOptions: [
{
label: "SqlPassword",
value: 'SqlPassword',
label: 'SqlPassword',
value: 'SqlPassword'
},
{
label: "ActiveDirectoryPassword",
value: 'ActiveDirectoryPassword',
label: 'ActiveDirectoryPassword',
value: 'ActiveDirectoryPassword'
},
{
label: "ActiveDirectoryMSI",
value: 'ActiveDirectoryMSI',
label: 'ActiveDirectoryMSI',
value: 'ActiveDirectoryMSI'
},
{
label: "ActiveDirectoryServicePrincipal",
value: 'ActiveDirectoryServicePrincipal',
label: 'ActiveDirectoryServicePrincipal',
value: 'ActiveDirectoryServicePrincipal'
},
{
label: "accessToken",
value: 'accessToken',
},
label: 'accessToken',
value: 'accessToken'
}
],
redShitModeOptions: [
{
@ -256,7 +256,7 @@ export function useForm(id?: number) {
state.detailForm.port = options.previousPort || options.defaultPort
state.detailForm.type = type
state.requiredDataBase = (type !== 'POSTGRESQL' && type !== 'ATHENA')
state.requiredDataBase = type !== 'POSTGRESQL' && type !== 'ATHENA'
state.showHost = type !== 'ATHENA'
state.showPort = type !== 'ATHENA'
@ -280,12 +280,11 @@ export function useForm(id?: number) {
state.requiredDataBase = false
state.showJDBCConnectParameters = false
state.showPublicKey = true
}else {
} else {
state.showDataBaseName = true
state.requiredDataBase = true
state.showJDBCConnectParameters = true
state.showPublicKey = false
}
if (state.detailForm.id === undefined) {
@ -312,13 +311,13 @@ export function useForm(id?: number) {
const params = { type: state.detailForm.type, testFlag: 1 } as TypeReq
const result = await queryDataSourceList(params)
state.bindTestDataSourceExample = result
.filter((value: { label: string; value: string }) => {
// @ts-ignore
if (state.detailForm.id && state.detailForm.id === value.id)
return false
return true
})
.map((TestDataSourceExample: { name: string; id: number }) => ({
.filter((value: { label: string; value: string }) => {
// @ts-ignore
if (state.detailForm.id && state.detailForm.id === value.id)
return false
return true
})
.map((TestDataSourceExample: { name: string; id: number }) => ({
label: TestDataSourceExample.name,
value: TestDataSourceExample.id
}))
@ -338,7 +337,6 @@ export function useForm(id?: number) {
const getFieldsValue = () => state.detailForm
return {
state,
changeType,
@ -418,9 +416,9 @@ export const datasourceType: IDataBaseOptionKeys = {
defaultPort: 1433
},
STARROCKS: {
value: 'STARROCKS',
label: 'STARROCKS',
defaultPort: 9030
value: 'STARROCKS',
label: 'STARROCKS',
defaultPort: 9030
},
DAMENG: {
value: 'DAMENG',

2
dolphinscheduler-ui/src/views/datasource/list/use-table.ts

@ -15,7 +15,7 @@
* limitations under the License.
*/
import {reactive, ref} from 'vue'
import { reactive, ref } from 'vue'
import {
queryDataSourceListPaging,
deleteDataSource

36
dolphinscheduler-ui/src/views/login/index.tsx

@ -15,7 +15,13 @@
* limitations under the License.
*/
import {defineComponent, getCurrentInstance, onMounted, toRefs, withKeys} from 'vue'
import {
defineComponent,
getCurrentInstance,
onMounted,
toRefs,
withKeys
} from 'vue'
import styles from './index.module.scss'
import {
NInput,
@ -31,7 +37,7 @@ import { useLogin } from './use-login'
import { useLocalesStore } from '@/store/locales/locales'
import { useThemeStore } from '@/store/theme/theme'
import cookies from 'js-cookie'
import {ssoLoginUrl} from "@/service/modules/login";
import { ssoLoginUrl } from '@/service/modules/login'
const login = defineComponent({
name: 'login',
@ -57,8 +63,8 @@ const login = defineComponent({
state.loginForm.ssoLoginUrl = ssoLoginUrlRes
if (state.loginForm.ssoLoginUrl) {
const url = new URL(window.location.href)
let ssoState = url.searchParams.get('state')
let ssoCode = url.searchParams.get('code')
const ssoState = url.searchParams.get('state')
const ssoCode = url.searchParams.get('code')
if (ssoState && ssoCode) {
state.loginForm.userName = ssoState
state.loginForm.userPassword = ssoCode
@ -98,7 +104,10 @@ const login = defineComponent({
<div class={styles.logo}>
<div class={styles['logo-img']} />
</div>
<div class={styles['form-model']} v-show={this.loginForm.ssoLoginUrl.length === 0}>
<div
class={styles['form-model']}
v-show={this.loginForm.ssoLoginUrl.length === 0}
>
<NForm rules={this.rules} ref='loginFormRef'>
<NFormItem
label={this.t('login.userName')}
@ -145,14 +154,17 @@ const login = defineComponent({
{this.t('login.login')}
</NButton>
</div>
<div class={styles['form-model']} v-show={this.loginForm.ssoLoginUrl.length !== 0}>
<a href={this.loginForm.ssoLoginUrl} style="text-decoration:none">
<div
class={styles['form-model']}
v-show={this.loginForm.ssoLoginUrl.length !== 0}
>
<a href={this.loginForm.ssoLoginUrl} style='text-decoration:none'>
<NButton
class='btn-login-sso'
round
type='info'
style={{width: '100%', marginTop: '30px'}}
onClick={this.handleLogin}
class='btn-login-sso'
round
type='info'
style={{ width: '100%', marginTop: '30px' }}
onClick={this.handleLogin}
>
{this.t('login.ssoLogin')}
</NButton>

2
dolphinscheduler-ui/src/views/login/use-login.ts

@ -25,7 +25,7 @@ import type { UserInfoRes } from '@/service/modules/users/types'
import { useRouteStore } from '@/store/route/route'
import { useTimezoneStore } from '@/store/timezone/timezone'
import cookies from 'js-cookie'
import {queryBaseDir} from "@/service/modules/resources";
import { queryBaseDir } from '@/service/modules/resources'
export function useLogin(state: any) {
const router: Router = useRouter()

4
dolphinscheduler-ui/src/views/profile/use-form.ts

@ -32,7 +32,7 @@ export function useForm() {
profileForm: {
username: userInfo.userName,
email: userInfo.email,
phone: userInfo.phone,
phone: userInfo.phone
},
saving: false,
rules: {
@ -63,7 +63,7 @@ export function useForm() {
state.profileForm = {
username: userInfo.userName,
email: userInfo.email,
phone: userInfo.phone,
phone: userInfo.phone
}
})

18
dolphinscheduler-ui/src/views/projects/list/index.tsx

@ -16,13 +16,7 @@
*/
import { SearchOutlined } from '@vicons/antd'
import {
NButton,
NDataTable,
NIcon,
NPagination,
NSpace
} from 'naive-ui'
import { NButton, NDataTable, NIcon, NPagination, NSpace } from 'naive-ui'
import {
defineComponent,
getCurrentInstance,
@ -33,7 +27,7 @@ import {
import { useI18n } from 'vue-i18n'
import { useTable } from './use-table'
import Card from '@/components/card'
import Search from "@/components/input-search";
import Search from '@/components/input-search'
import ProjectModal from './components/project-modal'
const list = defineComponent({
@ -122,10 +116,10 @@ const list = defineComponent({
</NButton>
<NSpace>
<Search
v-model:value = {this.searchVal}
placeholder={t('project.list.project_tips')}
onSearch={this.handleSearch}
onClear={this.onClearSearch}
v-model:value={this.searchVal}
placeholder={t('project.list.project_tips')}
onSearch={this.handleSearch}
onClear={this.onClearSearch}
/>
<NButton size='small' type='primary' onClick={this.handleSearch}>

2
dolphinscheduler-ui/src/views/projects/list/use-table.ts

@ -84,7 +84,7 @@ export function useTable() {
onClick: () => {
router.push({
path: `/projects/${row.code}`,
query: {projectName: row.name}
query: { projectName: row.name }
})
}
},

14
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-cache.ts

@ -19,11 +19,11 @@ import { useI18n } from 'vue-i18n'
import type { IJsonItem } from '../types'
export function useCache(): IJsonItem {
const { t } = useI18n()
return {
type: 'switch',
field: 'isCache',
name: t('project.node.is_cache'),
span: 12
}
const { t } = useI18n()
return {
type: 'switch',
field: 'isCache',
name: t('project.node.is_cache'),
span: 12
}
}

108
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-custom-labels.ts

@ -19,64 +19,64 @@ import { useI18n } from 'vue-i18n'
import type { IJsonItem } from '../types'
export function useCustomLabels({
model,
field,
name = 'custom_labels',
span = 24
}: {
model: { [field: string]: any }
field: string
name?: string
span?: Ref | number
model,
field,
name = 'custom_labels',
span = 24
}: {
model: { [field: string]: any }
field: string
name?: string
span?: Ref | number
}): IJsonItem[] {
const { t } = useI18n()
const { t } = useI18n()
return [
return [
{
type: 'custom-parameters',
field: field,
name: t(`project.node.${name}`),
class: 'btn-custom-parameters',
span,
children: [
{
type: 'custom-parameters',
field: field,
name: t(`project.node.${name}`),
class: 'btn-custom-parameters',
span,
children: [
{
type: 'input',
field: 'label',
span: 8,
class: 'customized-label-name',
props: {
placeholder: t('project.node.label_name_tips'),
maxLength: 256
},
validate: {
trigger: ['input', 'blur'],
required: true,
validator(validate: any, value: string) {
if (!value) {
return new Error(t('project.node.label_name_tips'))
}
type: 'input',
field: 'label',
span: 8,
class: 'customized-label-name',
props: {
placeholder: t('project.node.label_name_tips'),
maxLength: 256
},
validate: {
trigger: ['input', 'blur'],
required: true,
validator(validate: any, value: string) {
if (!value) {
return new Error(t('project.node.label_name_tips'))
}
const sameItems = model[field].filter(
(item: { label: string }) => item.label === value
)
const sameItems = model[field].filter(
(item: { label: string }) => item.label === value
)
if (sameItems.length > 1) {
return new Error(t('project.node.label_repeat'))
}
}
}
},
{
type: 'input',
field: 'value',
span: 14,
class: 'customized-label-value',
props: {
placeholder: t('project.node.label_value_tips'),
maxLength: 256
}
}
]
if (sameItems.length > 1) {
return new Error(t('project.node.label_repeat'))
}
}
}
},
{
type: 'input',
field: 'value',
span: 14,
class: 'customized-label-value',
props: {
placeholder: t('project.node.label_value_tips'),
maxLength: 256
}
}
]
]
}
]
}

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

@ -122,7 +122,7 @@ export function useDatasource(
id: 16,
code: 'DATABEND',
disabled: false
},
}
]
const getDatasourceTypes = async () => {

115
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datasync.ts

@ -20,67 +20,66 @@ import { watch, ref } from 'vue'
import { useCustomParams } from '.'
export function useDatasync(model: { [field: string]: any }): IJsonItem[] {
const jsonSpan = ref(0)
const destinationLocationArnSpan = ref(0)
const sourceLocationArnSpan = ref(0)
const nameSpan = ref(0)
const cloudWatchLogGroupArnSpan = ref(0)
const jsonSpan = ref(0)
const destinationLocationArnSpan = ref(0)
const sourceLocationArnSpan = ref(0)
const nameSpan = ref(0)
const cloudWatchLogGroupArnSpan = ref(0)
const resetSpan = () => {
jsonSpan.value = model.jsonFormat ? 24 : 0
destinationLocationArnSpan.value = model.jsonFormat ? 0 : 24
sourceLocationArnSpan.value = model.jsonFormat ? 0 : 24
nameSpan.value = model.jsonFormat ? 0 : 24
cloudWatchLogGroupArnSpan.value = model.jsonFormat ? 0 : 24
}
const resetSpan = () => {
jsonSpan.value = model.jsonFormat ? 24 : 0
destinationLocationArnSpan.value = model.jsonFormat ? 0 : 24
sourceLocationArnSpan.value = model.jsonFormat ? 0 : 24
nameSpan.value = model.jsonFormat ? 0 : 24
cloudWatchLogGroupArnSpan.value = model.jsonFormat ? 0 : 24
watch(
() => [model.jsonFormat],
() => {
resetSpan()
}
)
watch(
() => [model.jsonFormat],
() => {
resetSpan()
}
)
resetSpan()
resetSpan()
return [
{
type: 'switch',
field: 'jsonFormat',
name: 'jsonFormat',
span: 12
},
{
type: 'editor',
field: 'json',
name: 'json',
span: jsonSpan
},
{
type: 'input',
field: 'destinationLocationArn',
name: 'destinationLocationArn',
span: destinationLocationArnSpan
},
{
type: 'input',
field: 'sourceLocationArn',
name: 'sourceLocationArn',
span: sourceLocationArnSpan
},
{
type: 'input',
field: 'name',
name: 'name',
span: nameSpan
},
{
type: 'input',
field: 'cloudWatchLogGroupArn',
name: 'cloudWatchLogGroupArn',
span: cloudWatchLogGroupArnSpan
},
...useCustomParams({ model, field: 'localParams', isSimple: false })
]
return [
{
type: 'switch',
field: 'jsonFormat',
name: 'jsonFormat',
span: 12
},
{
type: 'editor',
field: 'json',
name: 'json',
span: jsonSpan
},
{
type: 'input',
field: 'destinationLocationArn',
name: 'destinationLocationArn',
span: destinationLocationArnSpan
},
{
type: 'input',
field: 'sourceLocationArn',
name: 'sourceLocationArn',
span: sourceLocationArnSpan
},
{
type: 'input',
field: 'name',
name: 'name',
span: nameSpan
},
{
type: 'input',
field: 'cloudWatchLogGroupArn',
name: 'cloudWatchLogGroupArn',
span: cloudWatchLogGroupArnSpan
},
...useCustomParams({ model, field: 'localParams', isSimple: false })
]
}

466
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datax.ts

@ -14,243 +14,243 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {ref, onMounted, watch} from 'vue'
import {useI18n} from 'vue-i18n'
import {useCustomParams, useDatasource, useResources} from '.'
import type {IJsonItem} from '../types'
import { ref, onMounted, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { useCustomParams, useDatasource, useResources } from '.'
import type { IJsonItem } from '../types'
export function useDataX(model: { [field: string]: any }): IJsonItem[] {
const {t} = useI18n()
const jobSpeedByteOptions: any[] = [
{
label: `0(${t('project.node.unlimited')})`,
value: 0
},
{
label: '1KB',
value: 1024
},
{
label: '10KB',
value: 10240
},
{
label: '50KB',
value: 51200
},
{
label: '100KB',
value: 102400
},
{
label: '512KB',
value: 524288
}
]
const jobSpeedRecordOptions: any[] = [
{
label: `0(${t('project.node.unlimited')})`,
value: 0
},
{
label: '500',
value: 500
},
{
label: '1000',
value: 1000
},
{
label: '1500',
value: 1500
},
{
label: '2000',
value: 2000
},
{
label: '2500',
value: 2500
},
{
label: '3000',
value: 3000
}
]
const memoryLimitOptions = [
{
label: '1G',
value: 1
},
{
label: '2G',
value: 2
},
{
label: '3G',
value: 3
},
{
label: '4G',
value: 4
}
]
const { t } = useI18n()
const jobSpeedByteOptions: any[] = [
{
label: `0(${t('project.node.unlimited')})`,
value: 0
},
{
label: '1KB',
value: 1024
},
{
label: '10KB',
value: 10240
},
{
label: '50KB',
value: 51200
},
{
label: '100KB',
value: 102400
},
{
label: '512KB',
value: 524288
}
]
const jobSpeedRecordOptions: any[] = [
{
label: `0(${t('project.node.unlimited')})`,
value: 0
},
{
label: '500',
value: 500
},
{
label: '1000',
value: 1000
},
{
label: '1500',
value: 1500
},
{
label: '2000',
value: 2000
},
{
label: '2500',
value: 2500
},
{
label: '3000',
value: 3000
}
]
const memoryLimitOptions = [
{
label: '1G',
value: 1
},
{
label: '2G',
value: 2
},
{
label: '3G',
value: 3
},
{
label: '4G',
value: 4
}
]
const sqlEditorSpan = ref(24)
const jsonEditorSpan = ref(0)
const datasourceSpan = ref(12)
const destinationDatasourceSpan = ref(8)
const otherStatementSpan = ref(22)
const jobSpeedSpan = ref(12)
const useResourcesSpan = ref(0)
const sqlEditorSpan = ref(24)
const jsonEditorSpan = ref(0)
const datasourceSpan = ref(12)
const destinationDatasourceSpan = ref(8)
const otherStatementSpan = ref(22)
const jobSpeedSpan = ref(12)
const useResourcesSpan = ref(0)
const initConstants = () => {
if (model.customConfig) {
sqlEditorSpan.value = 0
jsonEditorSpan.value = 24
datasourceSpan.value = 0
destinationDatasourceSpan.value = 0
otherStatementSpan.value = 0
jobSpeedSpan.value = 0
useResourcesSpan.value = 24
} else {
sqlEditorSpan.value = 24
jsonEditorSpan.value = 0
datasourceSpan.value = 12
destinationDatasourceSpan.value = 8
otherStatementSpan.value = 22
jobSpeedSpan.value = 12
useResourcesSpan.value = 0
}
const initConstants = () => {
if (model.customConfig) {
sqlEditorSpan.value = 0
jsonEditorSpan.value = 24
datasourceSpan.value = 0
destinationDatasourceSpan.value = 0
otherStatementSpan.value = 0
jobSpeedSpan.value = 0
useResourcesSpan.value = 24
} else {
sqlEditorSpan.value = 24
jsonEditorSpan.value = 0
datasourceSpan.value = 12
destinationDatasourceSpan.value = 8
otherStatementSpan.value = 22
jobSpeedSpan.value = 12
useResourcesSpan.value = 0
}
}
const supportedDatasourceType = [
'MYSQL',
'POSTGRESQL',
'ORACLE',
'SQLSERVER',
'CLICKHOUSE',
'DATABEND',
'HIVE',
'PRESTO'
]
onMounted(() => {
initConstants()
})
watch(
() => model.customConfig,
() => {
initConstants()
}
const supportedDatasourceType = [
'MYSQL',
'POSTGRESQL',
'ORACLE',
'SQLSERVER',
'CLICKHOUSE',
'DATABEND',
'HIVE',
'PRESTO'
]
onMounted(() => {
initConstants()
})
watch(
() => model.customConfig,
() => {
initConstants()
}
)
)
return [
{
type: 'switch',
field: 'customConfig',
name: t('project.node.datax_custom_template')
},
...useDatasource(model, {
typeField: 'dsType',
sourceField: 'dataSource',
span: datasourceSpan,
supportedDatasourceType
}),
{
type: 'editor',
field: 'sql',
name: t('project.node.sql_statement'),
span: sqlEditorSpan,
validate: {
trigger: ['input', 'trigger'],
required: true,
message: t('project.node.sql_empty_tips')
}
},
{
type: 'editor',
field: 'json',
name: t('project.node.datax_json_template'),
span: jsonEditorSpan,
validate: {
trigger: ['input', 'trigger'],
required: true,
message: t('project.node.sql_empty_tips')
}
},
useResources(useResourcesSpan),
...useDatasource(model, {
typeField: 'dtType',
sourceField: 'dataTarget',
span: destinationDatasourceSpan,
supportedDatasourceType
}),
{
type: 'input',
field: 'targetTable',
name: t('project.node.datax_target_table'),
span: destinationDatasourceSpan,
props: {
placeholder: t('project.node.datax_target_table_tips')
},
validate: {
trigger: ['input', 'blur'],
required: true
}
},
{
type: 'multi-input',
field: 'preStatements',
name: t('project.node.datax_target_database_pre_sql'),
span: otherStatementSpan,
props: {
placeholder: t('project.node.datax_non_query_sql_tips'),
type: 'textarea',
autosize: {minRows: 1}
}
},
{
type: 'multi-input',
field: 'postStatements',
name: t('project.node.datax_target_database_post_sql'),
span: otherStatementSpan,
props: {
placeholder: t('project.node.datax_non_query_sql_tips'),
type: 'textarea',
autosize: {minRows: 1}
}
},
{
type: 'select',
field: 'jobSpeedByte',
name: t('project.node.datax_job_speed_byte'),
span: jobSpeedSpan,
options: jobSpeedByteOptions,
value: 0
},
{
type: 'select',
field: 'jobSpeedRecord',
name: t('project.node.datax_job_speed_record'),
span: jobSpeedSpan,
options: jobSpeedRecordOptions,
value: 1000
},
{
type: 'select',
field: 'xms',
name: t('project.node.datax_job_runtime_memory_xms'),
span: 12,
options: memoryLimitOptions,
value: 1
},
{
type: 'select',
field: 'xmx',
name: t('project.node.datax_job_runtime_memory_xmx'),
span: 12,
options: memoryLimitOptions,
value: 1
},
...useCustomParams({model, field: 'localParams', isSimple: true})
]
return [
{
type: 'switch',
field: 'customConfig',
name: t('project.node.datax_custom_template')
},
...useDatasource(model, {
typeField: 'dsType',
sourceField: 'dataSource',
span: datasourceSpan,
supportedDatasourceType
}),
{
type: 'editor',
field: 'sql',
name: t('project.node.sql_statement'),
span: sqlEditorSpan,
validate: {
trigger: ['input', 'trigger'],
required: true,
message: t('project.node.sql_empty_tips')
}
},
{
type: 'editor',
field: 'json',
name: t('project.node.datax_json_template'),
span: jsonEditorSpan,
validate: {
trigger: ['input', 'trigger'],
required: true,
message: t('project.node.sql_empty_tips')
}
},
useResources(useResourcesSpan),
...useDatasource(model, {
typeField: 'dtType',
sourceField: 'dataTarget',
span: destinationDatasourceSpan,
supportedDatasourceType
}),
{
type: 'input',
field: 'targetTable',
name: t('project.node.datax_target_table'),
span: destinationDatasourceSpan,
props: {
placeholder: t('project.node.datax_target_table_tips')
},
validate: {
trigger: ['input', 'blur'],
required: true
}
},
{
type: 'multi-input',
field: 'preStatements',
name: t('project.node.datax_target_database_pre_sql'),
span: otherStatementSpan,
props: {
placeholder: t('project.node.datax_non_query_sql_tips'),
type: 'textarea',
autosize: { minRows: 1 }
}
},
{
type: 'multi-input',
field: 'postStatements',
name: t('project.node.datax_target_database_post_sql'),
span: otherStatementSpan,
props: {
placeholder: t('project.node.datax_non_query_sql_tips'),
type: 'textarea',
autosize: { minRows: 1 }
}
},
{
type: 'select',
field: 'jobSpeedByte',
name: t('project.node.datax_job_speed_byte'),
span: jobSpeedSpan,
options: jobSpeedByteOptions,
value: 0
},
{
type: 'select',
field: 'jobSpeedRecord',
name: t('project.node.datax_job_speed_record'),
span: jobSpeedSpan,
options: jobSpeedRecordOptions,
value: 1000
},
{
type: 'select',
field: 'xms',
name: t('project.node.datax_job_runtime_memory_xms'),
span: 12,
options: memoryLimitOptions,
value: 1
},
{
type: 'select',
field: 'xmx',
name: t('project.node.datax_job_runtime_memory_xmx'),
span: 12,
options: memoryLimitOptions,
value: 1
},
...useCustomParams({ model, field: 'localParams', isSimple: true })
]
}

4
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-dependent-timeout.ts

@ -24,7 +24,9 @@ export function useDependentTimeout(model: {
}): IJsonItem[] {
const { t } = useI18n()
const timeCompleteSpan = computed(() => (model.timeoutShowFlag ? 24 : 0))
const timeCompleteEnableSpan = computed(() => (model.timeoutFlag && model.timeoutShowFlag ? 12 : 0))
const timeCompleteEnableSpan = computed(() =>
model.timeoutFlag && model.timeoutShowFlag ? 12 : 0
)
const strategyOptions = [
{

7
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-dms.ts

@ -20,7 +20,6 @@ import { watch, ref } from 'vue'
import { useCustomParams, useResources } from '.'
export function useDms(model: { [field: string]: any }): IJsonItem[] {
const jsonDataSpan = ref(0)
const replicationTaskArnSpan = ref(0)
const replicationTaskIdentifierSpan = ref(0)
@ -31,8 +30,10 @@ export function useDms(model: { [field: string]: any }): IJsonItem[] {
const tableMappingsSpan = ref(0)
const setFlag = () => {
model.isCreateAndNotJson = !model.isRestartTask && !model.isJsonFormat ? true : false
model.isRestartAndNotJson = model.isRestartTask && !model.isJsonFormat ? true : false
model.isCreateAndNotJson =
!model.isRestartTask && !model.isJsonFormat ? true : false
model.isRestartAndNotJson =
model.isRestartTask && !model.isJsonFormat ? true : false
}
const resetSpan = () => {

6
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-environment-name.ts

@ -49,7 +49,9 @@ export function useEnvironmentName(
if (options.value.length === 0) {
model.environmentCode = null
} else {
(isCreate && !model.environmentCode) && (model.environmentCode = options.value[0].value)
isCreate &&
!model.environmentCode &&
(model.environmentCode = options.value[0].value)
}
}
@ -83,7 +85,7 @@ export function useEnvironmentName(
name: t('project.node.environment_name'),
props: {
loading: loading,
clearable: true,
clearable: true
},
options: options
}

3
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-flink.ts

@ -102,7 +102,8 @@ export function useFlink(model: { [field: string]: any }): IJsonItem[] {
)
watchEffect(() => {
model.flinkVersion = model.programType === 'SQL' ? '>=1.13' : model.flinkVersion
model.flinkVersion =
model.programType === 'SQL' ? '>=1.13' : model.flinkVersion
})
return [

14
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-hive-cli.ts

@ -14,16 +14,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { computed } from 'vue'
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import { useCustomParams, useResources } from '.'
import type { IJsonItem } from '../types'
export function useHiveCli(model: { [field: string]: any }): IJsonItem[] {
const { t } = useI18n()
const hiveSqlScriptSpan = computed(() => (model.hiveCliTaskExecutionType === 'SCRIPT' ? 24 : 0))
const resourcesRequired = computed(() => (model.hiveCliTaskExecutionType === 'SCRIPT' ? false : true))
const resourcesLimit = computed(() => (model.hiveCliTaskExecutionType === 'SCRIPT' ? -1 : 1))
const hiveSqlScriptSpan = computed(() =>
model.hiveCliTaskExecutionType === 'SCRIPT' ? 24 : 0
)
const resourcesRequired = computed(() =>
model.hiveCliTaskExecutionType === 'SCRIPT' ? false : true
)
const resourcesLimit = computed(() =>
model.hiveCliTaskExecutionType === 'SCRIPT' ? -1 : 1
)
return [
{

4
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-linkis.ts

@ -24,7 +24,7 @@ export function useLinkis(model: { [field: string]: any }): IJsonItem[] {
const configEditorSpan = computed(() => (model.useCustom ? 24 : 0))
const parmaEditorSpan = computed(() => (model.useCustom ? 0 : 24))
computed(() => (model.useCustom ? 0 : 24));
computed(() => (model.useCustom ? 0 : 24))
return [
{
type: 'switch',
@ -54,7 +54,7 @@ export function useLinkis(model: { [field: string]: any }): IJsonItem[] {
}
const sameItems = model.localParams.filter(
(item: { prop: string }) => item.prop === value
(item: { prop: string }) => item.prop === value
)
if (sameItems.length > 1) {

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

@ -58,7 +58,7 @@ export function useNamespace(): IJsonItem {
props: {
loading,
'render-label': renderLabel,
'clearable': true
clearable: true
},
options: [
{

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

@ -41,7 +41,7 @@ export function useResources(
}
if (resourcesLoading.value) return
resourcesLoading.value = true
const res = await queryResourceList({ type: 'FILE', fullName:"" })
const res = await queryResourceList({ type: 'FILE', fullName: '' })
utils.removeUselessChildren(res)
resourcesOptions.value = res || []
resourcesLoading.value = false

32
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-sea-tunnel.ts

@ -24,19 +24,35 @@ export function useSeaTunnel(model: { [field: string]: any }): IJsonItem[] {
const configEditorSpan = computed(() => (model.useCustom ? 24 : 0))
const resourceEditorSpan = computed(() => (model.useCustom ? 0 : 24))
const flinkSpan = computed(() => (model.startupScript.includes("flink") ? 24 : 0))
const deployModeSpan = computed(() => (model.startupScript.includes("spark") || model.startupScript === "seatunnel.sh" ? 24 : 0))
const masterSpan = computed(() => (model.startupScript.includes("spark")) && model.deployMode !== 'local' ? 12 : 0)
const flinkSpan = computed(() =>
model.startupScript.includes('flink') ? 24 : 0
)
const deployModeSpan = computed(() =>
model.startupScript.includes('spark') ||
model.startupScript === 'seatunnel.sh'
? 24
: 0
)
const masterSpan = computed(() =>
model.startupScript.includes('spark') && model.deployMode !== 'local'
? 12
: 0
)
const masterUrlSpan = computed(() =>
(model.startupScript.includes("spark")) &&
model.startupScript.includes('spark') &&
model.deployMode !== 'local' &&
(model.master === 'SPARK' || model.master === 'MESOS')
? 12
: 0
)
const showClient = computed(() => model.startupScript.includes("spark"))
const showClient = computed(() => model.startupScript.includes('spark'))
const showLocal = computed(() => model.startupScript === 'seatunnel.sh')
const othersSpan = computed(() => (model.startupScript.includes("flink") || model.startupScript === 'seatunnel.sh' ? 24 : 0))
const othersSpan = computed(() =>
model.startupScript.includes('flink') ||
model.startupScript === 'seatunnel.sh'
? 24
: 0
)
return [
{
@ -56,12 +72,12 @@ export function useSeaTunnel(model: { [field: string]: any }): IJsonItem[] {
if (model.startupScript === 'seatunnel.sh') {
model.deployMode = 'local'
}
if (model.startupScript.includes("spark")) {
if (model.startupScript.includes('spark')) {
model.deployMode = 'client'
}
}
}
},
}
},
// SeaTunnel flink parameter

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

@ -85,7 +85,7 @@ export function useZeppelin(model: { [field: string]: any }): IJsonItem[] {
field: 'password',
name: t('project.node.zeppelin_password'),
props: {
placeholder: t('project.node.zeppelin_password_tips')
placeholder: t('project.node.zeppelin_password_tips')
}
},
{

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

@ -218,16 +218,16 @@ export function formatParams(data: INodeData): {
taskParams.startupScript = data.startupScript
taskParams.useCustom = data.useCustom
taskParams.rawScript = data.rawScript
if (data.startupScript?.includes("flink")) {
if (data.startupScript?.includes('flink')) {
taskParams.runMode = data.runMode
taskParams.others = data.others
}
if (data.startupScript?.includes("spark")) {
if (data.startupScript?.includes('spark')) {
taskParams.deployMode = data.deployMode
taskParams.master = data.master
taskParams.masterUrl = data.masterUrl
}
if (data.startupScript === "seatunnel.sh") {
if (data.startupScript === 'seatunnel.sh') {
taskParams.deployMode = data.deployMode
taskParams.others = data.others
}
@ -502,7 +502,7 @@ export function formatParams(data: INodeData): {
: '0',
failRetryTimes: data.failRetryTimes ? String(data.failRetryTimes) : '0',
flag: data.flag,
isCache: data.isCache ? "YES" : "NO",
isCache: data.isCache ? 'YES' : 'NO',
name: data.name,
taskGroupId: data.taskGroupId,
taskGroupPriority: data.taskGroupPriority,
@ -514,7 +514,9 @@ export function formatParams(data: INodeData): {
initScript: data.initScript,
rawScript: data.rawScript,
resourceList: data.resourceList?.length
? data.resourceList.map((fullName: string) => ({ resourceName: `${fullName}` }))
? data.resourceList.map((fullName: string) => ({
resourceName: `${fullName}`
}))
: [],
...taskParams
},
@ -563,7 +565,7 @@ export function formatModel(data: ITaskData) {
}
if (data.taskParams?.resourceList) {
params.resourceList = data.taskParams.resourceList.map(
(item: { resourceName: string }) => (`${item.resourceName}`)
(item: { resourceName: string }) => `${item.resourceName}`
)
}
if (data.taskParams?.mainJar) {

110
dolphinscheduler-ui/src/views/projects/task/components/node/tasks/use-datasync.ts

@ -20,64 +20,64 @@ import * as Fields from '../fields/index'
import type { IJsonItem, INodeData, ITaskData } from '../types'
export function useDatasync({
projectCode,
from = 0,
readonly,
data
projectCode,
from = 0,
readonly,
data
}: {
projectCode: number
from?: number
readonly?: boolean
data?: ITaskData
projectCode: number
from?: number
readonly?: boolean
data?: ITaskData
}) {
const model = reactive({
name: '',
taskType: 'DATASYNC',
flag: 'YES',
description: '',
timeoutFlag: false,
localParams: [],
environmentCode: null,
failRetryInterval: 1,
failRetryTimes: 0,
workerGroup: 'default',
delayTime: 0,
timeout: 30,
timeoutNotifyStrategy: ['WARN'],
const model = reactive({
name: '',
taskType: 'DATASYNC',
flag: 'YES',
description: '',
timeoutFlag: false,
localParams: [],
environmentCode: null,
failRetryInterval: 1,
failRetryTimes: 0,
workerGroup: 'default',
delayTime: 0,
timeout: 30,
timeoutNotifyStrategy: ['WARN']
} as INodeData)
let extra: IJsonItem[] = []
if (from === 1) {
extra = [
Fields.useTaskType(model, readonly),
Fields.useProcessName({
model,
projectCode,
isCreate: !data?.id,
from,
processName: data?.processName
})
]
}
let extra: IJsonItem[] = []
if (from === 1) {
extra = [
Fields.useTaskType(model, readonly),
Fields.useProcessName({
model,
projectCode,
isCreate: !data?.id,
from,
processName: data?.processName
})
]
}
return {
json: [
Fields.useName(from),
...extra,
Fields.useRunFlag(),
Fields.useCache(),
Fields.useDescription(),
Fields.useTaskPriority(),
Fields.useWorkerGroup(),
Fields.useEnvironmentName(model, !model.id),
...Fields.useTaskGroup(model, projectCode),
...Fields.useFailed(),
...Fields.useResourceLimit(),
Fields.useDelayTime(model),
...Fields.useTimeoutAlarm(model),
...Fields.useDatasync(model),
Fields.usePreTasks()
] as IJsonItem[],
model
}
return {
json: [
Fields.useName(from),
...extra,
Fields.useRunFlag(),
Fields.useCache(),
Fields.useDescription(),
Fields.useTaskPriority(),
Fields.useWorkerGroup(),
Fields.useEnvironmentName(model, !model.id),
...Fields.useTaskGroup(model, projectCode),
...Fields.useFailed(),
...Fields.useResourceLimit(),
Fields.useDelayTime(model),
...Fields.useTimeoutAlarm(model),
...Fields.useDatasync(model),
Fields.usePreTasks()
] as IJsonItem[],
model
}
}

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

@ -44,7 +44,7 @@ export function useDms({
delayTime: 0,
timeout: 30,
timeoutNotifyStrategy: ['WARN'],
isRestartTask: false,
isRestartTask: false
} as INodeData)
let extra: IJsonItem[] = []

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

@ -52,7 +52,7 @@ export function useLinkis({
{
prop: '',
value: ''
},
}
],
rawScript: ''
} as INodeData)

46
dolphinscheduler-ui/src/views/projects/task/components/node/tasks/use-sea-tunnel.ts

@ -56,29 +56,29 @@ export function useSeaTunnel({
timeoutNotifyStrategy: ['WARN'],
rawScript:
'env {\n' +
' execution.parallelism = 2\n' +
' job.mode = "BATCH"\n' +
' checkpoint.interval = 10000\n' +
'}\n' +
'\n' +
'source {\n' +
' FakeSource {\n' +
' parallelism = 2\n' +
' result_table_name = "fake"\n' +
' row.num = 16\n' +
' schema = {\n' +
' fields {\n' +
' name = "string"\n' +
' age = "int"\n' +
' }\n' +
' }\n' +
' }\n' +
'}\n' +
'\n' +
'sink {\n' +
' Console {\n' +
' }\n' +
'}'
' execution.parallelism = 2\n' +
' job.mode = "BATCH"\n' +
' checkpoint.interval = 10000\n' +
'}\n' +
'\n' +
'source {\n' +
' FakeSource {\n' +
' parallelism = 2\n' +
' result_table_name = "fake"\n' +
' row.num = 16\n' +
' schema = {\n' +
' fields {\n' +
' name = "string"\n' +
' age = "int"\n' +
' }\n' +
' }\n' +
' }\n' +
'}\n' +
'\n' +
'sink {\n' +
' Console {\n' +
' }\n' +
'}'
} as INodeData)
return {

6
dolphinscheduler-ui/src/views/projects/task/components/node/types.ts

@ -120,8 +120,8 @@ interface IDependentParameters {
* res: resource file name
*/
interface ISourceItem {
id?: number,
resourceName: string,
id?: number
resourceName: string
res?: string
}
@ -495,7 +495,7 @@ interface ITaskData
> {
name?: string
taskPriority?: string
isCache?: "YES" | "NO"
isCache?: 'YES' | 'NO'
timeoutFlag?: 'OPEN' | 'CLOSE'
timeoutNotifyStrategy?: string | []
taskParams?: ITaskParams

14
dolphinscheduler-ui/src/views/projects/task/definition/use-table.ts

@ -77,13 +77,13 @@ export function useTable(onEdit: Function) {
},
{
default: () =>
h(
NEllipsis,
{
style: 'max-width: 580px;line-height: 1.5'
},
() => row.taskName
)
h(
NEllipsis,
{
style: 'max-width: 580px;line-height: 1.5'
},
() => row.taskName
)
}
)
},

2
dolphinscheduler-ui/src/views/projects/task/instance/batch-task.tsx

@ -107,7 +107,7 @@ const BatchTaskInstance = defineComponent({
variables.showModalRef = false
}
var getLogsID: number
let getLogsID: number
const getLogs = (row: any, logTimer: number) => {
const { state } = useAsyncState(

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

@ -21,7 +21,6 @@ import { NTabPane, NTabs } from 'naive-ui'
import BatchTaskInstance from './batch-task'
import StreamTaskInstance from './stream-task'
const TaskDefinition = defineComponent({
name: 'task-instance',
setup() {

28
dolphinscheduler-ui/src/views/projects/task/instance/use-table.ts

@ -23,14 +23,7 @@ import {
forceSuccess,
downloadLog
} from '@/service/modules/task-instances'
import {
NButton,
NIcon,
NSpace,
NTooltip,
NSpin,
NEllipsis
} from 'naive-ui'
import { NButton, NIcon, NSpace, NTooltip, NSpin, NEllipsis } from 'naive-ui'
import ButtonLink from '@/components/button-link'
import {
AlignLeftOutlined,
@ -39,19 +32,14 @@ import {
} from '@vicons/antd'
import { format } from 'date-fns'
import { useRoute, useRouter } from 'vue-router'
import {
parseTime,
renderTableTime,
tasksState
} from '@/common/common'
import { parseTime, renderTableTime, tasksState } from '@/common/common'
import {
COLUMN_WIDTH_CONFIG,
calculateTableWidth,
DefaultTableWidth
} from '@/common/column-width-config'
import type { Router, TaskInstancesRes, IRecord, ITaskState } from './types'
import {renderEnvironmentalDistinctionCell} from "@/utils/environmental-distinction";
import { renderEnvironmentalDistinctionCell } from '@/utils/environmental-distinction'
export function useTable() {
const { t } = useI18n()
@ -98,7 +86,7 @@ export function useTable() {
...COLUMN_WIDTH_CONFIG['name'],
resizable: true,
minWidth: 200,
maxWidth: 600,
maxWidth: 600
},
{
title: t('project.task.workflow_instance'),
@ -115,7 +103,7 @@ export function useTable() {
ButtonLink,
{
onClick: () => {
let routeUrl = router.resolve({
const routeUrl = router.resolve({
name: 'workflow-instance-detail',
params: { id: row.processInstanceId },
query: { code: projectCode }
@ -127,9 +115,9 @@ export function useTable() {
default: () =>
h(
NEllipsis,
{
style: 'max-width: 580px;line-height: 1.5'
},
{
style: 'max-width: 580px;line-height: 1.5'
},
() => row.processInstanceName
)
}

2
dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-config.ts

@ -252,7 +252,7 @@ export const EDGE = {
router: {
name: 'er',
args: {
offset: 12,
offset: 12
}
},
defaultLabel: {

79
dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-context-menu.tsx

@ -63,7 +63,16 @@ const props = {
export default defineComponent({
name: 'dag-context-menu',
props,
emits: ['hide', 'start', 'edit', 'viewLog', 'copyTask', 'removeTasks', 'executeTask', 'removeTaskInstanceCache'],
emits: [
'hide',
'start',
'edit',
'viewLog',
'copyTask',
'removeTasks',
'executeTask',
'removeTaskInstanceCache'
],
setup(props, ctx) {
const graph = inject('graph', ref())
const route = useRoute()
@ -188,42 +197,42 @@ export default defineComponent({
</>
)}
{this.taskInstance && (
<>
<NButton
class={`${styles['menu-item']}`}
onClick={this.handleViewLog}
>
{t('project.node.view_log')}
</NButton>
<NButton
class={`${styles['menu-item']}`}
onClick={this.handleRemoveTaskInstanceCache}
>
{t('project.task.remove_task_cache')}
</NButton>
</>
<>
<NButton
class={`${styles['menu-item']}`}
onClick={this.handleViewLog}
>
{t('project.node.view_log')}
</NButton>
<NButton
class={`${styles['menu-item']}`}
onClick={this.handleRemoveTaskInstanceCache}
>
{t('project.task.remove_task_cache')}
</NButton>
</>
)}
{this.executeTaskDisplay && (
<>
<NButton
class={`${styles['menu-item']}`}
onClick={this.handleExecuteTaskOnly}
>
{t('project.workflow.current_node_execution_task')}
</NButton>
<NButton
class={`${styles['menu-item']}`}
onClick={this.handleExecuteTaskPOST}
>
{t('project.workflow.backward_execution_task')}
</NButton>
<NButton
class={`${styles['menu-item']}`}
onClick={this.handleExecuteTaskPRE}
>
{t('project.workflow.forward_execution_task')}
</NButton>
</>
<>
<NButton
class={`${styles['menu-item']}`}
onClick={this.handleExecuteTaskOnly}
>
{t('project.workflow.current_node_execution_task')}
</NButton>
<NButton
class={`${styles['menu-item']}`}
onClick={this.handleExecuteTaskPOST}
>
{t('project.workflow.backward_execution_task')}
</NButton>
<NButton
class={`${styles['menu-item']}`}
onClick={this.handleExecuteTaskPRE}
>
{t('project.workflow.forward_execution_task')}
</NButton>
</>
)}
</div>
)

51
dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-sidebar.tsx

@ -96,7 +96,7 @@ export default defineComponent({
handleDagMenu()
})
return () =>
return () => (
<div class={styles.sidebar}>
<NCollapse default-expanded-names='1' accordion>
{variables.fav.length > 0 && (
@ -139,11 +139,7 @@ export default defineComponent({
: '#ccc'
}
>
{task.collection ? (
<StarFilled />
) : (
<StarOutlined />
)}
{task.collection ? <StarFilled /> : <StarOutlined />}
</NIcon>
</div>
</div>
@ -192,11 +188,7 @@ export default defineComponent({
: '#ccc'
}
>
{task.collection ? (
<StarFilled />
) : (
<StarOutlined />
)}
{task.collection ? <StarFilled /> : <StarOutlined />}
</NIcon>
</div>
</div>
@ -245,11 +237,7 @@ export default defineComponent({
: '#ccc'
}
>
{task.collection ? (
<StarFilled />
) : (
<StarOutlined />
)}
{task.collection ? <StarFilled /> : <StarOutlined />}
</NIcon>
</div>
</div>
@ -298,11 +286,7 @@ export default defineComponent({
: '#ccc'
}
>
{task.collection ? (
<StarFilled />
) : (
<StarOutlined />
)}
{task.collection ? <StarFilled /> : <StarOutlined />}
</NIcon>
</div>
</div>
@ -351,11 +335,7 @@ export default defineComponent({
: '#ccc'
}
>
{task.collection ? (
<StarFilled />
) : (
<StarOutlined />
)}
{task.collection ? <StarFilled /> : <StarOutlined />}
</NIcon>
</div>
</div>
@ -404,11 +384,7 @@ export default defineComponent({
: '#ccc'
}
>
{task.collection ? (
<StarFilled />
) : (
<StarOutlined />
)}
{task.collection ? <StarFilled /> : <StarOutlined />}
</NIcon>
</div>
</div>
@ -457,11 +433,7 @@ export default defineComponent({
: '#ccc'
}
>
{task.collection ? (
<StarFilled />
) : (
<StarOutlined />
)}
{task.collection ? <StarFilled /> : <StarOutlined />}
</NIcon>
</div>
</div>
@ -510,11 +482,7 @@ export default defineComponent({
: '#ccc'
}
>
{task.collection ? (
<StarFilled />
) : (
<StarOutlined />
)}
{task.collection ? <StarFilled /> : <StarOutlined />}
</NIcon>
</div>
</div>
@ -525,5 +493,6 @@ export default defineComponent({
)}
</NCollapse>
</div>
)
}
})

58
dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-toolbar.tsx

@ -217,37 +217,33 @@ export default defineComponent({
)}
{props.definition?.processDefinition?.name && (
<NTooltip
v-slots={{
trigger: () => (
<NPopover
placement='bottom'
trigger='click'
scrollable
style={{ maxWidth: '50vw', maxHeight: '70vh' }}
>
{{
trigger: () => (
<NButton
quaternary
circle
class={Styles['toolbar-btn']}
>
<NIcon>
<FundViewOutlined />
</NIcon>
</NButton>
),
header: () => (
<NText strong depth={1}>
{t('project.workflow.parameters_variables')}
</NText>
),
default: () => <VariablesView onCopy={copy} />
}}
</NPopover>
),
default: () => t('project.dag.view_variables')
}}
v-slots={{
trigger: () => (
<NPopover
placement='bottom'
trigger='click'
scrollable
style={{ maxWidth: '50vw', maxHeight: '70vh' }}
>
{{
trigger: () => (
<NButton quaternary circle class={Styles['toolbar-btn']}>
<NIcon>
<FundViewOutlined />
</NIcon>
</NButton>
),
header: () => (
<NText strong depth={1}>
{t('project.workflow.parameters_variables')}
</NText>
),
default: () => <VariablesView onCopy={copy} />
}}
</NPopover>
),
default: () => t('project.dag.view_variables')
}}
></NTooltip>
)}
<div class={Styles['toolbar-left-part']}>

37
dolphinscheduler-ui/src/views/projects/workflow/components/dag/index.tsx

@ -139,9 +139,7 @@ export default defineComponent({
// execute task buttons in the dag node menu
const executeTaskDisplay = computed(() => {
return (
route.name === 'workflow-instance-detail'
)
return route.name === 'workflow-instance-detail'
})
// other button in the dag node menu
@ -250,7 +248,7 @@ export default defineComponent({
getLogs(logTimer)
}
var getLogsID: number
let getLogsID: number
const getLogs = (logTimer: number) => {
const { state } = useAsyncState(
@ -259,7 +257,6 @@ export default defineComponent({
limit: nodeVariables.limit,
skipLineNum: nodeVariables.skipLineNum
}).then((res: any) => {
nodeVariables.logRef += res.message || ''
if (res && res.message !== '') {
nodeVariables.limit += 1000
@ -292,18 +289,23 @@ export default defineComponent({
getLogs(logTimer)
}
const handleExecuteTask = (startNodeList: number, taskDependType: string) => {
executeTask({
processInstanceId: Number(route.params.id),
startNodeList: startNodeList,
taskDependType: taskDependType,
},
props.projectCode).then(() => {
window.$message.success(t('project.workflow.success'))
setTimeout(() => {
window.location.reload();
}, 1000);
})
const handleExecuteTask = (
startNodeList: number,
taskDependType: string
) => {
executeTask(
{
processInstanceId: Number(route.params.id),
startNodeList: startNodeList,
taskDependType: taskDependType
},
props.projectCode
).then(() => {
window.$message.success(t('project.workflow.success'))
setTimeout(() => {
window.location.reload()
}, 1000)
})
}
const handleRemoveTaskInstanceCache = (taskId: number) => {
@ -450,4 +452,3 @@ export default defineComponent({
)
}
})

16
dolphinscheduler-ui/src/views/projects/workflow/components/dag/use-canvas-init.ts

@ -108,10 +108,10 @@ export function useCanvasInit(options: Options) {
const { sourceCell, targetCell } = data
if (
sourceCell &&
targetCell &&
sourceCell.isNode() &&
targetCell.isNode()
sourceCell &&
targetCell &&
sourceCell.isNode() &&
targetCell.isNode()
) {
const sourceData = sourceCell.getData()
if (!sourceData) return true
@ -135,10 +135,10 @@ export function useCanvasInit(options: Options) {
edge?.setAttrs({
line: {
strokeDasharray:
sourceData.taskExecuteType === 'STREAM' ||
targetData.taskExecuteType === 'STREAM'
? '5 5'
: 'none'
sourceData.taskExecuteType === 'STREAM' ||
targetData.taskExecuteType === 'STREAM'
? '5 5'
: 'none'
}
})
return true

21
dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/dag-canvas.tsx

@ -62,7 +62,7 @@ const DagCanvas = defineComponent({
})
watch(dagTasks, () => {
useAddDagShape((graph.value as Graph))
useAddDagShape(graph.value as Graph)
})
return {
@ -74,16 +74,19 @@ const DagCanvas = defineComponent({
}
},
render() {
return(
return (
<>
<div ref='container' class={styles.container}
onDrop={this.handleDrop}
onDragenter={this.handlePreventDefault}
onDragover={this.handlePreventDefault}
onDragleave={this.handlePreventDefault}>
<div ref='dag-container' class={styles['dag-container']}/>
<div
ref='container'
class={styles.container}
onDrop={this.handleDrop}
onDragenter={this.handlePreventDefault}
onDragover={this.handlePreventDefault}
onDragleave={this.handlePreventDefault}
>
<div ref='dag-container' class={styles['dag-container']} />
</div>
<div ref='minimapContainer' class={styles.minimap}/>
<div ref='minimapContainer' class={styles.minimap} />
</>
)
}

20
dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/dag-sidebar.tsx

@ -41,15 +41,17 @@ const DagSidebar = defineComponent({
render() {
return (
<div>
{
this.taskList.map((task: any) => {
return (
<div class={styles['task-item']} draggable='true' onDragstart={() => this.handleDragstart(task)}>
{task.name}
</div>
)
})
}
{this.taskList.map((task: any) => {
return (
<div
class={styles['task-item']}
draggable='true'
onDragstart={() => this.handleDragstart(task)}
>
{task.name}
</div>
)
})}
</div>
)
}

16
dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/index.tsx

@ -40,7 +40,7 @@ const DynamicDag = defineComponent({
}
const handelDrop = (e: DragEvent) => {
if (!draggedTask) return
if (!draggedTask.value) return
const shapes = useDagStore().getDagTasks
@ -73,18 +73,18 @@ const DynamicDag = defineComponent({
return (
<>
<div class={styles['workflow-dag']}>
<DagSidebar onDragstart={this.handelDragstart}/>
<DagCanvas onDrop={this.handelDrop}/>
<DagSidebar onDragstart={this.handelDragstart} />
<DagCanvas onDrop={this.handelDrop} />
</div>
{
this.draggedTask && this.formData && <TaskForm
{this.draggedTask && this.formData && (
<TaskForm
task={this.draggedTask}
formData={this.formData}
showModal={this.showModal}
onCancelModal={() => this.showModal = false}
onConfirmModal={() => this.showModal = false}
onCancelModal={() => (this.showModal = false)}
onConfirmModal={() => (this.showModal = false)}
/>
}
)}
</>
)
}

79
dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/task/index.tsx

@ -15,7 +15,13 @@
* limitations under the License.
*/
import { defineComponent, getCurrentInstance, PropType, toRefs, watch } from 'vue'
import {
defineComponent,
getCurrentInstance,
PropType,
toRefs,
watch
} from 'vue'
import { NForm, NFormItem, NInput, NSelect } from 'naive-ui'
import { useTaskForm } from './use-task-form'
import { useI18n } from 'vue-i18n'
@ -55,15 +61,19 @@ const TaskForm = defineComponent({
}
const onUpdateValue = (v: any, f: any) => {
f.modelField.indexOf('.') >= 0 ?
(variables.model as any)[f.modelField.split('.')[0]][f.modelField.split('.')[1]] = v :
(variables.model as any)[f.modelField] = v
f.modelField.indexOf('.') >= 0
? ((variables.model as any)[f.modelField.split('.')[0]][
f.modelField.split('.')[1]
] = v)
: ((variables.model as any)[f.modelField] = v)
}
const setDefaultValue = (f: any) => {
return f.modelField.indexOf('.') >= 0 ?
(variables.model as any)[f.modelField.split('.')[0]][f.modelField.split('.')[1]] :
(variables.model as any)[f.modelField]
return f.modelField.indexOf('.') >= 0
? (variables.model as any)[f.modelField.split('.')[0]][
f.modelField.split('.')[1]
]
: (variables.model as any)[f.modelField]
}
watch(variables.model, () => {
@ -86,52 +96,47 @@ const TaskForm = defineComponent({
title={this.task}
show={this.showModal}
onCancel={this.cancelModal}
onConfirm={this.confirmModal}>
<NForm
model={this.model}
rules={this.rules}
ref={'taskForm'}>
{
(this.formStructure as Array<any>).map(f => {
return <NFormItem
label={this.t(f.label)}
path={f.field}
>
{
f.type === 'input' && <NInput
onConfirm={this.confirmModal}
>
<NForm model={this.model} rules={this.rules} ref={'taskForm'}>
{(this.formStructure as Array<any>).map((f) => {
return (
<NFormItem label={this.t(f.label)} path={f.field}>
{f.type === 'input' && (
<NInput
allowInput={this.trim}
placeholder={f.placeholder ? this.t(f.placeholder) : ''}
defaultValue={this.setDefaultValue(f)}
onUpdateValue={(v) => this.onUpdateValue(v, f)}
clearable={f.clearable}
/>
}
{
f.type === 'select' && <NSelect
)}
{f.type === 'select' && (
<NSelect
placeholder={f.placeholder ? this.t(f.placeholder) : ''}
defaultValue={this.setDefaultValue(f)}
onUpdateValue={(v) => this.onUpdateValue(v, f)}
options={
f.optionsLocale ?
f.options.map((o: SelectOption) => {
return {
label: this.t(o.label as string),
value: o.value
}
}) :
f.options
f.optionsLocale
? f.options.map((o: SelectOption) => {
return {
label: this.t(o.label as string),
value: o.value
}
})
: f.options
}
/>
}
{
f.type === 'studio' && <MonacoEditor
)}
{f.type === 'studio' && (
<MonacoEditor
defaultValue={this.setDefaultValue(f)}
onUpdateValue={(v) => this.onUpdateValue(v, f)}
/>
}
)}
</NFormItem>
})
}
)
})}
</NForm>
</Modal>
)

7
dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/task/use-form-field.ts

@ -22,12 +22,7 @@ export function useFormField(forms: Array<any>) {
const model: any = {}
const setField = (value: string, type: string): Ref<null | string> => {
return ref(value ?
value :
type === 'select' ?
null :
''
)
return ref(value ? value : type === 'select' ? null : '')
}
forms.forEach((f: any) => {

2
dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/task/use-form-request.ts

@ -25,7 +25,7 @@ const reqFunction = (url: string, method: string) => {
}
export function useFormRequest(apis: any, forms: Array<any>): Array<any> {
forms.map(f => {
forms.map((f) => {
if (f.api) {
reqFunction(apis[f.api].url, apis[f.api].method).then((res: any) => {
f.options = res.map((r: any) => {

4
dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/task/use-task-form.ts

@ -33,7 +33,9 @@ export function useTaskForm(data: any) {
useDynamicLocales(data.locales)
variables.model = useFormField(data.forms)
variables.rules = useFormValidate(data.forms, variables.model)
variables.formStructure = useFormStructure(useFormRequest(data.apis, data.forms))
variables.formStructure = useFormStructure(
useFormRequest(data.apis, data.forms)
)
const handleValidate = () => {
variables.taskForm.validate((err: any) => {

5
dolphinscheduler-ui/src/views/projects/workflow/components/dynamic-dag/use-sidebar.ts

@ -16,7 +16,10 @@
*/
import { reactive } from 'vue'
import { queryDynamicTaskCategories, queryDynamicTaskResourceList } from '@/service/modules/dynamic-dag'
import {
queryDynamicTaskCategories,
queryDynamicTaskResourceList
} from '@/service/modules/dynamic-dag'
export function useSidebar() {
const variables = reactive({

2
dolphinscheduler-ui/src/views/projects/workflow/definition/components/use-modal.ts

@ -87,7 +87,7 @@ export function useModal(
}
}
const handleStartDefinition = async (code: number,version: number) => {
const handleStartDefinition = async (code: number, version: number) => {
await state.startFormRef.validate()
if (state.saving) return

8
dolphinscheduler-ui/src/views/projects/workflow/definition/create/index.tsx

@ -88,9 +88,11 @@ export default defineComponent({
theme.darkTheme ? Styles['dark'] : Styles['light']
]}
>
{
route.query.dynamic === 'true' ? <DynamicDag /> : <Dag projectCode={projectCode} onSave={onSave} />
}
{route.query.dynamic === 'true' ? (
<DynamicDag />
) : (
<Dag projectCode={projectCode} onSave={onSave} />
)}
</div>
)
}

10
dolphinscheduler-ui/src/views/projects/workflow/definition/index.tsx

@ -43,7 +43,7 @@ import TimingModal from './components/timing-modal'
import VersionModal from './components/version-modal'
import CopyModal from './components/copy-modal'
import type { Router } from 'vue-router'
import Search from "@/components/input-search";
import Search from '@/components/input-search'
export default defineComponent({
name: 'WorkflowDefinitionList',
@ -158,15 +158,15 @@ export default defineComponent({
>
{t('project.workflow.create_workflow')}
</NButton>
{
this.uiSettingStore.getDynamicTask && <NButton
{this.uiSettingStore.getDynamicTask && (
<NButton
type='warning'
size='small'
onClick={this.createDefinitionDynamic}
>
{t('project.workflow.create_workflow_dynamic')}
</NButton>
}
)}
<NButton
strong
secondary
@ -178,7 +178,7 @@ export default defineComponent({
</NSpace>
<NSpace>
<Search
placeholder = {t('resource.function.enter_keyword_tips')}
placeholder={t('resource.function.enter_keyword_tips')}
v-model:value={this.searchVal}
onSearch={this.handleSearch}
onClear={this.onClearSearch}

4
dolphinscheduler-ui/src/views/projects/workflow/definition/timing/index.tsx

@ -34,7 +34,9 @@ export default defineComponent({
getTableData({
pageSize: variables.pageSize,
pageNo: variables.page,
searchVal: variables.searchVal
searchVal: variables.searchVal,
projectCode: variables.projectCode,
processDefinitionCode: variables.processDefinitionCode
})
}

2
dolphinscheduler-ui/src/views/projects/workflow/definition/timing/types.ts

@ -18,5 +18,7 @@
export interface ISearchParam {
pageSize: number
pageNo: number
projectCode: number
processDefinitionCode: number
searchVal: string | undefined
}

59
dolphinscheduler-ui/src/views/projects/workflow/definition/timing/use-table.ts

@ -18,7 +18,7 @@
import { h, ref, reactive } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router'
import { NSpace, NTooltip, NButton, NPopconfirm } from 'naive-ui'
import { NSpace, NTooltip, NButton, NPopconfirm, NTag } from 'naive-ui'
import {
deleteScheduleById,
offline,
@ -55,7 +55,10 @@ export function useTable() {
searchVal: ref(),
totalPage: ref(1),
showRef: ref(false),
loadingRef: ref(false)
loadingRef: ref(false),
processDefinitionCode: router.currentRoute.value.params.definitionCode
? ref(Number(router.currentRoute.value.params.definitionCode))
: ref()
})
const renderTime = (time: string, timeZone: string) => {
@ -118,10 +121,25 @@ export function useTable() {
title: t('project.workflow.status'),
key: 'releaseState',
...COLUMN_WIDTH_CONFIG['state'],
render: (row: any) =>
row.releaseState === 'ONLINE'
? t('project.workflow.up_line')
: t('project.workflow.down_line')
render: (row: any) => {
if (row.releaseState === 'ONLINE') {
return h(
NTag,
{ type: 'success', size: 'small' },
{
default: () => t('project.workflow.up_line')
}
)
} else {
return h(
NTag,
{ type: 'warning', size: 'small' },
{
default: () => t('project.workflow.down_line')
}
)
}
}
},
{
title: t('project.workflow.worker_group'),
@ -258,19 +276,16 @@ export function useTable() {
const getTableData = (params: ISearchParam) => {
if (variables.loadingRef) return
variables.loadingRef = true
const definitionCode = Number(
router.currentRoute.value.params.definitionCode
queryScheduleListPaging({ ...params }, variables.projectCode).then(
(res: any) => {
variables.totalPage = res.totalPage
variables.tableData = res.totalList.map((item: any) => {
return { ...item }
})
variables.loadingRef = false
}
)
queryScheduleListPaging(
{ ...params, processDefinitionCode: definitionCode },
variables.projectCode
).then((res: any) => {
variables.totalPage = res.totalPage
variables.tableData = res.totalList.map((item: any) => {
return { ...item }
})
variables.loadingRef = false
})
}
const handleReleaseState = (row: any) => {
@ -284,7 +299,9 @@ export function useTable() {
getTableData({
pageSize: variables.pageSize,
pageNo: variables.page,
searchVal: variables.searchVal
searchVal: variables.searchVal,
projectCode: variables.projectCode,
processDefinitionCode: variables.processDefinitionCode
})
})
}
@ -299,7 +316,9 @@ export function useTable() {
getTableData({
pageSize: variables.pageSize,
pageNo: variables.page,
searchVal: variables.searchVal
searchVal: variables.searchVal,
projectCode: variables.projectCode,
processDefinitionCode: variables.processDefinitionCode
})
})
}

2
dolphinscheduler-ui/src/views/projects/workflow/definition/use-table.ts

@ -103,7 +103,7 @@ export function useTable() {
ButtonLink,
{
onClick: () => {
let routeUrl = router.resolve({
const routeUrl = router.resolve({
name: 'workflow-definition-detail',
params: { code: row.code }
})

19
dolphinscheduler-ui/src/views/projects/workflow/instance/components/variables-view.tsx

@ -19,11 +19,10 @@ import { useRoute } from 'vue-router'
import { defineComponent, onMounted, ref, computed } from 'vue'
import { useI18n } from 'vue-i18n'
import { viewVariables } from '@/service/modules/process-instances'
import { viewProcessDefinitionVariables } from "@/service/modules/process-definition";
import { viewProcessDefinitionVariables } from '@/service/modules/process-definition'
import styles from './variables.module.scss'
import { NButton } from 'naive-ui'
export default defineComponent({
name: 'variables-view',
emits: ['copy'],
@ -38,18 +37,24 @@ export default defineComponent({
const processCode = Number(route.params.code)
const globalParams = computed(() => {
return paramsRef.value && paramsRef.value.globalParams ? paramsRef.value.globalParams : []
return paramsRef.value && paramsRef.value.globalParams
? paramsRef.value.globalParams
: []
})
const localParams = computed(() => {
return paramsRef.value && paramsRef.value.localParams ? paramsRef.value.localParams : {}
return paramsRef.value && paramsRef.value.localParams
? paramsRef.value.localParams
: {}
})
const getViewVariables = () => {
if (Number.isNaN(instanceId)) {
viewProcessDefinitionVariables(projectCode, processCode).then((res: any) => {
paramsRef.value = res
})
viewProcessDefinitionVariables(projectCode, processCode).then(
(res: any) => {
paramsRef.value = res
}
)
} else {
viewVariables(instanceId, projectCode).then((res: any) => {
paramsRef.value = res

2
dolphinscheduler-ui/src/views/projects/workflow/instance/use-table.ts

@ -98,7 +98,7 @@ export function useTable() {
ButtonLink,
{
onClick: () => {
let routeUrl = router.resolve({
const routeUrl = router.resolve({
name: 'workflow-instance-detail',
params: { id: row.id },
query: { code: row.processDefinitionCode }

17
dolphinscheduler-ui/src/views/projects/workflow/relation/index.tsx

@ -18,7 +18,14 @@
import { defineComponent, onMounted, toRefs, watch, VNode, h } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRoute } from 'vue-router'
import { NSelect, NButton, NIcon, NSpace, NTooltip, SelectOption } from 'naive-ui'
import {
NSelect,
NButton,
NIcon,
NSpace,
NTooltip,
SelectOption
} from 'naive-ui'
import { ReloadOutlined, EyeOutlined } from '@vicons/antd'
import { useRelation } from './use-relation'
import Card from '@/components/card'
@ -48,7 +55,13 @@ const workflowRelation = defineComponent({
: getWorkflowList(Number(route.params.projectCode))
}
const renderOption = ({ node, option }: { node: VNode; option: SelectOption }) =>
const renderOption = ({
node,
option
}: {
node: VNode
option: SelectOption
}) =>
h(NTooltip, null, {
trigger: () => node,
default: () => option.label

87
dolphinscheduler-ui/src/views/projects/workflow/timing/components/timing-condition.tsx

@ -0,0 +1,87 @@
/*
* 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 { SearchOutlined } from '@vicons/antd'
import { NButton, NSelect, NIcon, NSpace, NEllipsis } from 'naive-ui'
import { defineComponent, h, ref } from 'vue'
import { queryProcessDefinitionList } from '@/service/modules/process-definition'
import { SelectMixedOption } from 'naive-ui/lib/select/src/interface'
import { Router, useRouter } from 'vue-router'
export default defineComponent({
name: 'TimingCondition',
emits: ['handleSearch'],
setup(props, ctx) {
const router: Router = useRouter()
const projectCode = ref(
Number(router.currentRoute.value.params.projectCode)
)
const processDefineCodeRef = router.currentRoute.value.query
.processDefineCode
? ref(Number(router.currentRoute.value.query.processDefineCode))
: ref()
const processDefinitionOptions = ref<Array<SelectMixedOption>>([])
const initProcessList = (code: number) => {
queryProcessDefinitionList(code).then((result: any) => {
result.map((item: { code: number; name: string }) => {
const option: SelectMixedOption = {
value: item.code,
label: () => h(NEllipsis, null, item.name),
filterLabel: item.name
}
processDefinitionOptions.value.push(option)
})
})
}
initProcessList(projectCode.value)
const handleSearch = () => {
ctx.emit('handleSearch', {
processDefinitionCode: processDefineCodeRef.value
})
}
return {
handleSearch,
processDefinitionOptions,
processDefineCodeRef
}
},
render() {
return (
<NSpace justify='end'>
<NSelect
clearable
filterable
options={this.processDefinitionOptions}
size='small'
style={{ width: '310px' }}
v-model:value={this.processDefineCodeRef}
/>
<NButton type='primary' size='small' onClick={this.handleSearch}>
<NIcon>
<SearchOutlined />
</NIcon>
</NButton>
</NSpace>
)
}
})

116
dolphinscheduler-ui/src/views/projects/workflow/timing/index.tsx

@ -0,0 +1,116 @@
/*
* 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 { NDataTable, NPagination, NSpace } from 'naive-ui'
import { defineComponent, onMounted, toRefs, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { useTable } from '../definition/timing/use-table'
import Card from '@/components/card'
import TimingModal from '../definition/components/timing-modal'
import TimingCondition from '@/views/projects/workflow/timing/components/timing-condition'
import { ITimingSearch } from '@/views/projects/workflow/timing/types'
export default defineComponent({
name: 'WorkflowTimingList',
setup() {
const { variables, createColumns, getTableData } = useTable()
const requestData = () => {
getTableData({
pageSize: variables.pageSize,
pageNo: variables.page,
searchVal: variables.searchVal,
projectCode: variables.projectCode,
processDefinitionCode: variables.processDefinitionCode
})
}
const handleUpdateList = () => {
requestData()
}
const handleSearch = (params: ITimingSearch) => {
variables.processDefinitionCode = params.processDefinitionCode
variables.page = 1
requestData()
}
const handleChangePageSize = () => {
variables.page = 1
requestData()
}
onMounted(() => {
createColumns(variables)
requestData()
})
watch(useI18n().locale, () => {
createColumns(variables)
})
return {
requestData,
handleSearch,
handleUpdateList,
handleChangePageSize,
...toRefs(variables)
}
},
render() {
const { t } = useI18n()
const { loadingRef } = this
return (
<NSpace vertical>
<Card>
<TimingCondition onHandleSearch={this.handleSearch} />
</Card>
<Card title={t('project.workflow.cron_manage')}>
<NSpace vertical>
<NDataTable
loading={loadingRef}
columns={this.columns}
data={this.tableData}
striped
size={'small'}
scrollX={this.tableWidth}
/>
<NSpace justify='center'>
<NPagination
v-model:page={this.page}
v-model:page-size={this.pageSize}
page-count={this.totalPage}
show-size-picker
page-sizes={[10, 30, 50]}
show-quick-jumper
onUpdatePage={this.requestData}
onUpdatePageSize={this.handleChangePageSize}
/>
</NSpace>
</NSpace>
</Card>
<TimingModal
type={'update'}
v-model:row={this.row}
v-model:show={this.showRef}
onUpdateList={this.handleUpdateList}
/>
</NSpace>
)
}
})

22
dolphinscheduler-ui/src/views/projects/workflow/timing/types.ts

@ -0,0 +1,22 @@
/*
* 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 ITimingSearch {
processDefinitionCode: number
}
export { ITimingSearch }

2
dolphinscheduler-ui/src/views/resource/components/resource/create/use-form.ts

@ -18,7 +18,7 @@
import { useI18n } from 'vue-i18n'
import { reactive, ref, unref } from 'vue'
import type { FormRules } from 'naive-ui'
import { ICreateFileDefaultValue } from "@/views/resource/components/resource/types";
import { ICreateFileDefaultValue } from '@/views/resource/components/resource/types'
const defaultValue: ICreateFileDefaultValue = () => ({
pid: -1,

4
dolphinscheduler-ui/src/views/resource/components/resource/edit/index.tsx

@ -33,8 +33,8 @@ export default defineComponent({
const componentName = route.name
// fullname is now the id of resources
const fullName = String(router.currentRoute.value.query.prefix || "")
const tenantCode = String(router.currentRoute.value.query.tenantCode || "")
const fullName = String(router.currentRoute.value.query.prefix || '')
const tenantCode = String(router.currentRoute.value.query.tenantCode || '')
const { state } = useForm()
const { getResourceView, handleUpdateContent } = useEdit(state)

17
dolphinscheduler-ui/src/views/resource/components/resource/edit/use-edit.ts

@ -19,7 +19,10 @@ import { useI18n } from 'vue-i18n'
import type { Router } from 'vue-router'
import { useRouter } from 'vue-router'
import { useAsyncState } from '@vueuse/core'
import { updateResourceContent, viewResource } from '@/service/modules/resources'
import {
updateResourceContent,
viewResource
} from '@/service/modules/resources'
export function useEdit(state: any) {
const { t } = useI18n()
@ -41,13 +44,11 @@ export function useEdit(state: any) {
const handleUpdateContent = (fullName: string, tenantCode: string) => {
state.fileFormRef.validate(async (valid: any) => {
if (!valid) {
await updateResourceContent(
{
...state.fileForm,
tenantCode: tenantCode,
fullName: fullName,
},
)
await updateResourceContent({
...state.fileForm,
tenantCode: tenantCode,
fullName: fullName
})
window.$message.success(t('resource.file.success'))
router.go(-1)

2
dolphinscheduler-ui/src/views/resource/components/resource/folder/index.tsx

@ -22,7 +22,7 @@ import Modal from '@/components/modal'
import { noSpace } from '@/utils/trim'
import { useForm } from './use-form'
import { useFolder } from './use-folder'
import { ResourceType } from "@/views/resource/components/resource/types";
import { ResourceType } from '@/views/resource/components/resource/types'
const props = {
show: {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save