Browse Source

[Improvement][UI] Improve parameter (#4673)

pull/3/MERGE
Shiwen Cheng 4 years ago committed by GitHub
parent
commit
24ddd4f707
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 38
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue
  2. 16
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue
  3. 78
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue
  4. 34
      dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
  5. 44
      dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

38
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue

@ -35,7 +35,7 @@
</m-list-box>
<m-list-box v-if="programType !== 'PYTHON'">
<div slot="text">{{$t('Main class')}}</div>
<div slot="text">{{$t('Main Class')}}</div>
<div slot="content">
<el-input
:disabled="isDetails"
@ -47,7 +47,7 @@
</div>
</m-list-box>
<m-list-box>
<div slot="text">{{$t('Main jar package')}}</div>
<div slot="text">{{$t('Main Jar Package')}}</div>
<div slot="content">
<treeselect v-model="mainJar" maxHeight="200" :options="mainJarLists" :disable-branch-nodes="true" :normalizer="normalizer" :disabled="isDetails" :placeholder="$t('Please enter main jar package')">
<div slot="value-label" slot-scope="{ node }">{{ node.raw.fullName }}</div>
@ -137,7 +137,7 @@
</div>
</m-list-4-box>
<m-list-box>
<div slot="text">{{$t('Command-line parameters')}}</div>
<div slot="text">{{$t('Main Arguments')}}</div>
<div slot="content">
<el-input
:autosize="{minRows:2}"
@ -145,12 +145,12 @@
type="textarea"
size="small"
v-model="mainArgs"
:placeholder="$t('Please enter Command-line parameters')">
:placeholder="$t('Please enter main arguments')">
</el-input>
</div>
</m-list-box>
<m-list-box>
<div slot="text">{{$t('Other parameters')}}</div>
<div slot="text">{{$t('Option Parameters')}}</div>
<div slot="content">
<el-input
:disabled="isDetails"
@ -158,7 +158,7 @@
type="textarea"
size="small"
v-model="others"
:placeholder="$t('Please enter other parameters')">
:placeholder="$t('Please enter option parameters')">
</el-input>
</div>
</m-list-box>
@ -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')}`)

16
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue

@ -30,7 +30,7 @@
</div>
</m-list-box>
<m-list-box v-if="programType !== 'PYTHON'">
<div slot="text">{{$t('Main class')}}</div>
<div slot="text">{{$t('Main Class')}}</div>
<div slot="content">
<el-input
:disabled="isDetails"
@ -42,7 +42,7 @@
</div>
</m-list-box>
<m-list-box>
<div slot="text">{{$t('Main jar package')}}</div>
<div slot="text">{{$t('Main Jar Package')}}</div>
<div slot="content">
<treeselect v-model="mainJar" maxHeight="200" :options="mainJarLists" :disable-branch-nodes="true" :normalizer="normalizer" :value-consists-of="valueConsistsOf" :disabled="isDetails" :placeholder="$t('Please enter main jar package')">
<div slot="value-label" slot-scope="{ node }">{{ node.raw.fullName }}</div>
@ -50,7 +50,7 @@
</div>
</m-list-box>
<m-list-box>
<div slot="text">{{$t('Command-line parameters')}}</div>
<div slot="text">{{$t('Main Arguments')}}</div>
<div slot="content">
<el-input
:autosize="{minRows:2}"
@ -58,12 +58,12 @@
type="textarea"
size="small"
v-model="mainArgs"
:placeholder="$t('Please enter Command-line parameters')">
:placeholder="$t('Please enter main arguments')">
</el-input>
</div>
</m-list-box>
<m-list-box>
<div slot="text">{{$t('Other parameters')}}</div>
<div slot="text">{{$t('Option Parameters')}}</div>
<div slot="content">
<el-input
:disabled="isDetails"
@ -71,7 +71,7 @@
type="textarea"
size="small"
v-model="others"
:placeholder="$t('Please enter other parameters')">
:placeholder="$t('Please enter option parameters')">
</el-input>
</div>
</m-list-box>
@ -122,9 +122,9 @@
cacheResourceList: [],
// Custom parameter
localParams: [],
// Command line argument
// Main arguments
mainArgs: '',
// Other parameters
// Option parameters
others: '',
// Program type
programType: 'JAVA',

78
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue

@ -51,7 +51,7 @@
</div>
</m-list-box>
<m-list-box v-if="programType !== 'PYTHON'">
<div slot="text">{{$t('Main class')}}</div>
<div slot="text">{{$t('Main Class')}}</div>
<div slot="content">
<el-input
:disabled="isDetails"
@ -63,7 +63,7 @@
</div>
</m-list-box>
<m-list-box>
<div slot="text">{{$t('Main jar package')}}</div>
<div slot="text">{{$t('Main Jar Package')}}</div>
<div slot="content">
<treeselect v-model="mainJar" maxHeight="200" :options="mainJarLists" :disable-branch-nodes="true" :normalizer="normalizer" :disabled="isDetails" :placeholder="$t('Please enter main jar package')">
<div slot="value-label" slot-scope="{ node }">{{ node.raw.fullName }}</div>
@ -81,7 +81,7 @@
</div>
</m-list-box>
<m-list-4-box>
<div slot="text">{{$t('Driver cores')}}</div>
<div slot="text">{{$t('Driver Cores')}}</div>
<div slot="content">
<el-input
:disabled="isDetails"
@ -91,7 +91,7 @@
:placeholder="$t('Please enter Driver cores')">
</el-input>
</div>
<div slot="text-2">{{$t('Driver memory')}}</div>
<div slot="text-2">{{$t('Driver Memory')}}</div>
<div slot="content-2">
<el-input
:disabled="isDetails"
@ -113,7 +113,7 @@
:placeholder="$t('Please enter Executor number')">
</el-input>
</div>
<div slot="text-2">{{$t('Executor memory')}}</div>
<div slot="text-2">{{$t('Executor Memory')}}</div>
<div slot="content-2">
<el-input
:disabled="isDetails"
@ -125,7 +125,7 @@
</div>
</m-list-4-box>
<m-list-4-box>
<div slot="text">{{$t('Executor cores')}}</div>
<div slot="text">{{$t('Executor Cores')}}</div>
<div slot="content">
<el-input
:disabled="isDetails"
@ -137,7 +137,7 @@
</div>
</m-list-4-box>
<m-list-box>
<div slot="text">{{$t('Command-line parameters')}}</div>
<div slot="text">{{$t('Main Arguments')}}</div>
<div slot="content">
<el-input
:autosize="{minRows:2}"
@ -145,12 +145,12 @@
type="textarea"
size="small"
v-model="mainArgs"
:placeholder="$t('Please enter Command-line parameters')">
:placeholder="$t('Please enter main arguments')">
</el-input>
</div>
</m-list-box>
<m-list-box>
<div slot="text">{{$t('Other parameters')}}</div>
<div slot="text">{{$t('Option Parameters')}}</div>
<div slot="content">
<el-input
:disabled="isDetails"
@ -158,7 +158,7 @@
type="textarea"
size="small"
v-model="others"
:placeholder="$t('Please enter other parameters')">
:placeholder="$t('Please enter option parameters')">
</el-input>
</div>
</m-list-box>
@ -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

34
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',

44
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': '请求参数',

Loading…
Cancel
Save