Browse Source

Merge remote-tracking branch 'remotes/upstream/dev-20190415' into dev-20190415

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

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

@ -1,11 +1,129 @@
<template>
<m-list-construction :title="$t('Service-Master')">
<m-list-construction :title="'Master管理'">
<template slot="content">
<div class="servers-wrapper">
<div class="row">
<div class="col-md-4">.col-md-8</div>
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4">
<div class="gridb-model">
<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>
</template>
@ -16,6 +134,7 @@
import mList from './_source/list'
import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData'
import gaugeOption from './_source/gaugeOption'
import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default {
@ -36,14 +155,20 @@
},
watch: {},
created () {
this.isLoading = true
this.getProcessMasterList().then(res => {
this.masterList = res.data
this.isLoading = false
})
},
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 }
}
</script>
<style lang="scss" rel="stylesheet/scss">
@import "./servers";
</style>

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

@ -1,40 +1,83 @@
<template>
<div class="mysql-model">
mysql
</div>
<m-list-construction :title="'Mysql管理'">
<template slot="content">
<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>
<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 {
name: 'mysql',
name: 'servers-mysql',
data () {
return {}
return {
pageSize: 10,
pageNo: 1,
totalPage: null,
searchVal: '',
isLoading: false,
masterList: []
}
},
props: {},
methods: {},
watch: {},
beforeCreate () {
methods: {
...mapActions('security', ['getProcessMasterList'])
},
watch: {},
created () {
},
beforeMount () {
},
mounted () {
},
beforeUpdate () {
},
updated () {
},
beforeDestroy () {
},
destroyed () {
},
computed: {},
components: {}
components: { mList, mListConstruction, mSpin, mNoData }
}
</script>
<style lang="scss" rel="stylesheet/scss">
.mysql-model {
}
</style>
@import "./servers";
</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>
<m-list-construction :title="$t('Service-Worker')">
<m-list-construction :title="'Worker管理'">
<template slot="content">
<template v-if="workerList.length">
<m-list :list="workerList"></m-list>
</template>
<template v-if="!workerList.length">
<m-no-data></m-no-data>
</template>
<m-spin :is-spin="isLoading" ></m-spin>
<div class="servers-wrapper">
<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="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>
</m-list-construction>
</template>
@ -16,10 +134,11 @@
import mList from './_source/list'
import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData'
import gaugeOption from './_source/gaugeOption'
import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default {
name: 'worker-index',
name: 'servers-worker',
data () {
return {
pageSize: 10,
@ -27,23 +146,28 @@
totalPage: null,
searchVal: '',
isLoading: false,
workerList: []
masterList: []
}
},
props: {},
methods: {
...mapActions('security', ['getProcessWorkerList'])
...mapActions('security', ['getProcessMasterList'])
},
watch: {},
created () {
this.isLoading = true
this.getProcessWorkerList().then(res => {
this.workerList = res.data
this.isLoading = false
})
},
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 }
}
</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>
<m-list-construction :title="$t('Service-Master')">
<m-list-construction :title="'Zookeeper管理'">
<template slot="content">
<template v-if="masterList.length">
<m-list :list="masterList"></m-list>
<template v-if="zookeeperList.length">
<m-list :list="zookeeperList"></m-list>
</template>
<template v-if="!masterList.length">
<template v-if="!zookeeperList.length">
<m-no-data></m-no-data>
</template>
<m-spin :is-spin="isLoading" ></m-spin>
@ -27,7 +27,7 @@
totalPage: null,
searchVal: '',
isLoading: false,
masterList: []
zookeeperList: []
}
},
props: {},
@ -36,11 +36,7 @@
},
watch: {},
created () {
this.isLoading = true
this.getProcessMasterList().then(res => {
this.masterList = res.data
this.isLoading = false
})
this.zookeeperList = [{ id: 1 }, { id: 1 }, { id: 1 }, { id: 1 }]
},
mounted () {
},

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

@ -93,10 +93,10 @@
import dayjs from 'dayjs'
import { mapActions } from 'vuex'
import { pie, bar } from './chartConfig'
import { stateType } from '@/conf/home/pages/projects/pages/_source/instanceConditions/common'
import Chart from '~/@analysys/ana-charts'
import mNoData from '@/module/components/noData/noData'
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 {

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

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

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

@ -9,7 +9,12 @@
</template>
<template slot="content">
<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">
<x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page>
</div>
@ -60,6 +65,9 @@
_page (val) {
this.searchParams.pageNo = val
},
_onEdit (item) {
this._create(item)
},
_create (item) {
let self = this
let modal = this.$modal.dialog({

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

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

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

@ -9,7 +9,12 @@
</template>
<template slot="content">
<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">
<x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page>
</div>
@ -60,6 +65,9 @@
_page (val) {
this.searchParams.pageNo = val
},
_onEdit (item) {
this._create(item)
},
_create (item) {
let self = this
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 { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import { findComponentDownward } from '@/module/util/'
import mTransfer from '@/module/components/transfer/transfer'
export default {
@ -132,7 +131,7 @@
})
},
_edit (item) {
findComponentDownward(this.$root, 'users-index')._create(item)
this.$emit('on-edit', item)
},
_authProject (item, i) {
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 slot="content">
<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">
<x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page>
</div>
@ -60,6 +65,9 @@
_page (val) {
this.searchParams.pageNo = val
},
_onEdit (item) {
this._create(item)
},
_create (item) {
let self = this
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 { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import { findComponentDownward } from '@/module/util/'
import mTransfer from '@/module/components/transfer/transfer'
export default {
@ -105,7 +104,7 @@
})
},
_edit (item) {
findComponentDownward(this.$root, 'warning-groups-index')._create(item)
this.$emit('on-edit', item)
},
_mangeUser (item, i) {
this.getAuthList({

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

@ -9,7 +9,12 @@
</template>
<template slot="content">
<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">
<x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page>
</div>
@ -60,6 +65,9 @@
_page (val) {
this.searchParams.pageNo = val
},
_onEdit (item) {
this._create(item)
},
_create (item) {
let self = this
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 { mapActions } from 'vuex'
import '@/module/filter/formatDate'
import { findComponentDownward } from '@/module/util/'
export default {
name: 'user-list',
@ -98,7 +97,7 @@
})
},
_edit (item) {
findComponentDownward(this.$root, 'worker-groups-index')._create(item)
this.$emit('on-edit', item)
}
},
watch: {

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

@ -9,7 +9,11 @@
</template>
<template slot="content">
<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">
<x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page>
</div>
@ -60,6 +64,9 @@
_page (val) {
this.searchParams.pageNo = val
},
_onEdit (item) {
this._create(item)
},
_create (item) {
let self = this
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>
</template>
</m-list-box-f>
<m-list-box-f>
<m-list-box-f v-if="auth">
<template slot="name"><b>*</b>用户</template>
<template slot="content">
<x-select v-model="userId" @on-change="_onChange">
@ -53,6 +53,7 @@
import dayjs from 'dayjs'
// import i18n from '@/module/i18n'
import store from '@/conf/home/store'
import Permissions from '@/module/permissions'
import mPopup from '@/module/components/popup/popup'
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,
token: '',
userIdList: [],
tokenLoading: false
tokenLoading: false,
auth: !Permissions.getAuth()
}
},
props: {
@ -128,16 +130,23 @@
},
watch: {},
created () {
this.store.dispatch(`security/getUsersList`).then(res => {
this.userIdList = _.map(res, v => _.pick(v, ['id', 'userName']))
const d = (userId) => {
if (this.item) {
this.expireTime = this.item.expireTime
this.userId = this.item.userId
this.token = this.item.token
} 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 () {
},

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

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

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

@ -9,7 +9,12 @@
</template>
<template slot="content">
<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">
<x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page"></x-page>
</div>
@ -61,6 +66,9 @@
_page (val) {
this.searchParams.pageNo = val
},
_onEdit (item) {
this._create(item)
},
_create (item) {
let self = this
let modal = this.$modal.dialog({

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

@ -325,6 +325,14 @@ const router = new Router({
meta: {
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
list.unshift({
id: -1,
name: 'All'
name: 'Default'
})
state.workerGroupsListAll = list
resolve(list)

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

@ -117,6 +117,15 @@ let menu = {
disabled: true,
icon: 'fa-address-book',
children: []
},
{
name: `令牌管理`,
id: 2,
path: 'token-manage',
isOpen: true,
icon: 'fa-file-text',
children: [],
disabled: true
}
],
resource: [
@ -178,7 +187,7 @@ let menu = {
isOpen: true,
icon: 'fa-file-text',
children: [],
disabled: !Permissions.getAuth()
disabled: Permissions.getAuth()
}
],
monitor: [

Loading…
Cancel
Save