Browse Source

[1.3.6-prepare][Improvement][Server&UI] Update worker group ip ad unify form model #4982 (#5016)

Shiwen Cheng 4 years ago committed by GitHub
parent
commit
a24bb8b56c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkerGroupService.java
  2. 10
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/conditions.vue
  3. 10
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue
  4. 4
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue
  5. 3
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue
  6. 2
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
  7. 5
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sqoop.vue

21
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkerGroupService.java

@ -25,13 +25,19 @@ import org.apache.dolphinscheduler.common.utils.StringUtils;
import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.entity.WorkerGroup; import org.apache.dolphinscheduler.dao.entity.WorkerGroup;
import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper;
import org.apache.dolphinscheduler.remote.utils.Host;
import org.apache.dolphinscheduler.service.zk.ZookeeperCachedOperator; import org.apache.dolphinscheduler.service.zk.ZookeeperCachedOperator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/** /**
* work group service * work group service
*/ */
@ -133,7 +139,6 @@ public class WorkerGroupService extends BaseService {
// available workerGroup list // available workerGroup list
List<String> availableWorkerGroupList = new ArrayList<>(); List<String> availableWorkerGroupList = new ArrayList<>();
List<WorkerGroup> workerGroups = new ArrayList<>(); List<WorkerGroup> workerGroups = new ArrayList<>();
for (String workerGroup : workerGroupList){ for (String workerGroup : workerGroupList){
@ -144,10 +149,10 @@ public class WorkerGroupService extends BaseService {
WorkerGroup wg = new WorkerGroup(); WorkerGroup wg = new WorkerGroup();
wg.setName(workerGroup); wg.setName(workerGroup);
if (isPaging){ if (isPaging){
wg.setIpList(childrenNodes); wg.setIpList(childrenNodes.stream().map(node -> Host.of(node).getIp()).collect(Collectors.toList()));
String registeredIpValue = zookeeperCachedOperator.get(workerGroupPath + "/" + childrenNodes.get(0)); String registeredValue = zookeeperCachedOperator.get(workerGroupPath + "/" + childrenNodes.get(0));
wg.setCreateTime(DateUtils.stringToDate(registeredIpValue.split(",")[6])); wg.setCreateTime(DateUtils.stringToDate(registeredValue.split(",")[6]));
wg.setUpdateTime(DateUtils.stringToDate(registeredIpValue.split(",")[7])); wg.setUpdateTime(DateUtils.stringToDate(registeredValue.split(",")[7]));
} }
workerGroups.add(wg); workerGroups.add(wg);
} }

10
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/conditions.vue

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
<template> <template>
<div class="dependence-model"> <div class="conditions-model">
<m-list-box> <m-list-box>
<div slot="text">{{$t('Custom Parameters')}}</div> <div slot="text">{{$t('Custom Parameters')}}</div>
<div slot="content"> <div slot="content">
@ -68,7 +68,7 @@
import mNodeStatus from './_source/nodeStatus' import mNodeStatus from './_source/nodeStatus'
import disabledState from '@/module/mixin/disabledState' import disabledState from '@/module/mixin/disabledState'
export default { export default {
name: 'dependence', name: 'conditions',
data () { data () {
return { return {
relation: 'AND', relation: 'AND',
@ -134,7 +134,7 @@
this.isLoading = false this.isLoading = false
}, 600) }, 600)
}, },
cacheDependence (val) { cacheDependent (val) {
this.$emit('on-cache-dependent', val) this.$emit('on-cache-dependent', val)
} }
}, },
@ -164,7 +164,7 @@
destroyed () { destroyed () {
}, },
computed: { computed: {
cacheDependence () { cacheDependent () {
return { return {
relation: this.relation, relation: this.relation,
dependTaskList: _.map(this.dependTaskList, v => { dependTaskList: _.map(this.dependTaskList, v => {
@ -181,7 +181,7 @@
</script> </script>
<style lang="scss" rel="stylesheet/scss"> <style lang="scss" rel="stylesheet/scss">
.dependence-model { .conditions-model {
margin-top: -10px; margin-top: -10px;
.dep-opt { .dep-opt {
margin-bottom: 10px; margin-bottom: 10px;

10
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
<template> <template>
<div class="dependence-model"> <div class="dependent-model">
<m-list-box> <m-list-box>
<div slot="text">{{$t('Add dependency')}}</div> <div slot="text">{{$t('Add dependency')}}</div>
<div slot="content"> <div slot="content">
@ -67,7 +67,7 @@
import disabledState from '@/module/mixin/disabledState' import disabledState from '@/module/mixin/disabledState'
export default { export default {
name: 'dependence', name: 'dependent',
data () { data () {
return { return {
relation: 'AND', relation: 'AND',
@ -132,7 +132,7 @@
this.isLoading = false this.isLoading = false
}, 600) }, 600)
}, },
cacheDependence (val) { cacheDependent (val) {
this.$emit('on-cache-dependent', val) this.$emit('on-cache-dependent', val)
} }
}, },
@ -155,7 +155,7 @@
destroyed () { destroyed () {
}, },
computed: { computed: {
cacheDependence () { cacheDependent () {
return { return {
relation: this.relation, relation: this.relation,
dependTaskList: _.map(this.dependTaskList, v => { dependTaskList: _.map(this.dependTaskList, v => {
@ -172,7 +172,7 @@
</script> </script>
<style lang="scss" rel="stylesheet/scss"> <style lang="scss" rel="stylesheet/scss">
.dependence-model { .dependent-model {
margin-top: -10px; margin-top: -10px;
.dep-opt { .dep-opt {
margin-bottom: 10px; margin-bottom: 10px;

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

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
<template> <template>
<div class="spark-model"> <div class="mr-model">
<m-list-box> <m-list-box>
<div slot="text">{{$t('Program Type')}}</div> <div slot="text">{{$t('Program Type')}}</div>
<div slot="content"> <div slot="content">
@ -444,7 +444,7 @@
</script> </script>
<style lang="scss" rel="stylesheet/scss"> <style lang="scss" rel="stylesheet/scss">
.spark-model { .mr-model {
.list-box-4p { .list-box-4p {
.list { .list {
margin-bottom: 14px; margin-bottom: 14px;

3
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue

@ -162,6 +162,3 @@
components: { mListBox, mDatasource, mLocalParams } components: { mListBox, mDatasource, mLocalParams }
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss">
</style>

2
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
<template> <template>
<div class="shell-model"> <div class="python-model">
<m-list-box> <m-list-box>
<div slot="text">{{$t('Script')}}</div> <div slot="text">{{$t('Script')}}</div>
<div slot="content"> <div slot="content">

5
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sqoop.vue

@ -15,8 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
<template> <template>
<div class="sql-model"> <div class="sqoop-model">
<m-list-box> <m-list-box>
<div slot="text">{{$t('Custom Job')}}</div> <div slot="text">{{$t('Custom Job')}}</div>
<div slot="content"> <div slot="content">
@ -574,7 +573,7 @@
let shellEditor let shellEditor
export default { export default {
name: 'sql', name: 'sqoop',
data () { data () {
return { return {
/** /**

Loading…
Cancel
Save