Browse Source

首页增加队列统计命令状态统计

pull/2/head
gongzijian 6 years ago
parent
commit
b13aabe5b5
  1. 2
      escheduler-ui/.env
  2. 10
      escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue
  3. 34
      escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/chartConfig.js
  4. 81
      escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue

2
escheduler-ui/.env

@ -1,6 +1,6 @@
# 后端接口地址
API_BASE = http://192.168.220.154:12345
API_BASE = http://192.168.220.247:12345
# 本地开发如需ip访问项目把"#"号去掉
#DEV_HOST = 192.168.xx.xx

10
escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue

@ -236,6 +236,12 @@
editor.setValue(this.sql)
return editor
},
_getReceiver () {
this.store.dispatch('dag/getReceiver', { processDefinitionId: this.item.id }).then(res => {
this.receivers = res.receivers && res.receivers.split(',') || []
this.receiversCc = res.receiversCc && res.receiversCc.split(',') || []
})
}
},
watch: {
@ -280,6 +286,10 @@
this.receivers = o.params.receivers && o.params.receivers.split(',') || []
this.receiversCc = o.params.receiversCc && o.params.receiversCc.split(',') || []
}
//
if (this.router.history.current.name === 'definition-create') {
this._getReceiver()
}
},
mounted () {
setTimeout(() => {

34
escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/chartConfig.js

@ -15,6 +15,9 @@
* limitations under the License.
*/
import _ from 'lodash'
import { tasksState } from '@/conf/home/pages/dag/_source/config'
let pie = {
series: [
{
@ -63,4 +66,33 @@ let bar = {
}]
}
export { pie, bar }
let simple = {
xAxis: {
splitLine: {
show: false
},
axisLabel: {
interval: 0,
showMaxLabel: true,
formatter (v) {
return tasksState[v].desc
}
}
},
tooltip: {
formatter (data) {
let str = ''
_.map(data, (v, i) => {
if (i === 0) {
str += `${tasksState[v.name].desc}<br>`
}
str += `<div style="font-size: 12px;">${v.seriesName} : ${v.data}<br></div>`
})
return str
}
}
}
export { pie, bar, simple }

81
escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue

@ -73,34 +73,7 @@
</div>
<div class="row" style="padding-top: 20px;">
<div class="col-md-6">
<div class="chart-title">
<span>命令状态统计</span>
</div>
<div class="row">
<div class="col-md-7">
<div id="command-state-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 taskCtatusList">
<td><span>{{$index+1}}</span></td>
<td>
<span>
<a href="javascript:" @click="id && _goTask(item.key)" :class="id ?'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 class="col-md-6">
<div class="chart-title">
@ -108,19 +81,19 @@
</div>
<div class="row">
<div class="col-md-7">
<div id="process-state-pie" style="height:260px;margin-top: 100px;"></div>
<div id="queue-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>
<th>等待执行任务</th>
<th>等待Kill任务</th>
</tr>
<tr v-for="(item,$index) in processStateList">
<tr v-for="(item,$index) in queueList">
<td><span>{{$index+1}}</span></td>
<td><span><a href="javascript:" @click="id && _goProcess(item.key)" :class="id ?'links':''">{{item.value}}</a></span></td>
<td><span><a href="javascript:" >{{item.value}}</a></span></td>
<td><span class="ellipsis" style="width: 98%;" :title="item.key">{{item.key}}</span></td>
</tr>
</table>
@ -129,6 +102,16 @@
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="chart-title" style="margin-bottom: 20px;margin-top: 30px">
<span>命令状态统计</span>
</div>
<div>
<div id="command-state-bar" style="height:500px"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="chart-title" style="margin-bottom: -20px;margin-top: 30px">
@ -150,7 +133,7 @@
import _ from 'lodash'
import dayjs from 'dayjs'
import { mapActions } from 'vuex'
import { pie, bar } from './chartConfig'
import { pie, bar, simple } from './chartConfig'
import Chart from '~/@analysys/ana-charts'
import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData'
@ -166,6 +149,7 @@
processStateList: [],
defineUserList: [],
commandStateList: [],
queueList: [],
searchParams: {
projectId: this.id,
startDate: '',
@ -203,7 +187,6 @@
}
})
},
_handleTaskCtatus (res) {
let data = res.data.taskCountDtos
this.taskCtatusList = _.map(data, v => {
@ -263,10 +246,32 @@
}
},
_handleCommandState (res) {
let data = []
_.forEach(res.data, (v, i) => {
let key = _.keys(v)
if (key[0] === 'errorCount') {
data.push({ typeName: '错误指令数', key: v.commandState, value: v.errorCount })
}
})
_.forEach(res.data, (v, i) => {
let key = _.keys(v)
if (key[1] === 'normalCount') {
data.push({ typeName: '正常指令数', key: v.commandState, value: v.normalCount })
}
})
const myChart = Chart.bar('#command-state-bar', data, {
title: ''
})
myChart.echart.setOption(simple)
},
_handleQueue (res) {
_.forEach(res.data, (v, k) => this.queueList.push({
key: k === 'taskQueue' ? '等待执行任务' : '等待kill任务',
value: v
}))
const myChart = Chart.pie('#queue-pie', this.queueList, { title: '' })
myChart.echart.setOption(pie)
},
_handleQueue () {},
_getData (is = true) {
this.isLoading = true
let ioList = [

Loading…
Cancel
Save