|
@@ -1,6 +1,18 @@
|
|
|
<template>
|
|
<template>
|
|
|
<el-container>
|
|
<el-container>
|
|
|
<el-main class="movie-list">
|
|
<el-main class="movie-list">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <h3>我的角色</h3>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-for="(item, index) in roles"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ icon="el-icon-user-solid"
|
|
|
|
|
+ style="padding: 5px"
|
|
|
|
|
+ @click="goToRole(item)"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ item }}
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
<div v-if="devops">
|
|
<div v-if="devops">
|
|
|
<el-col :md="12" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
<el-col :md="12" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
|
<el-card class="box-card">
|
|
<el-card class="box-card">
|
|
@@ -108,17 +120,21 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import { getDashboard } from '@/api/devops'
|
|
import { getDashboard } from '@/api/devops'
|
|
|
|
|
+import { getAuthedUser } from '@/utils/auth'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'Dashboard',
|
|
name: 'Dashboard',
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ roles: [],
|
|
|
devops: false,
|
|
devops: false,
|
|
|
machineStatList: [],
|
|
machineStatList: [],
|
|
|
sysInfo: null
|
|
sysInfo: null
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
|
|
+ const { roles, userId, avatarUrl, username } = getAuthedUser()
|
|
|
|
|
+ this.roles = roles
|
|
|
this.devops = parseInt(process.env.VUE_APP_DEVOPS) === 1
|
|
this.devops = parseInt(process.env.VUE_APP_DEVOPS) === 1
|
|
|
document.title = 'Dashboard'
|
|
document.title = 'Dashboard'
|
|
|
this.getData()
|
|
this.getData()
|
|
@@ -141,6 +157,9 @@ export default {
|
|
|
this.$message.error(error.message)
|
|
this.$message.error(error.message)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ goToRole(data) {
|
|
|
|
|
+ this.$message.info('role -> ' + data)
|
|
|
|
|
+ },
|
|
|
goToDisk() {
|
|
goToDisk() {
|
|
|
const path = '/disk'
|
|
const path = '/disk'
|
|
|
if (this.$route.path === path) {
|
|
if (this.$route.path === path) {
|