Skip to content

Commit

Permalink
Added ROLE_MANAGE role (opengoofy#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
magestacks authored and iwangjie committed Nov 14, 2022
1 parent 9b1c544 commit 76d6ead
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 27 deletions.
13 changes: 5 additions & 8 deletions hippo4j-ui/src/locale/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ export default {
login: 'Login Form',
username: 'Username',
password: 'Password',
logOut: 'Log Out'
logOut: 'Log Out',
},

// 公共
common: {
search: 'Search',
addition: 'Addition',
serialNumber: 'Serial Number',
serialNumber: 'No.',
operation: 'Operation',
edit: 'Edit',
delete: 'Delete',
Expand All @@ -20,7 +20,6 @@ export default {
threadPool: 'Thread Pool',
},


// 运行报表
report: {
tenant: 'Tenant',
Expand All @@ -30,14 +29,12 @@ export default {
role: 'Role',
tenants: 'Tenants',
createTime: 'Create Time',
updateTime: 'Update Time'
updateTime: 'Update Time',
},


// 线程池
threadPool: {
tenant: 'Tenant',
project: 'Project',
}

}
},
};
10 changes: 5 additions & 5 deletions hippo4j-ui/src/locale/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
login: '登 陆',
username: '用户名',
password: '密码',
logOut: '注销'
logOut: '注销',
},

// 公共
Expand All @@ -29,12 +29,12 @@ export default {
role: '用户角色',
tenants: '所属租户',
createTime: '创建时间',
updateTime: '修改时间'
updateTime: '修改时间',
},

// 线程池
threadPool: {
tenant: '租户',
project: '项目',
}
}
},
};
22 changes: 11 additions & 11 deletions hippo4j-ui/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ export const asyncRoutes = [
component: Layout,
redirect: '/hippo4j/itemList',
name: 'item',
meta: { title: '项目管理', icon: 'item4' },
meta: { title: '项目管理', icon: 'item' },
children: [
{
path: 'index',
name: 'index',
component: () => import('@/views/hippo4j/item/index'),
meta: { title: '项目管理', icon: 'item4' },
meta: { title: '项目管理', icon: 'item' },
},
],
},
Expand All @@ -138,7 +138,7 @@ export const asyncRoutes = [
component: Layout,
redirect: '/hippo4j/dynamic/thread-pool',
name: 'thread-pool',
meta: { title: '动态线程池', icon: 'pool3' },
meta: { title: '动态线程池', icon: 'pool' },
children: [
{
path: 'index',
Expand All @@ -165,7 +165,7 @@ export const asyncRoutes = [
component: Layout,
redirect: '/hippo4j/server',
name: 'server-thread-pool',
meta: { title: '容器线程池', icon: 'vessel3' },
meta: { title: '容器线程池', icon: 'vessel' },
children: [
{
path: 'tomcat',
Expand All @@ -192,7 +192,7 @@ export const asyncRoutes = [
component: Layout,
redirect: '/hippo4j/other',
name: 'other-thread-pool',
meta: { title: '框架线程池', icon: 'other4' },
meta: { title: '框架线程池', icon: 'other' },
children: [
{
path: 'dubbo',
Expand Down Expand Up @@ -243,7 +243,7 @@ export const asyncRoutes = [
component: Layout,
redirect: '/hippo4j/verifyList',
name: 'config-modification-verify',
meta: { title: '线程池审核', icon: 'audit', roles: ['ROLE_ADMIN'] },
meta: { title: '线程池审核', icon: 'audit', roles: ['ROLE_MANAGE', 'ROLE_ADMIN'] },
children: [
{
path: 'index',
Expand Down Expand Up @@ -273,13 +273,13 @@ export const asyncRoutes = [
component: Layout,
redirect: '/hippo4j/userList',
name: 'user',
meta: { title: '用户权限', icon: 'user6', roles: ['ROLE_ADMIN'] },
meta: { title: '用户权限', icon: 'user', roles: ['ROLE_ADMIN'] },
children: [
{
path: 'index',
name: 'index',
component: () => import('@/views/hippo4j/user/index'),
meta: { title: '用户权限', icon: 'user6' },
meta: { title: '用户权限', icon: 'user' },
},
],
},
Expand All @@ -288,13 +288,13 @@ export const asyncRoutes = [
component: Layout,
redirect: '/hippo4j/logList',
name: 'log',
meta: { title: '日志管理', icon: 'log3' },
meta: { title: '日志管理', icon: 'log' },
children: [
{
path: 'index',
name: 'index',
component: () => import('@/views/hippo4j/log/index'),
meta: { title: '日志管理', icon: 'log3' },
meta: { title: '日志管理', icon: 'log' },
},
],
},
Expand All @@ -305,7 +305,7 @@ export const asyncRoutes = [
children: [
{
path: 'https://hippo4j.cn',
meta: { title: '官网外链', icon: 'link3' },
meta: { title: '官网外链', icon: 'link' },
},
],
},
Expand Down
8 changes: 6 additions & 2 deletions hippo4j-ui/src/views/hippo4j/threadpool/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@
class-name="small-padding fixed-width"
>
<template slot-scope="{ row }">
<el-button type="text" size="small" @click="handleUpdate(row)"> {{ $t('common.edit') }} </el-button>
<el-button type="text" size="small" @click="handleUpdate(row)">
{{ $t('common.edit') }}
</el-button>
<el-button size="small" :disabled="isEditDisabled" type="text" @click="handleDelete(row)">
{{ $t('common.delete') }}
</el-button>
Expand Down Expand Up @@ -507,7 +509,9 @@ export default {
this.initSelect();
},
mounted() {
this.isEditDisabled = localStorage.getItem('USER_ROLE') !== 'ROLE_ADMIN';
this.isEditDisabled =
localStorage.getItem('USER_ROLE') !== 'ROLE_ADMIN' &&
localStorage.getItem('USER_ROLE') !== 'ROLE_MANAGE';
},
methods: {
onInput() {
Expand Down
3 changes: 2 additions & 1 deletion hippo4j-ui/src/views/hippo4j/user/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export default {
statusFilter(status) {
const statusMap = {
ROLE_ADMIN: 'danger',
ROLE_MANAGE: 'warning',
ROLE_USER: '',
};
return statusMap[status];
Expand All @@ -134,7 +135,7 @@ export default {
size: 10,
userName: undefined,
},
roles: ['ROLE_USER', 'ROLE_ADMIN'],
roles: ['ROLE_USER', 'ROLE_MANAGE', 'ROLE_ADMIN'],
dialogPluginVisible: false,
pluginData: [],
dialogFormVisible: false,
Expand Down

0 comments on commit 76d6ead

Please sign in to comment.