mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-20 10:46:35 +00:00
feat: 用户详情中添加授权给用户所有账号列表
This commit is contained in:
@@ -1305,6 +1305,7 @@
|
||||
"databasePermissionRules": "Database Permission rules",
|
||||
"k8sPermissionRules": "Kubernetes Permission rules",
|
||||
"grantedAssets": "Granted assets",
|
||||
"grantedAccounts": "Granted accounts",
|
||||
"grantedK8Ss": "Granted K8Ss",
|
||||
"grantedDatabases": "Granted databases",
|
||||
"grantedRemoteApps": "Granted remote apps",
|
||||
|
@@ -1341,6 +1341,7 @@
|
||||
"databasePermissionRules": "データベース認可ルール",
|
||||
"k8sPermissionRules": "Kubernetesライセンスルール",
|
||||
"grantedAssets": "認可された資産",
|
||||
"grantedAccounts": "公認アカウント",
|
||||
"grantedK8Ss": "認可されたKubernetes",
|
||||
"grantedDatabases": "認可されたデータベース",
|
||||
"grantedRemoteApps": "許可されたリモートアプリケーション",
|
||||
|
@@ -1383,6 +1383,7 @@
|
||||
"databasePermissionRules": "数据库授权规则",
|
||||
"k8sPermissionRules": "Kubernetes授权规则",
|
||||
"grantedAssets": "授权的资产",
|
||||
"grantedAccounts": "授权的账号",
|
||||
"grantedK8Ss": "授权的Kubernetes",
|
||||
"grantedDatabases": "授权的数据库",
|
||||
"grantedRemoteApps": "授权的远程应用",
|
||||
|
81
src/views/users/User/UserDetail/UserGrantedAccounts.vue
Normal file
81
src/views/users/User/UserDetail/UserGrantedAccounts.vue
Normal file
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<ListTable ref="ListTable" :table-config="tableConfig" :header-actions="headerActions" class- />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ListTable from '@/components/ListTable'
|
||||
|
||||
export default {
|
||||
name: 'UserGrantedAccounts',
|
||||
components: {
|
||||
ListTable
|
||||
},
|
||||
props: {
|
||||
object: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
tableConfig: {
|
||||
url: `/api/v1/perms/users/${this.object.id}/accounts/`,
|
||||
columns: [
|
||||
'asset', 'name', 'username', 'privileged', 'version', 'comment'
|
||||
],
|
||||
columnsShow: {
|
||||
default: [
|
||||
'asset', 'name', 'username', 'privileged', 'version'
|
||||
],
|
||||
min: ['asset_name', 'name']
|
||||
},
|
||||
columnsMeta: {
|
||||
asset: {
|
||||
label: this.$t('assets.Asset'),
|
||||
showOverflowTooltip: true,
|
||||
formatter: function(row) {
|
||||
const to = {
|
||||
name: 'AssetDetail',
|
||||
params: { id: row.asset.id }
|
||||
}
|
||||
if (vm.$hasPerm('assets.view_asset')) {
|
||||
return <router-link to={ to } >{ row.asset.name }</router-link>
|
||||
} else {
|
||||
return <span>{ row.asset.name }</span>
|
||||
}
|
||||
}
|
||||
},
|
||||
name: {
|
||||
formatter: null
|
||||
},
|
||||
privileged: {
|
||||
width: '120px',
|
||||
label: this.$t('assets.Privileged'),
|
||||
formatterArgs: {
|
||||
showFalse: false
|
||||
}
|
||||
}
|
||||
},
|
||||
tableAttrs: {
|
||||
border: false
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
hasSearch: true,
|
||||
hasRefresh: true,
|
||||
hasLeftActions: true,
|
||||
hasRightActions: true,
|
||||
hasExport: false,
|
||||
hasImport: false,
|
||||
hasCreate: false,
|
||||
hasMoreActions: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@@ -10,6 +10,7 @@
|
||||
import { GenericDetailPage } from '@/layout/components'
|
||||
import UserAssetPermissionRules from './UserAssetPermissionRules'
|
||||
import UserGrantedAssets from './UserGrantedAssets'
|
||||
import UserGrantedAccounts from './UserGrantedAccounts'
|
||||
import UserGrantedApplications from './UserGrantedApplications'
|
||||
import UserApplicationPermissionRules from './UserApplicationsPermissionRules'
|
||||
import UserLoginACLList from '@/views/acl/UserLoginACL/UserLoginACLList'
|
||||
@@ -20,6 +21,7 @@ export default {
|
||||
GenericDetailPage,
|
||||
UserInfo,
|
||||
UserGrantedAssets,
|
||||
UserGrantedAccounts,
|
||||
UserAssetPermissionRules,
|
||||
UserGrantedApplications,
|
||||
UserApplicationPermissionRules,
|
||||
@@ -44,6 +46,12 @@ export default {
|
||||
name: 'UserGrantedAssets',
|
||||
hidden: () => !vm.$hasPerm('perms.view_userassets')
|
||||
},
|
||||
{
|
||||
title: this.$t('users.tabs.grantedAccounts'),
|
||||
name: 'UserGrantedAccounts',
|
||||
// Todo: perms.view_useraccounts
|
||||
hidden: () => !vm.$hasPerm('perms.view_userassets')
|
||||
},
|
||||
{
|
||||
title: this.$t('users.tabs.assetPermissionRules'),
|
||||
name: 'UserAssetPermissionRules',
|
||||
|
Reference in New Issue
Block a user