From 24ddd4f7076256342cab1509afd3487cd4e423d9 Mon Sep 17 00:00:00 2001 From: Shiwen Cheng Date: Fri, 5 Feb 2021 11:52:11 +0800 Subject: [PATCH] [Improvement][UI] Improve parameter (#4673) --- .../dag/_source/formModel/tasks/flink.vue | 38 +++++---- .../pages/dag/_source/formModel/tasks/mr.vue | 16 ++-- .../dag/_source/formModel/tasks/spark.vue | 78 +++++++++++-------- .../src/js/module/i18n/locale/en_US.js | 34 ++++---- .../src/js/module/i18n/locale/zh_CN.js | 44 +++++------ 5 files changed, 118 insertions(+), 92 deletions(-) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue index 1fe8ca9137..d0dfdf6d97 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue @@ -35,7 +35,7 @@ -
{{$t('Main class')}}
+
{{$t('Main Class')}}
-
{{$t('Main jar package')}}
+
{{$t('Main Jar Package')}}
{{ node.raw.fullName }}
@@ -137,7 +137,7 @@
-
{{$t('Command-line parameters')}}
+
{{$t('Main Arguments')}}
+ :placeholder="$t('Please enter main arguments')">
-
{{$t('Other parameters')}}
+
{{$t('Option Parameters')}}
+ :placeholder="$t('Please enter option parameters')">
@@ -213,19 +213,19 @@ cacheResourceList: [], // Custom function localParams: [], - // Driver Number of cores + // Slot number slot: 1, - // Driver Number of memory + // TaskManager mumber taskManager: '2', - // jobManager Memory + // JobManager memory jobManagerMemory: '1G', - // taskManager Memory + // TaskManager memory taskManagerMemory: '2G', - // Flink Job Name + // Flink app name appName: '', - // Command line argument + // Main arguments mainArgs: '', - // Other parameters + // Option parameters others: '', // Program type programType: 'SCALA', @@ -310,11 +310,21 @@ return false } - if (!_.isNumber(parseInt(this.taskManagerMemory))) { + if (!Number.isInteger(parseInt(this.taskManagerMemory))) { this.$message.warning(`${i18n.$t('Memory should be a positive integer')}`) return false } + if (!Number.isInteger(parseInt(this.slot))) { + this.$message.warning(`${i18n.$t('Please enter Slot number')}`) + return false + } + + if (this.flinkVersion === '<1.10' && !Number.isInteger(parseInt(this.taskManager))) { + this.$message.warning(`${i18n.$t('Please enter TaskManager number')}`) + return false + } + // noRes if (this.noRes.length > 0) { this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue index 356eefd65a..adef5989e0 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue @@ -30,7 +30,7 @@
-
{{$t('Main class')}}
+
{{$t('Main Class')}}
-
{{$t('Main jar package')}}
+
{{$t('Main Jar Package')}}
{{ node.raw.fullName }}
@@ -50,7 +50,7 @@
-
{{$t('Command-line parameters')}}
+
{{$t('Main Arguments')}}
+ :placeholder="$t('Please enter main arguments')">
-
{{$t('Other parameters')}}
+
{{$t('Option Parameters')}}
+ :placeholder="$t('Please enter option parameters')">
@@ -122,9 +122,9 @@ cacheResourceList: [], // Custom parameter localParams: [], - // Command line argument + // Main arguments mainArgs: '', - // Other parameters + // Option parameters others: '', // Program type programType: 'JAVA', diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue index efeb7e9e36..a2192399a5 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue @@ -51,7 +51,7 @@
-
{{$t('Main class')}}
+
{{$t('Main Class')}}
-
{{$t('Main jar package')}}
+
{{$t('Main Jar Package')}}
{{ node.raw.fullName }}
@@ -81,7 +81,7 @@
-
{{$t('Driver cores')}}
+
{{$t('Driver Cores')}}
-
{{$t('Driver memory')}}
+
{{$t('Driver Memory')}}
-
{{$t('Executor memory')}}
+
{{$t('Executor Memory')}}
-
{{$t('Executor cores')}}
+
{{$t('Executor Cores')}}
-
{{$t('Command-line parameters')}}
+
{{$t('Main Arguments')}}
+ :placeholder="$t('Please enter main arguments')">
-
{{$t('Other parameters')}}
+
{{$t('Option Parameters')}}
+ :placeholder="$t('Please enter option parameters')">
@@ -213,19 +213,19 @@ cacheResourceList: [], // Custom function localParams: [], - // Driver Number of cores + // Driver cores driverCores: 1, - // Driver Number of memory + // Driver memory driverMemory: '512M', - // Executor Number + // Executor number numExecutors: 2, - // Executor Number of memory + // Executor memory executorMemory: '2G', - // Executor Number of cores + // Executor cores executorCores: 2, - // Command line argument + // Main arguments mainArgs: '', - // Other parameters + // Option parameters others: '', // Program type programType: 'SCALA', @@ -367,24 +367,33 @@ return false } - if (!this.numExecutors) { - this.$message.warning(`${i18n.$t('Please enter Executor number')}`) + if (!this.driverCores) { + this.$message.warning(`${i18n.$t('Please enter Driver cores')}`) return false } - // noRes - if (this.noRes.length > 0) { - this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`) + if (!Number.isInteger(parseInt(this.driverCores))) { + this.$message.warning(`${i18n.$t('Core number should be positive integer')}`) return false } - if (!Number.isInteger(parseInt(this.numExecutors))) { - this.$message.warning(`${i18n.$t('The Executor Number should be a positive integer')}`) + if (!this.driverMemory) { + this.$message.warning(`${i18n.$t('Please enter Driver memory')}`) return false } - if (!this.executorMemory) { - this.$message.warning(`${i18n.$t('Please enter Executor memory')}`) + if (!Number.isInteger(parseInt(this.driverMemory))) { + this.$message.warning(`${i18n.$t('Memory should be a positive integer')}`) + return false + } + + if (!this.executorCores) { + this.$message.warning(`${i18n.$t('Please enter Executor cores')}`) + return false + } + + if (!Number.isInteger(parseInt(this.executorCores))) { + this.$message.warning(`${i18n.$t('Core number should be positive integer')}`) return false } @@ -393,20 +402,27 @@ return false } - if (!_.isNumber(parseInt(this.executorMemory))) { + if (!Number.isInteger(parseInt(this.executorMemory))) { this.$message.warning(`${i18n.$t('Memory should be a positive integer')}`) return false } - if (!this.executorCores) { - this.$message.warning(`${i18n.$t('Please enter Executor cores')}`) + if (!this.numExecutors) { + this.$message.warning(`${i18n.$t('Please enter Executor number')}`) return false } - if (!Number.isInteger(parseInt(this.executorCores))) { - this.$message.warning(`${i18n.$t('Core number should be positive integer')}`) + if (!Number.isInteger(parseInt(this.numExecutors))) { + this.$message.warning(`${i18n.$t('The Executor number should be a positive integer')}`) + return false + } + + // noRes + if (this.noRes.length > 0) { + this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`) return false } + // localParams Subcomponent verification if (!this.$refs.refLocalParams._verifProp()) { return false diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js index cb330e9fd8..adbcfda238 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js @@ -86,14 +86,14 @@ export default { 'Please choose': 'Please choose', 'Please enter a positive integer': 'Please enter a positive integer', 'Program Type': 'Program Type', - 'Main class': 'Main class', - 'Main jar package': 'Main jar package', + 'Main Class': 'Main Class', + 'Main Jar Package': 'Main Jar Package', 'Please enter main jar package': 'Please enter main jar package', 'Please enter main class': 'Please enter main class', - 'Command-line parameters': 'Command-line parameters', - 'Please enter Command-line parameters': 'Please enter Command-line parameters', - 'Other parameters': 'Other parameters', - 'Please enter other parameters': 'Please enter other parameters', + 'Main Arguments': 'Main Arguments', + 'Please enter main arguments': 'Please enter main arguments', + 'Option Parameters': 'Option Parameters', + 'Please enter option parameters': 'Please enter option parameters', Resources: 'Resources', 'Custom Parameters': 'Custom Parameters', 'Custom template': 'Custom template', @@ -103,23 +103,29 @@ export default { Script: 'Script', 'Please enter script(required)': 'Please enter script(required)', 'Deploy Mode': 'Deploy Mode', - 'Driver cores': 'Driver cores', + 'Driver Cores': 'Driver Cores', 'Please enter Driver cores': 'Please enter Driver cores', - 'Driver memory': 'Driver memory', + 'Driver Memory': 'Driver Memory', 'Please enter Driver memory': 'Please enter Driver memory', 'Executor Number': 'Executor Number', 'Please enter Executor number': 'Please enter Executor number', - 'Executor memory': 'Executor memory', + 'The Executor number should be a positive integer': 'The Executor number should be a positive integer', + 'Executor Memory': 'Executor Memory', 'Please enter Executor memory': 'Please enter Executor memory', - 'Executor cores': 'Executor cores', + 'Executor Cores': 'Executor Cores', 'Please enter Executor cores': 'Please enter Executor cores', - 'The Executor Number should be a positive integer': 'The Executor Number should be a positive integer', 'Memory should be a positive integer': 'Memory should be a positive integer', 'Core number should be positive integer': 'Core number should be positive integer', + 'Flink Version': 'Flink Version', + 'JobManager Memory': 'JobManager Memory', 'Please enter JobManager memory': 'Please enter JobManager memory', + 'TaskManager Memory': 'TaskManager Memory', 'Please enter TaskManager memory': 'Please enter TaskManager memory', + 'Slot Number': 'Slot Number', 'Please enter Slot number': 'Please enter Slot number', + 'TaskManager Number': 'TaskManager Number', 'Please enter TaskManager number': 'Please enter TaskManager number', + 'App Name': 'App Name', 'Please enter app name(optional)': 'Please enter app name(optional)', 'SQL Type': 'SQL Type', Title: 'Title', @@ -543,12 +549,6 @@ export default { 'Next five execution times': 'Next five execution times', 'Execute time': 'Execute time', 'Complement range': 'Complement range', - 'Flink Version': 'Flink Version', - 'Slot Number': 'Slot Number', - 'TaskManager Number': 'TaskManager Number', - 'JobManager Memory': 'JobManager Memory', - 'TaskManager Memory': 'TaskManager Memory', - 'App Name': 'App Name', 'Http Url': 'Http Url', 'Http Method': 'Http Method', 'Http Parameters': 'Http Parameters', diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js index d957a6a0cc..440f38c0ff 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js @@ -86,14 +86,14 @@ export default { 'Please choose': '请选择', 'Please enter a positive integer': '请输入正整数', 'Program Type': '程序类型', - 'Main class': '主函数的class', - 'Main jar package': '主jar包', - 'Please enter main jar package': '请选择主jar包', - 'Please enter main class': '请填写主函数的class', - 'Command-line parameters': '命令行参数', - 'Please enter Command-line parameters': '请输入命令行参数', - 'Other parameters': '其他参数', - 'Please enter other parameters': '请输入其他参数', + 'Main Class': '主函数的Class', + 'Main Jar Package': '主Jar包', + 'Please enter main jar package': '请选择主Jar包', + 'Please enter main class': '请填写主函数的Class', + 'Main Arguments': '主程序参数', + 'Please enter main arguments': '请输入主程序参数', + 'Option Parameters': '选项参数', + 'Please enter option parameters': '请输入选项参数', Resources: '资源', 'Custom Parameters': '自定义参数', 'Custom template': '自定义模版', @@ -103,23 +103,29 @@ export default { Script: '脚本', 'Please enter script(required)': '请输入脚本(必填)', 'Deploy Mode': '部署方式', - 'Driver cores': 'Driver内核数', - 'Please enter Driver cores': '请输入Driver内核数', - 'Driver memory': 'Driver内存数', + 'Driver Cores': 'Driver核心数', + 'Please enter Driver cores': '请输入Driver核心数', + 'Driver Memory': 'Driver内存数', 'Please enter Driver memory': '请输入Driver内存数', 'Executor Number': 'Executor数量', 'Please enter Executor number': '请输入Executor数量', - 'Executor memory': 'Executor内存数', + 'The Executor number should be a positive integer': 'Executor数量为正整数', + 'Executor Memory': 'Executor内存数', 'Please enter Executor memory': '请输入Executor内存数', - 'Executor cores': 'Executor内核数', - 'Please enter Executor cores': '请输入Executor内核数', - 'The Executor Number should be a positive integer': 'Executor数量为正整数', + 'Executor Cores': 'Executor核心数', + 'Please enter Executor cores': '请输入Executor核心数', 'Memory should be a positive integer': '内存数为数字', - 'Core number should be positive integer': '内核数为正整数', + 'Core number should be positive integer': '核心数为正整数', + 'Flink Version': 'Flink版本', + 'JobManager Memory': 'JobManager内存数', 'Please enter JobManager memory': '请输入JobManager内存数', + 'TaskManager Memory': 'TaskManager内存数', 'Please enter TaskManager memory': '请输入TaskManager内存数', + 'Slot Number': 'Slot数量', 'Please enter Slot number': '请输入Slot数量', + 'TaskManager Number': 'TaskManager数量', 'Please enter TaskManager number': '请输入TaskManager数量', + 'App Name': '任务名称', 'Please enter app name(optional)': '请输入任务名称(选填)', 'SQL Type': 'sql类型', Title: '主题', @@ -543,12 +549,6 @@ export default { 'Next five execution times': '接下来五次执行时间', 'Execute time': '执行时间', 'Complement range': '补数范围', - 'Flink Version': 'Flink版本', - 'Slot Number': 'Slot数量', - 'TaskManager Number': 'TaskManager数量', - 'JobManager Memory': 'JobManager内存数', - 'TaskManager Memory': 'TaskManager内存数', - 'App Name': '任务名称', 'Http Url': '请求地址', 'Http Method': '请求类型', 'Http Parameters': '请求参数',