Browse Source

delay execution ui

pull/3/MERGE
曹聚阳 4 years ago
parent
commit
6467875a87
  1. 7
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js
  2. 21
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
  3. 7
      dolphinscheduler-ui/src/js/conf/home/pages/datasource/pages/list/_source/createDataSource.vue
  4. 3
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/instanceConditions/common.js
  5. 147
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskStatusCount.vue
  6. 8
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/index.vue
  7. 4
      dolphinscheduler-ui/src/js/conf/home/store/datasource/actions.js
  8. 2
      dolphinscheduler-ui/src/js/conf/home/store/projects/actions.js
  9. 2
      dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
  10. 2
      dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

7
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js

@ -229,6 +229,13 @@ const tasksState = {
color: '#5101be', color: '#5101be',
icoUnicode: 'ans-icon-dependence', icoUnicode: 'ans-icon-dependence',
isSpin: false isSpin: false
},
DELAY_EXECUTION: {
id: 12,
desc: `${i18n.$t('Delay execution')}`,
color: '#5102ce',
icoUnicode: 'ans-icon-coin',
isSpin: false
} }
} }

21
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue

@ -109,6 +109,20 @@
<span>({{$t('Minute')}})</span> <span>({{$t('Minute')}})</span>
</div> </div>
</div> </div>
<!-- Delay execution time -->
<div class="clearfix list" v-if="taskType !== 'SUB_PROCESS' && taskType !== 'CONDITIONS' && taskType !== 'DEPENDENT'">
<div class="text-box">
<span>{{$t('Delay execution time')}}</span>
</div>
<div class="cont-box">
<m-select-input v-model="delayTime" :list="[0,1,5,10]">
</m-select-input>
<span>({{$t('Minute')}})</span>
</div>
</div>
<!-- Branch flow -->
<div class="clearfix list" v-if="taskType === 'CONDITIONS'"> <div class="clearfix list" v-if="taskType === 'CONDITIONS'">
<div class="text-box"> <div class="text-box">
<span>{{$t('State')}}</span> <span>{{$t('State')}}</span>
@ -127,7 +141,6 @@
</x-select> </x-select>
</div> </div>
</div> </div>
<div class="clearfix list" v-if="taskType === 'CONDITIONS'"> <div class="clearfix list" v-if="taskType === 'CONDITIONS'">
<div class="text-box"> <div class="text-box">
<span>{{$t('State')}}</span> <span>{{$t('State')}}</span>
@ -339,6 +352,8 @@
maxRetryTimes: '0', maxRetryTimes: '0',
// Failure retry interval // Failure retry interval
retryInterval: '1', retryInterval: '1',
// Delay execution time
delayTime: '0',
// Task timeout alarm // Task timeout alarm
timeout: {}, timeout: {},
// Task priority // Task priority
@ -466,6 +481,7 @@
dependence: this.cacheDependence, dependence: this.cacheDependence,
maxRetryTimes: this.maxRetryTimes, maxRetryTimes: this.maxRetryTimes,
retryInterval: this.retryInterval, retryInterval: this.retryInterval,
delayTime: this.delayTime,
timeout: this.timeout, timeout: this.timeout,
taskInstancePriority: this.taskInstancePriority, taskInstancePriority: this.taskInstancePriority,
workerGroup: this.workerGroup, workerGroup: this.workerGroup,
@ -544,6 +560,7 @@
dependence: this.dependence, dependence: this.dependence,
maxRetryTimes: this.maxRetryTimes, maxRetryTimes: this.maxRetryTimes,
retryInterval: this.retryInterval, retryInterval: this.retryInterval,
delayTime: this.delayTime,
timeout: this.timeout, timeout: this.timeout,
taskInstancePriority: this.taskInstancePriority, taskInstancePriority: this.taskInstancePriority,
workerGroup: this.workerGroup, workerGroup: this.workerGroup,
@ -634,6 +651,7 @@
this.description = o.description this.description = o.description
this.maxRetryTimes = o.maxRetryTimes this.maxRetryTimes = o.maxRetryTimes
this.retryInterval = o.retryInterval this.retryInterval = o.retryInterval
this.delayTime = o.delayTime
if(o.conditionResult) { if(o.conditionResult) {
this.successBranch = o.conditionResult.successNode[0] this.successBranch = o.conditionResult.successNode[0]
this.failedBranch = o.conditionResult.failedNode[0] this.failedBranch = o.conditionResult.failedNode[0]
@ -699,6 +717,7 @@
dependence: this.cacheDependence, dependence: this.cacheDependence,
maxRetryTimes: this.maxRetryTimes, maxRetryTimes: this.maxRetryTimes,
retryInterval: this.retryInterval, retryInterval: this.retryInterval,
delayTime: this.delayTime,
timeout: this.timeout, timeout: this.timeout,
taskInstancePriority: this.taskInstancePriority, taskInstancePriority: this.taskInstancePriority,
workerGroup: this.workerGroup, workerGroup: this.workerGroup,

7
dolphinscheduler-ui/src/js/conf/home/pages/datasource/pages/list/_source/createDataSource.vue

@ -227,10 +227,6 @@
{ {
value: 'DB2', value: 'DB2',
label: 'DB2' label: 'DB2'
},
{
value: 'PRESTO',
label: 'PRESTO'
} }
] ]
} }
@ -437,9 +433,6 @@
case 'DB2': case 'DB2':
defaultPort = '50000' defaultPort = '50000'
break break
case 'PRESTO':
defaultPort = '8080'
break
default: default:
break break

3
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/instanceConditions/common.js

@ -60,6 +60,9 @@ const stateType = [
}, { }, {
code: 'WAITTING_DEPEND', code: 'WAITTING_DEPEND',
label: `${i18n.$t('Waiting for dependency to complete')}` label: `${i18n.$t('Waiting for dependency to complete')}`
}, {
code: 'DELAY_EXECUTION',
label: `${i18n.$t('Delay execution')}`
} }
] ]

147
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskStatusCount.vue

@ -0,0 +1,147 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
<template>
<div class="task-status-count-model">
<div v-show="!msg">
<div class="data-area" v-spin="isSpin" style="height: 430px;">
<div class="col-md-7">
<div id="task-status-pie" style="height:260px;margin-top: 100px;"></div>
</div>
<div class="col-md-5">
<div class="table-small-model">
<table>
<tr>
<th width="40">{{$t('#')}}</th>
<th>{{$t('Number')}}</th>
<th>{{$t('State')}}</th>
</tr>
<tr v-for="(item,$index) in taskStatusList" :key="$index">
<td><span>{{$index+1}}</span></td>
<td>
<span>
<a href="javascript:" @click="searchParams.projectId && _goTask(item.key)" :class="searchParams.projectId ?'links':''">{{item.value}}</a>
</span>
</td>
<td><span class="ellipsis" style="width: 98%;" :title="item.key">{{item.key}}</span></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div v-show="msg">
<m-no-data :msg="msg" v-if="msg" :height="430"></m-no-data>
</div>
</div>
</template>
<script>
import _ from 'lodash'
import { mapActions } from 'vuex'
import { pie } from './chartConfig'
import Chart from '@/module/ana-charts'
import mNoData from '@/module/components/noData/noData'
import { stateType } from '@/conf/home/pages/projects/pages/_source/instanceConditions/common'
export default {
name: 'task-status-count',
data () {
return {
isSpin: true,
msg: '',
taskStatusList: []
}
},
props: {
searchParams: Object
},
methods: {
...mapActions('projects', ['getTaskStatusCount']),
_goTask (name) {
this.$router.push({
name: 'task-instance',
query: {
stateType: _.find(stateType, ['label', name])['code'],
startDate: this.searchParams.startDate,
endDate: this.searchParams.endDate
}
})
},
_handleTaskStatus (res) {
let data = res.data.taskCountDtos
this.taskStatusList = _.map(data, v => {
return {
// CHECK!!
key: _.find(stateType, ['code', v.taskStateType])['label'],
value: v.count,
type: 'type'
}
})
const myChart = Chart.pie('#task-status-pie', this.taskStatusList, { title: '' })
myChart.echart.setOption(pie)
//
if (this.searchParams.projectId) {
myChart.echart.on('click', e => {
this._goTask(e.data.name)
})
}
}
},
watch: {
'searchParams': {
deep: true,
immediate: true,
handler (o) {
this.isSpin = true
this.getTaskStatusCount(o).then(res => {
this.taskStatusList = []
this._handleTaskStatus(res)
this.isSpin = false
}).catch(e => {
console.log(e)
this.msg = e.msg || 'error'
this.isSpin = false
})
}
}
},
beforeCreate () {
},
created () {
},
beforeMount () {
},
mounted () {
},
beforeUpdate () {
},
updated () {
},
beforeDestroy () {
},
destroyed () {
},
computed: {},
components: { mNoData }
}
</script>
<style lang="scss" rel="stylesheet/scss">
.task-status-count-model {
}
</style>

8
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/index.vue

@ -35,8 +35,8 @@
<span>{{$t('Task status statistics')}}</span> <span>{{$t('Task status statistics')}}</span>
</div> </div>
<div class="row"> <div class="row">
<m-task-ctatus-count :search-params="searchParams"> <m-task-status-count :search-params="searchParams">
</m-task-ctatus-count> </m-task-status-count>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
@ -68,7 +68,7 @@
import dayjs from 'dayjs' import dayjs from 'dayjs'
import mDefineUserCount from './_source/defineUserCount' import mDefineUserCount from './_source/defineUserCount'
import mCommandStateCount from './_source/commandStateCount' import mCommandStateCount from './_source/commandStateCount'
import mTaskCtatusCount from './_source/taskCtatusCount' import mTaskStatusCount from './_source/taskStatusCount'
import mProcessStateCount from './_source/processStateCount' import mProcessStateCount from './_source/processStateCount'
import mQueueCount from './_source/queueCount' import mQueueCount from './_source/queueCount'
import localStore from '@/module/util/localStorage' import localStore from '@/module/util/localStorage'
@ -105,7 +105,7 @@
mListConstruction, mListConstruction,
mDefineUserCount, mDefineUserCount,
mCommandStateCount, mCommandStateCount,
mTaskCtatusCount, mTaskStatusCount,
mProcessStateCount, mProcessStateCount,
mQueueCount mQueueCount
} }

4
dolphinscheduler-ui/src/js/conf/home/store/datasource/actions.js

@ -20,7 +20,7 @@ import io from '@/module/io'
export default { export default {
/** /**
* Data source creation * Data source creation
* @param "type": string,//MYSQL, POSTGRESQL, HIVE, SPARK, CLICKHOUSE, ORACLE, SQLSERVER, PRESTO * @param "type": string,//MYSQL, POSTGRESQL, HIVE, SPARK, CLICKHOUSE, ORACLE, SQLSERVER
* @param "name": string, * @param "name": string,
* @param "desc": string, * @param "desc": string,
* @param "parameter":string //{"address":"jdbc:hive2://192.168.220.189:10000","autoReconnect":"true","characterEncoding":"utf8","database":"default","initialTimeout":3000,"jdbcUrl":"jdbc:hive2://192.168.220.189:10000/default","maxReconnect":10,"password":"","useUnicode":true,"user":"hive"} * @param "parameter":string //{"address":"jdbc:hive2://192.168.220.189:10000","autoReconnect":"true","characterEncoding":"utf8","database":"default","initialTimeout":3000,"jdbcUrl":"jdbc:hive2://192.168.220.189:10000/default","maxReconnect":10,"password":"","useUnicode":true,"user":"hive"}
@ -49,7 +49,7 @@ export default {
}, },
/** /**
* Query data source list - no paging * Query data source list - no paging
* @param "type": string//MYSQL, POSTGRESQL, HIVE, SPARK, CLICKHOUSE, ORACLE, SQLSERVER, PRESTO * @param "type": string//MYSQL, POSTGRESQL, HIVE, SPARK, CLICKHOUSE, ORACLE, SQLSERVER
*/ */
getDatasourcesList ({ state }, payload) { getDatasourcesList ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

2
dolphinscheduler-ui/src/js/conf/home/store/projects/actions.js

@ -69,7 +69,7 @@ export default {
/** /**
* Task status statistics * Task status statistics
*/ */
getTaskCtatusCount ({ state }, payload) { getTaskStatusCount ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.get('projects/analysis/task-state-count', payload, res => { io.get('projects/analysis/task-state-count', payload, res => {
resolve(res) resolve(res)

2
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js

@ -42,6 +42,8 @@ export default {
Times: 'Times', Times: 'Times',
'Failed retry interval': 'Failed retry interval', 'Failed retry interval': 'Failed retry interval',
Minute: 'Minute', Minute: 'Minute',
'Delay execution time': 'Delay execution time',
'Delay execution': 'Delay execution',
Cancel: 'Cancel', Cancel: 'Cancel',
'Confirm add': 'Confirm add', 'Confirm add': 'Confirm add',
'The newly created sub-Process has not yet been executed and cannot enter the sub-Process': 'The newly created sub-Process has not yet been executed and cannot enter the sub-Process', 'The newly created sub-Process has not yet been executed and cannot enter the sub-Process': 'The newly created sub-Process has not yet been executed and cannot enter the sub-Process',

2
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

@ -43,6 +43,7 @@ export default {
Times: '次', Times: '次',
'Failed retry interval': '失败重试间隔', 'Failed retry interval': '失败重试间隔',
Minute: '分', Minute: '分',
'Delay execution time': '延时执行时间',
Cancel: '取消', Cancel: '取消',
'Confirm add': '确认添加', 'Confirm add': '确认添加',
'The newly created sub-Process has not yet been executed and cannot enter the sub-Process': '新创建子工作流还未执行不能进入子工作流', 'The newly created sub-Process has not yet been executed and cannot enter the sub-Process': '新创建子工作流还未执行不能进入子工作流',
@ -425,6 +426,7 @@ export default {
hour: '时', hour: '时',
Running: '正在运行', Running: '正在运行',
'Waiting for dependency to complete': '等待依赖完成', 'Waiting for dependency to complete': '等待依赖完成',
'Delay execution': '延时执行',
Selected: '已选', Selected: '已选',
CurrentHour: '当前小时', CurrentHour: '当前小时',
Last1Hour: '前1小时', Last1Hour: '前1小时',

Loading…
Cancel
Save