Browse Source

[Fix-3469][ui]The value of maintenance resources and the filtering of resources according to different program types

pull/3/MERGE
break60 4 years ago
parent
commit
52aaf0ec92
  1. 31
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue
  2. 32
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue
  3. 3
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
  4. 3
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
  5. 29
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue
  6. 1
      dolphinscheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue
  7. 1
      dolphinscheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue
  8. 11
      dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js
  9. 1
      dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js
  10. 2
      dolphinscheduler-ui/src/js/conf/home/store/dag/state.js

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

@ -22,6 +22,7 @@
<x-select
style="width: 130px;"
v-model="programType"
@on-change="_onChange"
:disabled="isDetails">
<x-option
v-for="city in programTypeList"
@ -181,6 +182,8 @@
// Master jar package(List)
mainJarLists: [],
mainJarList: [],
jarList: [],
pyList: [],
// Deployment method
deployMode: 'cluster',
// Resource(list)
@ -221,6 +224,16 @@
},
mixins: [disabledState],
methods: {
/**
* programType change
*/
_onChange(o) {
if(o.value === 'PYTHON') {
this.mainJarLists = this.pyList
} else {
this.mainJarLists = this.jarList
}
},
/**
* getResourceId
*/
@ -396,12 +409,13 @@
if(optionsCmp.length>0) {
this.allNoResources = optionsCmp
optionsCmp = optionsCmp.map(item=>{
return {id: item.id,name: item.name,fullName: item.res}
return {id: item.id,name: item.name || item.res,fullName: item.res}
})
optionsCmp.forEach(item=>{
item.isNew = true
})
noResources[0].children = optionsCmp
this.mainJarList = _.filter(this.mainJarList, o=> { return o.id!==-1 })
this.mainJarList = this.mainJarList.concat(noResources)
}
}
@ -465,13 +479,24 @@
}
},
created () {
let o = this.backfillItem
let item = this.store.state.dag.resourcesListS
let items = this.store.state.dag.resourcesListJar
let pythonList = this.store.state.dag.resourcesListPy
this.diGuiTree(item)
this.diGuiTree(items)
this.diGuiTree(pythonList)
this.mainJarList = item
this.mainJarLists = items
let o = this.backfillItem
this.jarList = items
this.pyList = pythonList
if(!_.isEmpty(o) && o.params.programType === 'PYTHON') {
this.mainJarLists = pythonList
} else {
this.mainJarLists = items
}
// Non-null objects represent backfill
if (!_.isEmpty(o)) {
this.mainClass = o.params.mainClass || ''

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

@ -19,7 +19,7 @@
<m-list-box>
<div slot="text">{{$t('Program Type')}}</div>
<div slot="content">
<x-select v-model="programType" :disabled="isDetails" style="width: 110px;">
<x-select v-model="programType" @on-change="_onChange" :disabled="isDetails" style="width: 110px;">
<x-option
v-for="city in programTypeList"
:key="city.code"
@ -117,6 +117,8 @@
// Main jar package (List)
mainJarLists: [],
mainJarList: [],
jarList: [],
pyList: [],
// Resource(list)
resourceList: [],
// Cache ResourceList
@ -145,6 +147,16 @@
},
mixins: [disabledState],
methods: {
/**
* programType change
*/
_onChange(o) {
if(o.value === 'PYTHON') {
this.mainJarLists = this.pyList
} else {
this.mainJarLists = this.jarList
}
},
/**
* getResourceId
*/
@ -237,12 +249,13 @@
if(optionsCmp.length>0) {
this.allNoResources = optionsCmp
optionsCmp = optionsCmp.map(item=>{
return {id: item.id,name: item.name,fullName: item.res}
return {id: item.id,name: item.name || item.res,fullName: item.res}
})
optionsCmp.forEach(item=>{
item.isNew = true
})
noResources[0].children = optionsCmp
this.mainJarList = _.filter(this.mainJarList, o=> { return o.id!==-1 })
this.mainJarList = this.mainJarList.concat(noResources)
}
}
@ -343,13 +356,24 @@
}
},
created () {
let o = this.backfillItem
let item = this.store.state.dag.resourcesListS
let items = this.store.state.dag.resourcesListJar
let pythonList = this.store.state.dag.resourcesListPy
this.diGuiTree(item)
this.diGuiTree(items)
this.diGuiTree(pythonList)
this.mainJarList = item
this.mainJarLists = items
let o = this.backfillItem
this.jarList = items
this.pyList = pythonList
if(!_.isEmpty(o) && o.params.programType === 'PYTHON') {
this.mainJarLists = pythonList
} else {
this.mainJarLists = items
}
// Non-null objects represent backfill
if (!_.isEmpty(o)) {

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

@ -229,12 +229,13 @@
if(optionsCmp.length>0) {
this.allNoResources = optionsCmp
optionsCmp = optionsCmp.map(item=>{
return {id: item.id,name: item.name,fullName: item.res}
return {id: item.id,name: item.name || item.res,fullName: item.res}
})
optionsCmp.forEach(item=>{
item.isNew = true
})
noResources[0].children = optionsCmp
this.resourceOptions = _.filter(this.resourceOptions, o=> { return o.id!==-1 })
this.resourceOptions = this.resourceOptions.concat(noResources)
}
}

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

@ -267,12 +267,13 @@
if(optionsCmp.length>0) {
this.allNoResources = optionsCmp
optionsCmp = optionsCmp.map(item=>{
return {id: item.id,name: item.name,fullName: item.res}
return {id: item.id,name: item.name || item.res,fullName: item.res}
})
optionsCmp.forEach(item=>{
item.isNew = true
})
noResources[0].children = optionsCmp
this.options = _.filter(this.options, o=> { return o.id!==-1 })
this.options = this.options.concat(noResources)
}
}

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

@ -22,6 +22,7 @@
<x-select
style="width: 130px;"
v-model="programType"
@on-change="_onChange"
:disabled="isDetails">
<x-option
v-for="city in programTypeList"
@ -220,6 +221,8 @@
// Master jar package(List)
mainJarLists: [],
mainJarList: [],
jarList: [],
pyList: [],
// Deployment method
deployMode: 'cluster',
// Resource(list)
@ -264,6 +267,16 @@
},
mixins: [disabledState],
methods: {
/**
* programType change
*/
_onChange(o) {
if(o.value === 'PYTHON') {
this.mainJarLists = this.pyList
} else {
this.mainJarLists = this.jarList
}
},
/**
* getResourceId
*/
@ -356,12 +369,13 @@
if(optionsCmp.length>0) {
this.allNoResources = optionsCmp
optionsCmp = optionsCmp.map(item=>{
return {id: item.id,name: item.name,fullName: item.res}
return {id: item.id,name: item.name || item.res,fullName: item.res}
})
optionsCmp.forEach(item=>{
item.isNew = true
})
noResources[0].children = optionsCmp
this.mainJarList = _.filter(this.mainJarList, o=> { return o.id!==-1 })
this.mainJarList = this.mainJarList.concat(noResources)
}
}
@ -512,13 +526,22 @@
}
},
created () {
let o = this.backfillItem
let item = this.store.state.dag.resourcesListS
let items = this.store.state.dag.resourcesListJar
let pythonList = this.store.state.dag.resourcesListPy
this.diGuiTree(item)
this.diGuiTree(items)
this.diGuiTree(pythonList)
this.mainJarList = item
this.mainJarLists = items
let o = this.backfillItem
this.jarList = items
this.pyList = pythonList
if(!_.isEmpty(o) && o.params.programType === 'PYTHON') {
this.mainJarLists = pythonList
} else {
this.mainJarLists = items
}
// Non-null objects represent backfill
if (!_.isEmpty(o)) {

1
dolphinscheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue

@ -62,6 +62,7 @@
this.getResourcesList(),
// get jar
this.getResourcesListJar(),
this.getResourcesListJar('PYTHON'),
// get worker group list
this.getWorkerGroupsAll(),
this.getTenantList()

1
dolphinscheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue

@ -64,6 +64,7 @@
this.getResourcesList(),
// get jar
this.getResourcesListJar(),
this.getResourcesListJar('PYTHON'),
// get worker group list
this.getWorkerGroupsAll(),
this.getTenantList()

11
dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js

@ -374,16 +374,21 @@ export default {
/**
* get jar
*/
getResourcesListJar ({ state }) {
getResourcesListJar ({ state }, payload) {
return new Promise((resolve, reject) => {
if (state.resourcesListJar.length) {
resolve()
return
}
io.get('resources/list/jar', {
type: 'FILE'
type: 'FILE',
programType: payload
}, res => {
state.resourcesListJar = res.data
if(payload) {
state.resourcesListPy = res.data
} else {
state.resourcesListJar = res.data
}
resolve(res.data)
}).catch(res => {
reject(res)

1
dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js

@ -109,6 +109,7 @@ export default {
state.processListS = (payload && payload.processListS) || []
state.resourcesListS = (payload && payload.resourcesListS) || []
state.resourcesListJar = (payload && payload.resourcesListJar) || []
state.resourcesListPy = (payload && payload.resourcesListPy) || []
state.projectListS = (payload && payload.projectListS) || []
state.isDetails = (payload && payload.isDetails) || false
state.runFlag = (payload && payload.runFlag) || ''

2
dolphinscheduler-ui/src/js/conf/home/store/dag/state.js

@ -55,6 +55,8 @@ export default {
resourcesListS: [],
// tasks resourcesListJar
resourcesListJar: [],
// tasks resourcesListPy
resourcesListPy: [],
// tasks datasource Type
dsTypeListS: [
{

Loading…
Cancel
Save