Browse Source

监控中心

pull/2/head
gongzijian 6 years ago
parent
commit
a473034242
  1. 2
      escheduler-ui/.env
  2. 121
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/gaugeOption.js
  3. 37
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/list.vue
  4. 143
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/master.vue
  5. 91
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/mysql.vue
  6. 44
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/servers.scss
  7. 156
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/worker.vue
  8. 16
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/zookeeper.vue
  9. 4
      escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue
  10. 3
      escheduler-ui/src/js/conf/home/pages/security/pages/queue/_source/list.vue
  11. 10
      escheduler-ui/src/js/conf/home/pages/security/pages/queue/index.vue
  12. 3
      escheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/list.vue
  13. 10
      escheduler-ui/src/js/conf/home/pages/security/pages/tenement/index.vue
  14. 39
      escheduler-ui/src/js/conf/home/pages/security/pages/token/index.vue
  15. 3
      escheduler-ui/src/js/conf/home/pages/security/pages/users/_source/list.vue
  16. 10
      escheduler-ui/src/js/conf/home/pages/security/pages/users/index.vue
  17. 3
      escheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/_source/list.vue
  18. 10
      escheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/index.vue
  19. 3
      escheduler-ui/src/js/conf/home/pages/security/pages/workerGroups/_source/list.vue
  20. 9
      escheduler-ui/src/js/conf/home/pages/security/pages/workerGroups/index.vue
  21. 21
      escheduler-ui/src/js/conf/home/pages/user/pages/token/_source/createToken.vue
  22. 3
      escheduler-ui/src/js/conf/home/pages/user/pages/token/_source/list.vue
  23. 10
      escheduler-ui/src/js/conf/home/pages/user/pages/token/index.vue
  24. 8
      escheduler-ui/src/js/conf/home/router/index.js
  25. 2
      escheduler-ui/src/js/conf/home/store/security/actions.js
  26. 12
      escheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js

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访问项目把"#"号去掉 # 本地开发如需ip访问项目把"#"号去掉
#DEV_HOST = 192.168.xx.xx #DEV_HOST = 192.168.xx.xx

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

@ -0,0 +1,121 @@
export default {
series: [
{
type: 'gauge',
center: ['50%', '45%'], // 仪表位置
radius: '80%', // 仪表大小
startAngle: 200, // 开始角度
endAngle: -20, // 结束角度
axisLine: {
show: false,
lineStyle: { // 属性lineStyle控制线条样式
color: [
[ 0.5, new echarts.graphic.LinearGradient(0, 0, 1, 0, [{ // eslint-disable-line
offset: 1,
color: '#E75F25' // 50% 处的颜色
}, {
offset: 0.8,
color: '#D9452C' // 40% 处的颜色
}], false) ], // 100% 处的颜色
[ 0.7, new echarts.graphic.LinearGradient(0, 0, 1, 0, [{ // eslint-disable-line
offset: 1,
color: '#FFC539' // 70% 处的颜色
}, {
offset: 0.8,
color: '#FE951E' // 66% 处的颜色
}, {
offset: 0,
color: '#E75F25' // 50% 处的颜色
}], false) ],
[ 0.9, new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ // eslint-disable-line
offset: 1,
color: '#C7DD6B' // 90% 处的颜色
}, {
offset: 0.8,
color: '#FEEC49' // 86% 处的颜色
}, {
offset: 0,
color: '#FFC539' // 70% 处的颜色
}], false) ],
[1, new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { // eslint-disable-line
offset: 0.2,
color: '#1CAD52' // 92% 处的颜色
}, {
offset: 0,
color: '#C7DD6B' // 90% 处的颜色
}], false) ]
],
width: 10
}
},
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
show: false
},
pointer: { // 指针样式
length: '45%'
},
detail: {
show: false
}
},
{
type: 'gauge',
center: ['50%', '45%'], // 默认全局居中
radius: '70%',
startAngle: 200,
endAngle: -20,
axisLine: {
show: true,
lineStyle: { // 属性lineStyle控制线条样式
color: [ // 表盘颜色
[ 0.5, '#DA462C' ], // 0-50%处的颜色
[ 0.7, '#FF9618' ], // 51%-70%处的颜色
[ 0.9, '#FFED44' ], // 70%-90%处的颜色
[ 1, '#20AE51' ]// 90%-100%处的颜色
],
width: 30// 表盘宽度
}
},
splitLine: { // 分割线样式(及10、20等长线样式)
length: 30,
lineStyle: { // 属性lineStyle控制线条样式
width: 2
}
},
axisTick: { // 刻度线样式(及短线样式)
length: 20
},
axisLabel: { // 文字样式(及“10”、“20”等文字样式)
color: 'black',
distance: 5 // 文字离表盘的距离
},
detail: {
formatter: '{score|{value}%}',
offsetCenter: [0, '50%'],
backgroundColor: '#2D8BF0',
height: 30,
rich: {
score: {
color: 'white',
fontFamily: '微软雅黑',
fontSize: 32
}
}
},
data: [{
value: 70,
label: {
textStyle: {
fontSize: 12
}
}
}]
}
]
}

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

@ -7,25 +7,28 @@
<span>{{$t('#')}}</span> <span>{{$t('#')}}</span>
</th> </th>
<th> <th>
<span>{{$t('IP')}}</span> <span>node</span>
</th> </th>
<th> <th>
<span>{{$t('Process Pid')}}</span> <span>ip</span>
</th> </th>
<th> <th>
<span>{{$t('zk registration directory')}}</span> <span>模式</span>
</th> </th>
<th> <th>
<span>{{$t('cpuUsage')}}</span> <span>连接数</span>
</th> </th>
<th> <th>
<span>{{$t('memoryUsage')}}</span> <span>watch数</span>
</th> </th>
<th> <th>
<span>{{$t('Create Time')}}</span> <span>数据量</span>
</th> </th>
<th> <th>
<span>{{$t('Last heartbeat time')}}</span> <span>Sent/Received</span>
</th>
<th>
<span>节点自检状态</span>
</th> </th>
</tr> </tr>
<tr v-for="(item, $index) in list" :key="$index"> <tr v-for="(item, $index) in list" :key="$index">
@ -34,22 +37,25 @@
</td> </td>
<td> <td>
<span> <span>
<a href="javascript:" class="links">{{item.host}}</a> <a href="javascript:" class="links">task1</a>
</span> </span>
</td> </td>
<td><span>{{item.port}}</span></td> <td><span>192.11.1.1</span></td>
<td> <td>
<span>{{item.zkDirectory}}</span> <span>2222</span>
</td> </td>
<td> <td>
<span>{{_rtResInfo(JSON.parse(item.resInfo)['cpuUsage'])}}</span> <span>3333</span>
</td> </td>
<td> <td>
<span>{{_rtResInfo(JSON.parse(item.resInfo)['memoryUsage'])}}</span> <span>4444</span>
</td> </td>
<td><span>{{item.createTime | formatDate}}</span></td> <td><span>5555</span></td>
<td> <td>
<span>{{item.lastHeartbeatTime | formatDate}}</span> <span>6666</span>
</td>
<td>
<span>7777</span>
</td> </td>
</tr> </tr>
</table> </table>
@ -70,9 +76,6 @@
list: Array list: Array
}, },
methods: { methods: {
_rtResInfo (val) {
return (val * 100).toFixed(2) + ' %'
}
} }
} }
</script> </script>

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

@ -1,11 +1,129 @@
<template> <template>
<m-list-construction :title="$t('Service-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">
<div class="col-md-4">.col-md-8</div> <div class="col-md-4">
<div class="col-md-4">.col-md-4</div> <div class="gridb-model">
<div class="col-md-4">.col-md-4</div> <div class="title">
<span>Cpu详细信息</span>
</div>
<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>
</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 class="col-md-4">
<div class="gridb-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">
<b style="color: #7a56b8;">72</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="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>
</template> </template>
@ -16,6 +134,7 @@
import mList from './_source/list' import mList from './_source/list'
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 mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
@ -36,14 +155,20 @@
}, },
watch: {}, watch: {},
created () { created () {
this.isLoading = true
this.getProcessMasterList().then(res => {
this.masterList = res.data
this.isLoading = false
})
}, },
mounted () { mounted () {
let b = {}
let a = ['a1', 'a2', 'a3', 'a4', 'a5', 'a6']
a.forEach((v, i) => {
b[v] = echarts.init(document.getElementById(v)) // eslint-disable-line
b[v].setOption(gaugeOption, true)
})
}, },
components: { mList, mListConstruction, mSpin, mNoData } components: { mList, mListConstruction, mSpin, mNoData }
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss">
@import "./servers";
</style>

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

@ -1,40 +1,83 @@
<template> <template>
<div class="mysql-model"> <m-list-construction :title="'Mysql管理'">
mysql <template slot="content">
</div> <div class="servers-wrapper">
<div class="row">
<div class="col-md-4">
<div class="gridb-model">
<div class="title">
<span>正常与否</span>
</div>
<div class="value-p">
<b style="color: #0098e1;">78</b>
</div>
<div class="text-1">
正常与否
</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: #ffcf3d;">55</b>
</div>
<div class="text-1">
最大连接数
</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: #f07d7d;">32</b>
</div>
<div class="text-1">
当前活跃连接
</div>
</div>
</div>
</div>
</div>
</template>
</m-list-construction>
</template> </template>
<script> <script>
import { mapActions } from 'vuex'
import mList from './_source/list'
import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData'
import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
name: 'mysql', name: 'servers-mysql',
data () { data () {
return {} return {
pageSize: 10,
pageNo: 1,
totalPage: null,
searchVal: '',
isLoading: false,
masterList: []
}
}, },
props: {}, props: {},
methods: {}, methods: {
watch: {}, ...mapActions('security', ['getProcessMasterList'])
beforeCreate () {
}, },
watch: {},
created () { created () {
}, },
beforeMount () {
},
mounted () { mounted () {
}, },
beforeUpdate () { components: { mList, mListConstruction, mSpin, mNoData }
},
updated () {
},
beforeDestroy () {
},
destroyed () {
},
computed: {},
components: {}
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss"> <style lang="scss" rel="stylesheet/scss">
.mysql-model { @import "./servers";
}
</style> </style>

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

@ -0,0 +1,44 @@
.servers-wrapper {
padding: 16px;
>.row {
margin-bottom: 20px;
}
.gridb-model {
width: 100%;
height: 360px;
overflow: hidden;
border: 1px solid #E8E8E8;
margin: 0 auto;
>.title {
height: 36px;
line-height: 36px;
background: #F9F9F9;
border-bottom: 1px solid #E8E8E8;
span {
padding-left: 8px;
}
}
.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: 140px;
color: #333;
}
}
}
}

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

@ -1,13 +1,131 @@
<template> <template>
<m-list-construction :title="$t('Service-Worker')"> <m-list-construction :title="'Worker管理'">
<template slot="content"> <template slot="content">
<template v-if="workerList.length"> <div class="servers-wrapper">
<m-list :list="workerList"></m-list> <div class="row">
</template> <div class="col-md-4">
<template v-if="!workerList.length"> <div class="gridb-model">
<m-no-data></m-no-data> <div class="title">
</template> <span>Cpu详细信息</span>
<m-spin :is-spin="isLoading" ></m-spin> </div>
<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;">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 class="col-md-4">
<div class="gridb-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">
<b style="color: #7281c2;">18</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="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 class="text-1">
cpu
</div>
</div>
</div>
</div>
</div>
</template> </template>
</m-list-construction> </m-list-construction>
</template> </template>
@ -16,10 +134,11 @@
import mList from './_source/list' import mList from './_source/list'
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 mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
name: 'worker-index', name: 'servers-worker',
data () { data () {
return { return {
pageSize: 10, pageSize: 10,
@ -27,23 +146,28 @@
totalPage: null, totalPage: null,
searchVal: '', searchVal: '',
isLoading: false, isLoading: false,
workerList: [] masterList: []
} }
}, },
props: {}, props: {},
methods: { methods: {
...mapActions('security', ['getProcessWorkerList']) ...mapActions('security', ['getProcessMasterList'])
}, },
watch: {}, watch: {},
created () { created () {
this.isLoading = true
this.getProcessWorkerList().then(res => {
this.workerList = res.data
this.isLoading = false
})
}, },
mounted () { mounted () {
let b = {}
let a = ['a1', 'a2', 'a3', 'a4', 'a5', 'a6']
a.forEach((v, i) => {
b[v] = echarts.init(document.getElementById(v)) // eslint-disable-line
b[v].setOption(gaugeOption, true)
})
}, },
components: { mList, mListConstruction, mSpin, mNoData } components: { mList, mListConstruction, mSpin, mNoData }
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss">
@import "./servers";
</style>

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

@ -1,10 +1,10 @@
<template> <template>
<m-list-construction :title="$t('Service-Master')"> <m-list-construction :title="'Zookeeper管理'">
<template slot="content"> <template slot="content">
<template v-if="masterList.length"> <template v-if="zookeeperList.length">
<m-list :list="masterList"></m-list> <m-list :list="zookeeperList"></m-list>
</template> </template>
<template v-if="!masterList.length"> <template v-if="!zookeeperList.length">
<m-no-data></m-no-data> <m-no-data></m-no-data>
</template> </template>
<m-spin :is-spin="isLoading" ></m-spin> <m-spin :is-spin="isLoading" ></m-spin>
@ -27,7 +27,7 @@
totalPage: null, totalPage: null,
searchVal: '', searchVal: '',
isLoading: false, isLoading: false,
masterList: [] zookeeperList: []
} }
}, },
props: {}, props: {},
@ -36,11 +36,7 @@
}, },
watch: {}, watch: {},
created () { created () {
this.isLoading = true this.zookeeperList = [{ id: 1 }, { id: 1 }, { id: 1 }, { id: 1 }]
this.getProcessMasterList().then(res => {
this.masterList = res.data
this.isLoading = false
})
}, },
mounted () { mounted () {
}, },

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

@ -93,10 +93,10 @@
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { pie, bar } from './chartConfig' import { pie, bar } from './chartConfig'
import { stateType } from '@/conf/home/pages/projects/pages/_source/instanceConditions/common'
import Chart from '~/@analysys/ana-charts' import Chart from '~/@analysys/ana-charts'
import mNoData from '@/module/components/noData/noData'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData'
import { stateType } from '@/conf/home/pages/projects/pages/_source/instanceConditions/common'
export default { export default {

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

@ -80,7 +80,6 @@
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate' import '@/module/filter/formatDate'
import { findComponentDownward } from '@/module/util/'
export default { export default {
name: 'tenement-list', name: 'tenement-list',
@ -112,7 +111,7 @@
}) })
}, },
_edit (item) { _edit (item) {
findComponentDownward(this.$root, 'queue-index')._create(item) this.$emit('on-edit', item)
} }
}, },
watch: { watch: {

10
escheduler-ui/src/js/conf/home/pages/security/pages/queue/index.vue

@ -9,7 +9,12 @@
</template> </template>
<template slot="content"> <template slot="content">
<template v-if="queueList.length"> <template v-if="queueList.length">
<m-list :queue-list="queueList" :page-no="searchParams.pageNo" :page-size="searchParams.pageSize"></m-list> <m-list @on-edit="_onEdit"
:queue-list="queueList"
:page-no="searchParams.pageNo"
:page-size="searchParams.pageSize">
</m-list>
<div class="page-box"> <div class="page-box">
<x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page> <x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page>
</div> </div>
@ -60,6 +65,9 @@
_page (val) { _page (val) {
this.searchParams.pageNo = val this.searchParams.pageNo = val
}, },
_onEdit (item) {
this._create(item)
},
_create (item) { _create (item) {
let self = this let self = this
let modal = this.$modal.dialog({ let modal = this.$modal.dialog({

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

@ -86,7 +86,6 @@
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate' import '@/module/filter/formatDate'
import { findComponentDownward } from '@/module/util/'
export default { export default {
name: 'tenement-list', name: 'tenement-list',
@ -118,7 +117,7 @@
}) })
}, },
_edit (item) { _edit (item) {
findComponentDownward(this.$root, 'tenement-index')._create(item) this.$emit('on-edit', item)
} }
}, },
watch: { watch: {

10
escheduler-ui/src/js/conf/home/pages/security/pages/tenement/index.vue

@ -9,7 +9,12 @@
</template> </template>
<template slot="content"> <template slot="content">
<template v-if="tenementList.length"> <template v-if="tenementList.length">
<m-list :tenement-list="tenementList" :page-no="searchParams.pageNo" :page-size="searchParams.pageSize"></m-list> <m-list @on-edit="_onEdit"
:tenement-list="tenementList"
:page-no="searchParams.pageNo"
:page-size="searchParams.pageSize">
</m-list>
<div class="page-box"> <div class="page-box">
<x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page> <x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page>
</div> </div>
@ -60,6 +65,9 @@
_page (val) { _page (val) {
this.searchParams.pageNo = val this.searchParams.pageNo = val
}, },
_onEdit (item) {
this._create(item)
},
_create (item) { _create (item) {
let self = this let self = this
let modal = this.$modal.dialog({ let modal = this.$modal.dialog({

39
escheduler-ui/src/js/conf/home/pages/security/pages/token/index.vue

@ -0,0 +1,39 @@
<template>
<m-token></m-token>
</template>
<script>
import mToken from '@/conf/home/pages/user/pages/token'
export default {
name: 'token-index',
data () {
return {}
},
props: {},
methods: {},
watch: {},
beforeCreate () {
},
created () {
},
beforeMount () {
},
mounted () {
},
beforeUpdate () {
},
updated () {
},
beforeDestroy () {
},
destroyed () {
},
computed: {},
components: { mToken }
}
</script>
<style lang="scss" rel="stylesheet/scss">
.index-model {
}
</style>

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

@ -99,7 +99,6 @@
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate' import '@/module/filter/formatDate'
import { findComponentDownward } from '@/module/util/'
import mTransfer from '@/module/components/transfer/transfer' import mTransfer from '@/module/components/transfer/transfer'
export default { export default {
@ -132,7 +131,7 @@
}) })
}, },
_edit (item) { _edit (item) {
findComponentDownward(this.$root, 'users-index')._create(item) this.$emit('on-edit', item)
}, },
_authProject (item, i) { _authProject (item, i) {
this.$refs[`poptip-auth-${i}`][0].doClose() this.$refs[`poptip-auth-${i}`][0].doClose()

10
escheduler-ui/src/js/conf/home/pages/security/pages/users/index.vue

@ -9,7 +9,12 @@
</template> </template>
<template slot="content"> <template slot="content">
<template v-if="userList.length"> <template v-if="userList.length">
<m-list :user-list="userList" :page-no="searchParams.pageNo" :page-size="searchParams.pageSize"></m-list> <m-list @on-edit="_onEdit"
:user-list="userList"
:page-no="searchParams.pageNo"
:page-size="searchParams.pageSize">
</m-list>
<div class="page-box"> <div class="page-box">
<x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page> <x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page>
</div> </div>
@ -60,6 +65,9 @@
_page (val) { _page (val) {
this.searchParams.pageNo = val this.searchParams.pageNo = val
}, },
_onEdit (item) {
this._create(item)
},
_create (item) { _create (item) {
let self = this let self = this
let modal = this.$modal.dialog({ let modal = this.$modal.dialog({

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

@ -72,7 +72,6 @@
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate' import '@/module/filter/formatDate'
import { findComponentDownward } from '@/module/util/'
import mTransfer from '@/module/components/transfer/transfer' import mTransfer from '@/module/components/transfer/transfer'
export default { export default {
@ -105,7 +104,7 @@
}) })
}, },
_edit (item) { _edit (item) {
findComponentDownward(this.$root, 'warning-groups-index')._create(item) this.$emit('on-edit', item)
}, },
_mangeUser (item, i) { _mangeUser (item, i) {
this.getAuthList({ this.getAuthList({

10
escheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/index.vue

@ -9,7 +9,12 @@
</template> </template>
<template slot="content"> <template slot="content">
<template v-if="alertgroupList.length"> <template v-if="alertgroupList.length">
<m-list :alertgroup-list="alertgroupList" :page-no="searchParams.pageNo" :page-size="searchParams.pageSize"></m-list> <m-list @on-edit="_onEdit"
:alertgroup-list="alertgroupList"
:page-no="searchParams.pageNo"
:page-size="searchParams.pageSize">
</m-list>
<div class="page-box"> <div class="page-box">
<x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page> <x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page>
</div> </div>
@ -60,6 +65,9 @@
_page (val) { _page (val) {
this.searchParams.pageNo = val this.searchParams.pageNo = val
}, },
_onEdit (item) {
this._create(item)
},
_create (item) { _create (item) {
let self = this let self = this
let modal = this.$modal.dialog({ let modal = this.$modal.dialog({

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

@ -66,7 +66,6 @@
// import i18n from '@/module/i18n' // import i18n from '@/module/i18n'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate' import '@/module/filter/formatDate'
import { findComponentDownward } from '@/module/util/'
export default { export default {
name: 'user-list', name: 'user-list',
@ -98,7 +97,7 @@
}) })
}, },
_edit (item) { _edit (item) {
findComponentDownward(this.$root, 'worker-groups-index')._create(item) this.$emit('on-edit', item)
} }
}, },
watch: { watch: {

9
escheduler-ui/src/js/conf/home/pages/security/pages/workerGroups/index.vue

@ -9,7 +9,11 @@
</template> </template>
<template slot="content"> <template slot="content">
<template v-if="workerGroupList.length"> <template v-if="workerGroupList.length">
<m-list :worker-group-list="workerGroupList" :page-no="searchParams.pageNo" :page-size="searchParams.pageSize"></m-list> <m-list @on-edit="_onEdit"
:worker-group-list="workerGroupList"
:page-no="searchParams.pageNo"
:page-size="searchParams.pageSize">
</m-list>
<div class="page-box"> <div class="page-box">
<x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page> <x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page>
</div> </div>
@ -60,6 +64,9 @@
_page (val) { _page (val) {
this.searchParams.pageNo = val this.searchParams.pageNo = val
}, },
_onEdit (item) {
this._create(item)
},
_create (item) { _create (item) {
let self = this let self = this
let modal = this.$modal.dialog({ let modal = this.$modal.dialog({

21
escheduler-ui/src/js/conf/home/pages/user/pages/token/_source/createToken.vue

@ -18,7 +18,7 @@
</x-datepicker> </x-datepicker>
</template> </template>
</m-list-box-f> </m-list-box-f>
<m-list-box-f> <m-list-box-f v-if="auth">
<template slot="name"><b>*</b>用户</template> <template slot="name"><b>*</b>用户</template>
<template slot="content"> <template slot="content">
<x-select v-model="userId" @on-change="_onChange"> <x-select v-model="userId" @on-change="_onChange">
@ -53,6 +53,7 @@
import dayjs from 'dayjs' import dayjs from 'dayjs'
// import i18n from '@/module/i18n' // import i18n from '@/module/i18n'
import store from '@/conf/home/store' import store from '@/conf/home/store'
import Permissions from '@/module/permissions'
import mPopup from '@/module/components/popup/popup' import mPopup from '@/module/components/popup/popup'
import mListBoxF from '@/module/components/listBoxF/listBoxF' import mListBoxF from '@/module/components/listBoxF/listBoxF'
@ -66,7 +67,8 @@
disabledDate: date => (date.getTime() - new Date(new Date().getTime() - 24 * 60 * 60 * 1000)) < 0, disabledDate: date => (date.getTime() - new Date(new Date().getTime() - 24 * 60 * 60 * 1000)) < 0,
token: '', token: '',
userIdList: [], userIdList: [],
tokenLoading: false tokenLoading: false,
auth: !Permissions.getAuth()
} }
}, },
props: { props: {
@ -128,16 +130,23 @@
}, },
watch: {}, watch: {},
created () { created () {
this.store.dispatch(`security/getUsersList`).then(res => { const d = (userId) => {
this.userIdList = _.map(res, v => _.pick(v, ['id', 'userName']))
if (this.item) { if (this.item) {
this.expireTime = this.item.expireTime this.expireTime = this.item.expireTime
this.userId = this.item.userId this.userId = this.item.userId
this.token = this.item.token this.token = this.item.token
} else { } else {
this.userId = this.userIdList[0].id this.userId = userId
} }
}) }
if (this.auth) {
this.store.dispatch(`security/getUsersList`).then(res => {
this.userIdList = _.map(res, v => _.pick(v, ['id', 'userName']))
d(this.userIdList[0].id)
})
} else {
d(this.store.state.user.userInfo.id)
}
}, },
mounted () { mounted () {
}, },

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

@ -72,7 +72,6 @@
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import '@/module/filter/formatDate' import '@/module/filter/formatDate'
import { findComponentDownward } from '@/module/util/'
export default { export default {
name: 'token-list', name: 'token-list',
@ -104,7 +103,7 @@
}) })
}, },
_edit (item) { _edit (item) {
findComponentDownward(this.$root, 'token-index')._create(item) this.$emit('on-edit', item)
} }
}, },
watch: { watch: {

10
escheduler-ui/src/js/conf/home/pages/user/pages/token/index.vue

@ -9,7 +9,12 @@
</template> </template>
<template slot="content"> <template slot="content">
<template v-if="tokenList.length"> <template v-if="tokenList.length">
<m-list :token-list="tokenList" :page-no="searchParams.pageNo" :page-size="searchParams.pageSize"></m-list> <m-list @on-edit="_onEdit"
:token-list="tokenList"
:page-no="searchParams.pageNo"
:page-size="searchParams.pageSize">
</m-list>
<div class="page-box"> <div class="page-box">
<x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page> <x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page>
</div> </div>
@ -61,6 +66,9 @@
_page (val) { _page (val) {
this.searchParams.pageNo = val this.searchParams.pageNo = val
}, },
_onEdit (item) {
this._create(item)
},
_create (item) { _create (item) {
let self = this let self = this
let modal = this.$modal.dialog({ let modal = this.$modal.dialog({

8
escheduler-ui/src/js/conf/home/router/index.js

@ -325,6 +325,14 @@ const router = new Router({
meta: { meta: {
title: `workerGroups` title: `workerGroups`
} }
},
{
path: '/security/token',
name: 'token-manage',
component: resolve => require(['../pages/security/pages/token/index'], resolve),
meta: {
title: `token`
}
} }
] ]
}, },

2
escheduler-ui/src/js/conf/home/store/security/actions.js

@ -435,7 +435,7 @@ export default {
let list = res.data let list = res.data
list.unshift({ list.unshift({
id: -1, id: -1,
name: 'All' name: 'Default'
}) })
state.workerGroupsListAll = list state.workerGroupsListAll = list
resolve(list) resolve(list)

12
escheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js

@ -17,6 +17,7 @@
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import config from '~/external/config' import config from '~/external/config'
import Permissions from '@/module/permissions'
let menu = { let menu = {
projects: [ projects: [
@ -116,6 +117,15 @@ let menu = {
disabled: true, disabled: true,
icon: 'fa-address-book', icon: 'fa-address-book',
children: [] children: []
},
{
name: `令牌管理`,
id: 2,
path: 'token-manage',
isOpen: true,
icon: 'fa-file-text',
children: [],
disabled: true
} }
], ],
resource: [ resource: [
@ -177,7 +187,7 @@ let menu = {
isOpen: true, isOpen: true,
icon: 'fa-file-text', icon: 'fa-file-text',
children: [], children: [],
disabled: true disabled: Permissions.getAuth()
} }
], ],
monitor: [ monitor: [

Loading…
Cancel
Save