Browse Source

完成监控中心

pull/2/head
gongzijian 6 years ago
parent
commit
1708b74f1b
  1. 1
      escheduler-ui/src/js/conf/home/index.js
  2. 1
      escheduler-ui/src/js/conf/home/pages/datasource/pages/list/_source/list.vue
  3. 62
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/gauge.vue
  4. 6
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/gaugeOption.js
  5. 81
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/list.vue
  6. 125
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/zookeeperList.vue
  7. 2
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/alert.vue
  8. 165
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/master.vue
  9. 71
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/mysql.vue
  10. 99
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/servers.scss
  11. 163
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/worker.vue
  12. 20
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/zookeeper.vue
  13. 2
      escheduler-ui/src/js/conf/home/pages/projects/pages/_source/taskRecordList/_source/list.vue
  14. 1
      escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue
  15. 1
      escheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue
  16. 1
      escheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue
  17. 1
      escheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/list.vue
  18. 1
      escheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/_source/list.vue
  19. 1
      escheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue
  20. 1
      escheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue
  21. 1
      escheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/_source/list.vue
  22. 1
      escheduler-ui/src/js/conf/home/pages/security/pages/queue/_source/list.vue
  23. 2
      escheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/list.vue
  24. 1
      escheduler-ui/src/js/conf/home/pages/security/pages/users/_source/list.vue
  25. 1
      escheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/_source/list.vue
  26. 1
      escheduler-ui/src/js/conf/home/pages/security/pages/workerGroups/_source/list.vue
  27. 1
      escheduler-ui/src/js/conf/home/pages/user/pages/account/_source/info.vue
  28. 1
      escheduler-ui/src/js/conf/home/pages/user/pages/password/_source/info.vue
  29. 1
      escheduler-ui/src/js/conf/home/pages/user/pages/token/_source/list.vue
  30. 4
      escheduler-ui/src/js/conf/home/store/index.js
  31. 57
      escheduler-ui/src/js/conf/home/store/monitor/actions.js
  32. 19
      escheduler-ui/src/js/conf/home/store/monitor/getters.js
  33. 30
      escheduler-ui/src/js/conf/home/store/monitor/index.js
  34. 19
      escheduler-ui/src/js/conf/home/store/monitor/mutations.js
  35. 18
      escheduler-ui/src/js/conf/home/store/monitor/state.js

1
escheduler-ui/src/js/conf/home/index.js

@ -25,6 +25,7 @@ import store from './store'
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import { sync } from 'vuex-router-sync' import { sync } from 'vuex-router-sync'
import Chart from '~/@analysys/ana-charts' import Chart from '~/@analysys/ana-charts'
import '@/module/filter/formatDate'
import themeData from '@/module/echarts/themeData.json' import themeData from '@/module/echarts/themeData.json'
import Permissions from '@/module/permissions' import Permissions from '@/module/permissions'
import '~/@analysys/ans-ui/lib/ans-ui.min.css' import '~/@analysys/ans-ui/lib/ans-ui.min.css'

1
escheduler-ui/src/js/conf/home/pages/datasource/pages/list/_source/list.vue

@ -90,7 +90,6 @@
</template> </template>
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import { findComponentDownward } from '@/module/util/' import { findComponentDownward } from '@/module/util/'
import mTooltipsJSON from '@/module/components/tooltipsJSON/tooltipsJSON' import mTooltipsJSON from '@/module/components/tooltipsJSON/tooltipsJSON'

62
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/gauge.vue

@ -0,0 +1,62 @@
<template>
<div class="gauge-model">
<div class="gauge-echart">
<div :id="id" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -104px;">
{{name}}
</div>
</div>
</template>
<script>
import gaugeOption from './gaugeOption'
export default {
name: 'gauge',
data () {
return {}
},
props: {
id: String,
name: String,
value: Number
},
methods: {},
created () {
},
mounted () {
const gauge = echarts.init(document.getElementById(this.id)) // eslint-disable-line
gauge.setOption(gaugeOption(this.value), true)
},
components: {}
}
</script>
<style lang="scss" rel="stylesheet/scss">
.gauge-model {
width: 100%;
height: 360px;
overflow: hidden;
margin: 0 auto;
.gauge-echart {
width: 350px;
margin: auto;
margin-bottom: -80px;
}
.text-1 {
width: 100%;
margin: 0 auto;
font-size: 32px;
text-align: center;
}
.value-p {
height: 254px;
line-height: 254px;
text-align: center;
>b {
font-size: 100px;
color: #333;
}
}
}
</style>

6
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/gaugeOption.js

@ -1,4 +1,5 @@
export default { export default function (value) {
return {
series: [ series: [
{ {
type: 'gauge', type: 'gauge',
@ -109,7 +110,7 @@ export default {
} }
}, },
data: [{ data: [{
value: 70, value: value || 0,
label: { label: {
textStyle: { textStyle: {
fontSize: 12 fontSize: 12
@ -118,4 +119,5 @@ export default {
}] }]
} }
] ]
}
} }

81
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/list.vue

@ -1,81 +0,0 @@
<template>
<div class="list-model">
<div class="table-box">
<table>
<tr>
<th>
<span>{{$t('#')}}</span>
</th>
<th>
<span>node</span>
</th>
<th>
<span>ip</span>
</th>
<th>
<span>模式</span>
</th>
<th>
<span>连接数</span>
</th>
<th>
<span>watch数</span>
</th>
<th>
<span>数据量</span>
</th>
<th>
<span>Sent/Received</span>
</th>
<th>
<span>节点自检状态</span>
</th>
</tr>
<tr v-for="(item, $index) in list" :key="$index">
<td>
<span>{{$index + 1}}</span>
</td>
<td>
<span>
<a href="javascript:" class="links">task1</a>
</span>
</td>
<td><span>192.11.1.1</span></td>
<td>
<span>2222</span>
</td>
<td>
<span>3333</span>
</td>
<td>
<span>4444</span>
</td>
<td><span>5555</span></td>
<td>
<span>6666</span>
</td>
<td>
<span>7777</span>
</td>
</tr>
</table>
</div>
</div>
</template>
<script>
import '@/module/filter/formatDate'
export default {
name: 'tenement-list',
data () {
return {
list: []
}
},
props: {
list: Array
},
methods: {
}
}
</script>

125
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/zookeeperList.vue

@ -0,0 +1,125 @@
<template>
<div class="list-model zookeeper-list">
<div class="table-box">
<table>
<tr>
<th>
<span>{{$t('#')}}</span>
</th>
<th>
<span>host</span>
</th>
<th>
<span>连接数</span>
</th>
<th>
<span>watches数量</span>
</th>
<th>
<span>发送量</span>
</th>
<th>
<span>接收量</span>
</th>
<th>
<span>leader/follower</span>
</th>
<th>
<span>最低延时</span>
</th>
<th>
<span>平均延时</span>
</th>
<th>
<span>最大延时</span>
</th>
<th>
<span>节点数</span>
</th>
<th>
<span>当前查询时间戳</span>
</th>
<th style="text-align: center">
<span>节点自检状态</span>
</th>
</tr>
<tr v-for="(item, $index) in list" :key="$index">
<td>
<span>{{$index + 1}}</span>
</td>
<td>
<span>
<a href="javascript:" class="links">{{item.hostname}}</a>
</span>
</td>
<td><span>{{item.connections}}</span></td>
<td>
<span>{{item.watches}}</span>
</td>
<td>
<span>{{item.sent}}</span>
</td>
<td>
<span>{{item.received}}</span>
</td>
<td><span>{{item.mode}}</span></td>
<td>
<span>{{item.minLatency}}</span>
</td>
<td>
<span>{{item.avgLatency}}</span>
</td>
<td>
<span>{{item.maxLatency}}</span>
</td>
<td>
<span>{{item.nodeCount}}</span>
</td>
<td>
<span>{{item.date | formatDate}}</span>
</td>
<td>
<span class="state">
<i class="iconfont success" v-if="item.state">&#xe607;</i>
<i class="iconfont error" v-else>&#xe626;</i>
</span>
</td>
</tr>
</table>
</div>
</div>
</template>
<script>
export default {
name: 'zookeeper-list',
data () {
return {
list: []
}
},
props: {
list: Array
},
methods: {
}
}
</script>
<style lang="scss" rel="stylesheet/scss">
.zookeeper-list {
.state {
text-align: center;
display: block;
>i {
font-size: 18px;
}
.success {
color: #33cc00;
}
.error {
color: #ff0000;
}
}
}
</style>

2
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/alert.vue

@ -13,7 +13,7 @@
</template> </template>
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import mList from './_source/list' import mList from './_source/zookeeperList'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'

165
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/master.vue

@ -2,171 +2,90 @@
<m-list-construction :title="'Master管理'"> <m-list-construction :title="'Master管理'">
<template slot="content"> <template slot="content">
<div class="servers-wrapper"> <div class="servers-wrapper">
<div class="row"> <div class="row-box" v-for="(item,$index) in masterList">
<div class="col-md-4"> <div class="row-title">
<div class="gridb-model"> <div class="left">
<div class="title"> <span class="sp">IP: {{item.host}}</span>
<span>Cpu详细信息</span> <span class="sp">端口: {{item.port}}</span>
</div> <span class="sp">zk注册目录: {{item.zkDirectory}}</span>
<div class="gauge-echart">
<div id="a1" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="gauge-echart">
<div id="a2" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="value-p">
<b style="color: #0098e1;">12</b>
</div>
<div class="text-1">
cpu
</div> </div>
<div class="right">
<span class="sp">创建时间: {{item.createTime | formatDate}}</span>
<span class="sp">最后心跳时间: {{item.lastHeartbeatTime | formatDate}}</span>
</div> </div>
</div> </div>
</div> <div class="row-cont">
<div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="gridb-model"> <m-gauge
<div class="title"> :value="(item.resInfo.cpuUsage * 100).toFixed(2)"
<span>Cpu详细信息</span> :name="'cpuUsage'"
</div> :id="'gauge-cpu-' + item.id">
<div class="gauge-echart"> </m-gauge>
<div id="a3" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="gridb-model"> <m-gauge
<div class="title"> :value="(item.resInfo.memoryUsage * 100).toFixed(2)"
<span>内存详细信息</span> :name="'memoryUsage'"
</div> :id="'gauge-memory-' + item.id">
<div class="gauge-echart"> </m-gauge>
<div id="a4" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="gridb-model"> <div class="text-num-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="value-p"> <div class="value-p">
<b style="color: #7a56b8;">72</b> <b :style="{color:color[$index]}">{{item.resInfo.loadAverage}}</b>
</div> </div>
<div class="text-1"> <div class="text-1">
cpu loadAverage
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>Cpu详细信息</span>
</div>
<div class="gauge-echart">
<div id="a5" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="gauge-echart">
<div id="a6" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="value-p">
<b style="color: #e84d80;">44</b>
</div>
<div class="text-1">
cpu
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
<m-spin :is-spin="isLoading"></m-spin>
</template> </template>
</m-list-construction> </m-list-construction>
</template> </template>
<script> <script>
import _ from 'lodash'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import mList from './_source/list' import mGauge from './_source/gauge'
import mList from './_source/zookeeperList'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import gaugeOption from './_source/gaugeOption' import themeData from '@/module/echarts/themeData.json'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
name: 'servers-master', name: 'servers-master',
data () { data () {
return { return {
pageSize: 10,
pageNo: 1,
totalPage: null,
searchVal: '',
isLoading: false, isLoading: false,
masterList: [] masterList: [],
color: themeData.color
} }
}, },
props: {}, props: {},
methods: { methods: {
...mapActions('security', ['getProcessMasterList']) ...mapActions('monitor', ['getMasterData'])
}, },
watch: {}, watch: {},
created () { created () {
}, },
mounted () { mounted () {
let b = {} this.isLoading = true
let a = ['a1', 'a2', 'a3', 'a4', 'a5', 'a6'] this.getMasterData().then(res => {
a.forEach((v, i) => { this.masterList = _.map(res, (v, i) => {
b[v] = echarts.init(document.getElementById(v)) // eslint-disable-line return _.assign(v, {
b[v].setOption(gaugeOption, true) resInfo: JSON.parse(v.resInfo)
})
})
this.isLoading = false
}).catch(() => {
this.isLoading = false
}) })
}, },
components: { mList, mListConstruction, mSpin, mNoData } components: { mList, mListConstruction, mSpin, mNoData, mGauge }
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss"> <style lang="scss" rel="stylesheet/scss">

71
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/mysql.vue

@ -1,77 +1,112 @@
<template> <template>
<m-list-construction :title="'Mysql管理'"> <m-list-construction :title="'Mysql管理'">
<template slot="content"> <template slot="content">
<div class="servers-wrapper"> <div class="servers-wrapper mysql-model">
<div class="row"> <div class="row" v-for="(item,$index) in mysqlList">
<div class="col-md-4"> <div class="col-md-2">
<div class="gridb-model"> <div class="text-num-model text">
<div class="title"> <div class="title">
<span>正常与否</span> <span>正常与否</span>
</div> </div>
<div class="value-p"> <div class="value-p">
<b style="color: #0098e1;">78</b> <span class="state">
<i class="iconfont success" v-if="item.state">&#xe607;</i>
<i class="iconfont error" v-else>&#xe626;</i>
</span>
</div> </div>
<div class="text-1"> <div class="text-1">
正常与否 正常与否
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-3">
<div class="gridb-model"> <div class="text-num-model text">
<div class="title"> <div class="title">
<span>最大连接数</span> <span>最大连接数</span>
</div> </div>
<div class="value-p"> <div class="value-p">
<b style="color: #ffcf3d;">55</b> <b :style="{color:color[0]}">{{item.maxConnections}}</b>
</div> </div>
<div class="text-1"> <div class="text-1">
最大连接数 最大连接数
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-3">
<div class="gridb-model"> <div class="text-num-model text">
<div class="title"> <div class="title">
<span>当前活跃连接</span> <span>当前活跃连接</span>
</div> </div>
<div class="value-p"> <div class="value-p">
<b style="color: #f07d7d;">32</b> <b :style="{color:color[8]}">{{item.threadsConnections}}</b>
</div> </div>
<div class="text-1"> <div class="text-1">
当前活跃连接 当前活跃连接
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-2">
<div class="text-num-model text">
<div class="title">
<span>最大连接数</span>
</div>
<div class="value-p">
<b :style="{color:color[2]}">{{item.maxUsedConnections}}</b>
</div>
<div class="text-1">
最大连接数
</div>
</div>
</div>
<div class="col-md-2">
<div class="text-num-model text">
<div class="title">
<span>线程运行连接</span>
</div>
<div class="value-p">
<b :style="{color:color[4]}">{{item.threadsRunningConnections}}</b>
</div>
<div class="text-1">
线程运行连接
</div>
</div>
</div>
</div> </div>
</div> </div>
<m-spin :is-spin="isLoading" ></m-spin>
</template> </template>
</m-list-construction> </m-list-construction>
</template> </template>
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import mList from './_source/list' import mList from './_source/zookeeperList'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import themeData from '@/module/echarts/themeData.json'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
name: 'servers-mysql', name: 'servers-mysql',
data () { data () {
return { return {
pageSize: 10,
pageNo: 1,
totalPage: null,
searchVal: '',
isLoading: false, isLoading: false,
masterList: [] mysqlList: [],
color: themeData.color
} }
}, },
props: {}, props: {},
methods: { methods: {
...mapActions('security', ['getProcessMasterList']) ...mapActions('monitor', ['getDatabaseData'])
}, },
watch: {}, watch: {},
created () { created () {
this.isLoading = true
this.getDatabaseData().then(res => {
this.mysqlList = res
this.isLoading = false
}).catch(() => {
this.isLoading = false
})
}, },
mounted () { mounted () {
}, },

99
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/servers.scss

@ -1,27 +1,46 @@
.servers-wrapper { .servers-wrapper {
padding: 16px; padding: 16px;
>.row { .gauge-model {
margin-bottom: 20px;
}
.gridb-model {
width: 100%; width: 100%;
height: 360px; height: 360px;
overflow: hidden; overflow: hidden;
margin: 0 auto;
.gauge-echart {
width: 350px;
margin: auto;
margin-bottom: -80px;
}
.text-1 {
width: 100%;
margin: 0 auto;
font-size: 32px;
text-align: center;
}
}
.text-num-model {
&.text {
width: 100%;
height: 380px;
overflow: hidden;
border: 1px solid #E8E8E8; border: 1px solid #E8E8E8;
margin: 0 auto; margin: 0 auto;
margin-bottom: 16px;
>.title { >.title {
height: 36px; height: 36px;
line-height: 36px; line-height: 36px;
background: #F9F9F9; background: #F9F9F9;
border-bottom: 1px solid #E8E8E8; border-bottom: 1px solid #E8E8E8;
span { padding-left: 10px;
padding-left: 8px;
} }
} }
.gauge-echart { .value-p {
width: 350px; height: 276px;
margin: auto; line-height: 276px;
margin-bottom: -80px; text-align: center;
>b {
font-size: 100px;
color: #333;
}
} }
.text-1 { .text-1 {
width: 100%; width: 100%;
@ -29,16 +48,64 @@
font-size: 32px; font-size: 32px;
text-align: center; text-align: center;
} }
}
&.mysql-model {
.text-num-model {
height: 260px;
.text-1 {
font-size: 20px;
}
.value-p { .value-p {
height: 254px; height: 160px;
line-height: 254px; line-height: 160px;
text-align: center;
>b { >b {
font-size: 140px; font-size: 80px;
color: #333; }
>.state {
>i {
font-size: 50px;
}
.success {
color: #33cc00;
}
.error {
color: #ff0000;
}
}
}
}
}
.row-box {
width: 100%;
height: 380px;
overflow: hidden;
border: 1px solid #E8E8E8;
margin: 0 auto;
margin-bottom: 16px;
.row-title {
height: 36px;
line-height: 36px;
background: #F9F9F9;
border-bottom: 1px solid #E8E8E8;
position: relative;
span {
font-size: 12px;
color: #444;
&.sp {
margin-right: 10px;
}
}
.left {
position: absolute;
left: 10px;
top: 0;
}
.right {
position: absolute;
right: 10px;
top: 0;
} }
} }
} }
} }

163
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/worker.vue

@ -2,170 +2,91 @@
<m-list-construction :title="'Worker管理'"> <m-list-construction :title="'Worker管理'">
<template slot="content"> <template slot="content">
<div class="servers-wrapper"> <div class="servers-wrapper">
<div class="row"> <div class="row-box" v-for="(item,$index) in workerList">
<div class="col-md-4"> <div class="row-title">
<div class="gridb-model"> <div class="left">
<div class="title"> <span class="sp">IP: {{item.host}}</span>
<span>Cpu详细信息</span> <span class="sp">端口: {{item.port}}</span>
</div> <span class="sp">zk注册目录: {{item.zkDirectory}}</span>
<div class="gauge-echart">
<div id="a1" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div> </div>
<div class="right">
<span class="sp">创建时间: {{item.createTime | formatDate}}</span>
<span class="sp">最后心跳时间: {{item.lastHeartbeatTime | formatDate}}</span>
</div> </div>
</div> </div>
<div class="row-cont">
<div class="col-md-4"> <div class="col-md-4">
<div class="gridb-model"> <m-gauge
<div class="title"> :value="(item.resInfo.cpuUsage * 100).toFixed(2)"
<span>内存详细信息</span> :name="'cpuUsage'"
</div> :id="'gauge-cpu-' + item.id">
<div class="gauge-echart"> </m-gauge>
<div id="a2" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="gridb-model"> <m-gauge
<div class="title"> :value="(item.resInfo.memoryUsage * 100).toFixed(2)"
<span>内存详细信息</span> :name="'memoryUsage'"
</div> :id="'gauge-memory-' + item.id">
<div class="value-p"> </m-gauge>
<b style="color: #0098e1;">83</b>
</div>
<div class="text-1">
cpu
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>Cpu详细信息</span>
</div>
<div class="gauge-echart">
<div id="a3" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="gridb-model"> <div class="text-num-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="gauge-echart">
<div id="a4" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="value-p"> <div class="value-p">
<b style="color: #7281c2;">18</b> <b :style="{color:color[$index]}">{{item.resInfo.loadAverage}}</b>
</div> </div>
<div class="text-1"> <div class="text-1">
cpu loadAverage
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>Cpu详细信息</span>
</div>
<div class="gauge-echart">
<div id="a5" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="gauge-echart">
<div id="a6" style="height: 380px;"></div>
</div>
<div class="text-1" style="margin-top: -126px">
cpu
</div>
</div>
</div>
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>内存详细信息</span>
</div>
<div class="value-p">
<b style="color: #f2ac6f;">15</b>
</div> </div>
<div class="text-1">
cpu
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<m-spin :is-spin="isLoading"></m-spin>
</template> </template>
</m-list-construction> </m-list-construction>
</template> </template>
<script> <script>
import _ from 'lodash'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import mList from './_source/list' import mGauge from './_source/gauge'
import mList from './_source/zookeeperList'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import gaugeOption from './_source/gaugeOption' import themeData from '@/module/echarts/themeData.json'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
name: 'servers-worker', name: 'servers-worker',
data () { data () {
return { return {
pageSize: 10,
pageNo: 1,
totalPage: null,
searchVal: '',
isLoading: false, isLoading: false,
masterList: [] workerList: [],
color: themeData.color
} }
}, },
props: {}, props: {},
methods: { methods: {
...mapActions('security', ['getProcessMasterList']) ...mapActions('monitor', ['getWorkerData'])
}, },
watch: {}, watch: {},
created () { created () {
}, },
mounted () { mounted () {
let b = {} this.isLoading = true
let a = ['a1', 'a2', 'a3', 'a4', 'a5', 'a6'] this.getWorkerData().then(res => {
a.forEach((v, i) => { this.workerList = _.map(res, (v, i) => {
b[v] = echarts.init(document.getElementById(v)) // eslint-disable-line return _.assign(v, {
b[v].setOption(gaugeOption, true) resInfo: JSON.parse(v.resInfo)
})
})
this.isLoading = false
}).catch(() => {
this.isLoading = true
}) })
}, },
components: { mList, mListConstruction, mSpin, mNoData } components: { mList, mListConstruction, mSpin, mNoData, mGauge }
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss"> <style lang="scss" rel="stylesheet/scss">

20
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/zookeeper.vue

@ -13,7 +13,7 @@
</template> </template>
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import mList from './_source/list' import mList from './_source/zookeeperList'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
@ -22,24 +22,30 @@
name: 'servers-zookeeper', name: 'servers-zookeeper',
data () { data () {
return { return {
pageSize: 10,
pageNo: 1,
totalPage: null,
searchVal: '',
isLoading: false, isLoading: false,
zookeeperList: [] zookeeperList: []
} }
}, },
props: {}, props: {},
methods: { methods: {
...mapActions('security', ['getProcessMasterList']) ...mapActions('monitor', ['getZookeeperData'])
}, },
watch: {}, watch: {},
created () { created () {
this.zookeeperList = [{ id: 1 }, { id: 1 }, { id: 1 }, { id: 1 }] this.isLoading = true
this.getZookeeperData().then(res => {
this.zookeeperList = res
this.isLoading = false
}).catch(() => {
this.isLoading = false
})
}, },
mounted () { mounted () {
}, },
components: { mList, mListConstruction, mSpin, mNoData } components: { mList, mListConstruction, mSpin, mNoData }
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss">
@import "./servers";
</style>

2
escheduler-ui/src/js/conf/home/pages/projects/pages/_source/taskRecordList/_source/list.vue

@ -67,8 +67,6 @@
</div> </div>
</template> </template>
<script> <script>
import '@/module/filter/formatDate'
export default { export default {
name: 'list', name: 'list',
data () { data () {

1
escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue

@ -72,7 +72,6 @@
import mStart from './start' import mStart from './start'
import mTiming from './timing' import mTiming from './timing'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import { publishStatus } from '@/conf/home/pages/dag/_source/config' import { publishStatus } from '@/conf/home/pages/dag/_source/config'
export default { export default {

1
escheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue

@ -116,7 +116,6 @@
<script> <script>
import _ from 'lodash' import _ from 'lodash'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mTiming from '../../pages/list/_source/timing' import mTiming from '../../pages/list/_source/timing'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'

1
escheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue

@ -250,7 +250,6 @@
<script> <script>
import _ from 'lodash' import _ from 'lodash'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import { tasksState, runningType } from '@/conf/home/pages/dag/_source/config' import { tasksState, runningType } from '@/conf/home/pages/dag/_source/config'
export default { export default {

1
escheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/list.vue

@ -82,7 +82,6 @@
</div> </div>
</template> </template>
<script> <script>
import '@/module/filter/formatDate'
import { mapActions, mapMutations } from 'vuex' import { mapActions, mapMutations } from 'vuex'
import localStore from '@/module/util/localStorage' import localStore from '@/module/util/localStorage'
import { findComponentDownward } from '@/module/util/' import { findComponentDownward } from '@/module/util/'

1
escheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/_source/list.vue

@ -77,7 +77,6 @@
</div> </div>
</template> </template>
<script> <script>
import '@/module/filter/formatDate'
import Permissions from '@/module/permissions' import Permissions from '@/module/permissions'
import mLog from '@/conf/home/pages/dag/_source/formModel/log' import mLog from '@/conf/home/pages/dag/_source/formModel/log'
import { tasksState } from '@/conf/home/pages/dag/_source/config' import { tasksState } from '@/conf/home/pages/dag/_source/config'

1
escheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue

@ -107,7 +107,6 @@
import _ from 'lodash' import _ from 'lodash'
import mRename from './rename' import mRename from './rename'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import { filtTypeArr } from '../../_source/common' import { filtTypeArr } from '../../_source/common'
import { bytesToSize } from '@/module/util/util' import { bytesToSize } from '@/module/util/util'
import { downloadFile } from '@/module/download' import { downloadFile } from '@/module/download'

1
escheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue

@ -102,7 +102,6 @@
</template> </template>
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import mCreateUdf from './createUdf' import mCreateUdf from './createUdf'
export default { export default {

1
escheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/_source/list.vue

@ -101,7 +101,6 @@
</template> </template>
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import mRename from './rename' import mRename from './rename'
import { downloadFile } from '@/module/download' import { downloadFile } from '@/module/download'
import { bytesToSize } from '@/module/util/util' import { bytesToSize } from '@/module/util/util'

1
escheduler-ui/src/js/conf/home/pages/security/pages/queue/_source/list.vue

@ -79,7 +79,6 @@
</template> </template>
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
export default { export default {
name: 'tenement-list', name: 'tenement-list',

2
escheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/list.vue

@ -85,7 +85,7 @@
</template> </template>
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
export default { export default {
name: 'tenement-list', name: 'tenement-list',

1
escheduler-ui/src/js/conf/home/pages/security/pages/users/_source/list.vue

@ -98,7 +98,6 @@
import _ from 'lodash' import _ from 'lodash'
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import mTransfer from '@/module/components/transfer/transfer' import mTransfer from '@/module/components/transfer/transfer'
export default { export default {

1
escheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/_source/list.vue

@ -71,7 +71,6 @@
import _ from 'lodash' import _ from 'lodash'
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import mTransfer from '@/module/components/transfer/transfer' import mTransfer from '@/module/components/transfer/transfer'
export default { export default {

1
escheduler-ui/src/js/conf/home/pages/security/pages/workerGroups/_source/list.vue

@ -65,7 +65,6 @@
// import _ from 'lodash' // import _ from 'lodash'
// import i18n from '@/module/i18n' // import i18n from '@/module/i18n'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
export default { export default {
name: 'user-list', name: 'user-list',

1
escheduler-ui/src/js/conf/home/pages/user/pages/account/_source/info.vue

@ -58,7 +58,6 @@
</template> </template>
<script> <script>
import { mapState, mapMutations } from 'vuex' import { mapState, mapMutations } from 'vuex'
import '@/module/filter/formatDate'
import mListBoxF from '@/module/components/listBoxF/listBoxF' import mListBoxF from '@/module/components/listBoxF/listBoxF'
import mCreateUser from '@/conf/home/pages/security/pages/users/_source/createUser' import mCreateUser from '@/conf/home/pages/security/pages/users/_source/createUser'

1
escheduler-ui/src/js/conf/home/pages/user/pages/password/_source/info.vue

@ -39,7 +39,6 @@
<script> <script>
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import { mapState, mapActions } from 'vuex' import { mapState, mapActions } from 'vuex'
import '@/module/filter/formatDate'
import mListBoxF from '@/module/components/listBoxF/listBoxF' import mListBoxF from '@/module/components/listBoxF/listBoxF'
export default { export default {

1
escheduler-ui/src/js/conf/home/pages/user/pages/token/_source/list.vue

@ -71,7 +71,6 @@
</template> </template>
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate'
export default { export default {
name: 'token-list', name: 'token-list',

4
escheduler-ui/src/js/conf/home/store/index.js

@ -22,6 +22,7 @@ import resource from './resource'
import security from './security' import security from './security'
import datasource from './datasource' import datasource from './datasource'
import user from './user' import user from './user'
import monitor from './monitor'
export default new Vuex.Store({ export default new Vuex.Store({
modules: { modules: {
@ -30,6 +31,7 @@ export default new Vuex.Store({
resource, resource,
security, security,
datasource, datasource,
user user,
monitor
} }
}) })

57
escheduler-ui/src/js/conf/home/store/monitor/actions.js

@ -0,0 +1,57 @@
/*
* 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.
*/
import io from '@/module/io'
export default {
getMasterData ({ state }, payload) {
return new Promise((resolve, reject) => {
io.get(`monitor/master/list`, payload, res => {
resolve(res.data)
}).catch(e => {
reject(e)
})
})
},
getWorkerData ({ state }, payload) {
return new Promise((resolve, reject) => {
io.get(`monitor/worker/list`, payload, res => {
resolve(res.data)
}).catch(e => {
reject(e)
})
})
},
getDatabaseData ({ state }, payload) {
return new Promise((resolve, reject) => {
io.get(`monitor/database`, payload, res => {
resolve(res.data)
}).catch(e => {
reject(e)
})
})
},
getZookeeperData ({ state }, payload) {
return new Promise((resolve, reject) => {
io.get(`monitor/zookeeper/list`, payload, res => {
resolve(res.data)
}).catch(e => {
reject(e)
})
})
}
}

19
escheduler-ui/src/js/conf/home/store/monitor/getters.js

@ -0,0 +1,19 @@
/*
* 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.
*/
export default {
}

30
escheduler-ui/src/js/conf/home/store/monitor/index.js

@ -0,0 +1,30 @@
/*
* 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.
*/
import actions from './actions'
import getters from './getters'
import mutations from './mutations'
import state from './state'
export default {
strict: true,
namespaced: true,
state,
getters,
mutations,
actions
}

19
escheduler-ui/src/js/conf/home/store/monitor/mutations.js

@ -0,0 +1,19 @@
/*
* 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.
*/
export default {
}

18
escheduler-ui/src/js/conf/home/store/monitor/state.js

@ -0,0 +1,18 @@
/*
* 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.
*/
export default {
}
Loading…
Cancel
Save