From c07339b07dea2182bf6a3ba1ff0bcc1fe1f4af55 Mon Sep 17 00:00:00 2001 From: songjianet <1778651752@qq.com> Date: Fri, 20 May 2022 15:19:43 +0800 Subject: [PATCH] [Fix][UI] Limit task group resource capacity to only positive integers. (#10158) --- dolphinscheduler-ui/src/locales/modules/en_US.ts | 3 +-- dolphinscheduler-ui/src/locales/modules/zh_CN.ts | 2 +- .../resource/task-group/option/components/form-modal.tsx | 6 ++++-- .../src/views/resource/task-group/option/use-form.ts | 6 ++++++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/dolphinscheduler-ui/src/locales/modules/en_US.ts b/dolphinscheduler-ui/src/locales/modules/en_US.ts index d095723900..60d1f02d69 100644 --- a/dolphinscheduler-ui/src/locales/modules/en_US.ts +++ b/dolphinscheduler-ui/src/locales/modules/en_US.ts @@ -308,8 +308,6 @@ const resource = { name: 'Task group name', project_name: 'Project name', resource_pool_size: 'Resource pool size', - resource_pool_size_be_a_number: - 'The size of the task group resource pool should be more than 1', resource_used_pool_size: 'Used resource', desc: 'Task group desc', status: 'Task group status', @@ -319,6 +317,7 @@ const resource = { please_enter_desc: 'Please enter task group description', please_enter_resource_pool_size: 'Please enter task group resource pool size', + positive_integer_tips: 'should be a positive integer', please_select_project: 'Please select a project', create_time: 'Create time', update_time: 'Update time', diff --git a/dolphinscheduler-ui/src/locales/modules/zh_CN.ts b/dolphinscheduler-ui/src/locales/modules/zh_CN.ts index e0ce9dcc12..33a0c2a7d6 100644 --- a/dolphinscheduler-ui/src/locales/modules/zh_CN.ts +++ b/dolphinscheduler-ui/src/locales/modules/zh_CN.ts @@ -314,7 +314,7 @@ const resource = { please_enter_name: '请输入任务组名称', please_enter_desc: '请输入任务组描述', please_enter_resource_pool_size: '请输入资源容量大小', - resource_pool_size_be_a_number: '资源容量大小必须大于等于1的数值', + positive_integer_tips: '应为正整数', please_select_project: '请选择项目', create_time: '创建时间', update_time: '更新时间', diff --git a/dolphinscheduler-ui/src/views/resource/task-group/option/components/form-modal.tsx b/dolphinscheduler-ui/src/views/resource/task-group/option/components/form-modal.tsx index 47be759f58..259d0a361e 100644 --- a/dolphinscheduler-ui/src/views/resource/task-group/option/components/form-modal.tsx +++ b/dolphinscheduler-ui/src/views/resource/task-group/option/components/form-modal.tsx @@ -16,7 +16,7 @@ */ import { defineComponent, PropType, toRefs, onMounted, ref, Ref } from 'vue' -import { NForm, NFormItem, NInput, NSelect } from 'naive-ui' +import { NForm, NFormItem, NInput, NSelect, NInputNumber } from 'naive-ui' import { useForm } from '../use-form' import Modal from '@/components/modal' import { createTaskGroup, updateTaskGroup } from '@/service/modules/task-group' @@ -133,8 +133,10 @@ const FormModal = defineComponent({ label={t('resource.task_group_option.resource_pool_size')} path='groupSize' > -