mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-30 12:55:37 +00:00
Merge branch 'v3' of github.com:jumpserver/lina into v3
This commit is contained in:
commit
7eeb917e16
@ -49,7 +49,7 @@ export default {
|
||||
url: this.url,
|
||||
permissions: {
|
||||
app: 'assets',
|
||||
resource: 'authbook'
|
||||
resource: 'account'
|
||||
},
|
||||
columns: [
|
||||
'asset_name', 'ip', 'username', 'version',
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
<script>
|
||||
import ListTable from '@/components/ListTable/index'
|
||||
import { ActionsFormatter, DetailFormatter, DisplayFormatter } from '@/components/TableFormatters'
|
||||
import { ActionsFormatter, DisplayFormatter } from '@/components/TableFormatters'
|
||||
import ShowSecretInfo from './ShowSecretInfo'
|
||||
import UpdateSecretInfo from './UpdateSecretInfo'
|
||||
import AddAccount from './AddAccount'
|
||||
@ -73,7 +73,7 @@ export default {
|
||||
url: this.url,
|
||||
permissions: {
|
||||
app: 'assets',
|
||||
resource: 'authbook'
|
||||
resource: 'account'
|
||||
},
|
||||
columns: [
|
||||
'hostname', 'ip', 'username', 'version', 'connectivity',
|
||||
@ -85,22 +85,26 @@ export default {
|
||||
},
|
||||
columnsMeta: {
|
||||
hostname: {
|
||||
prop: 'hostname',
|
||||
label: this.$t('assets.Hostname'),
|
||||
showOverflowTooltip: true,
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
can: this.$hasPerm('assets.view_asset'),
|
||||
getRoute({ row }) {
|
||||
return {
|
||||
name: 'AssetDetail',
|
||||
params: { id: row.asset }
|
||||
}
|
||||
formatter: function(row, column, cellValue, index) {
|
||||
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>
|
||||
}
|
||||
}
|
||||
},
|
||||
ip: {
|
||||
width: '120px'
|
||||
width: '120px',
|
||||
label: this.$t('assets.ip'),
|
||||
formatter: function(row, column, cellValue, index) {
|
||||
return <span>{ row.asset.ip }</span>
|
||||
}
|
||||
},
|
||||
username: {
|
||||
showOverflowTooltip: true
|
||||
@ -136,7 +140,7 @@ export default {
|
||||
{
|
||||
name: 'Delete',
|
||||
title: this.$t('common.Delete'),
|
||||
can: this.$hasPerm('assets.delete_authbook'),
|
||||
can: this.$hasPerm('assets.delete_account'),
|
||||
type: 'primary',
|
||||
callback: ({ row }) => {
|
||||
this.$axios.delete(`/api/v1/assets/accounts/${row.id}/`).then(() => {
|
||||
@ -148,7 +152,7 @@ export default {
|
||||
{
|
||||
name: 'Test',
|
||||
title: this.$t('common.Test'),
|
||||
can: this.$hasPerm('assets.test_authbook'),
|
||||
can: this.$hasPerm('assets.test_account'),
|
||||
callback: ({ row }) => {
|
||||
this.$axios.post(
|
||||
`/api/v1/assets/accounts/${row.id}/verify/`,
|
||||
|
@ -3,7 +3,7 @@ import empty from '@/layout/empty'
|
||||
|
||||
export default [
|
||||
{
|
||||
path: 'authbook',
|
||||
path: 'accounts',
|
||||
component: empty,
|
||||
meta: {
|
||||
title: i18n.t('route.AssetAccount'),
|
||||
@ -19,7 +19,7 @@ export default [
|
||||
meta: {
|
||||
title: i18n.t('route.AssetAccount'),
|
||||
app: 'assets',
|
||||
permissions: ['assets.view_authbook']
|
||||
permissions: ['assets.view_account']
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -39,12 +39,12 @@ export default {
|
||||
let url = '/api/v1/assets/accounts/'
|
||||
if (treeNode.meta.type === 'node') {
|
||||
const nodeId = treeNode.meta.data.id
|
||||
url = setUrlParam(url, 'asset', '')
|
||||
url = setUrlParam(url, 'node', nodeId)
|
||||
url = setUrlParam(url, 'assets', '')
|
||||
url = setUrlParam(url, 'nodes', nodeId)
|
||||
} else if (treeNode.meta.type === 'asset') {
|
||||
const assetId = treeNode.meta.data.id
|
||||
url = setUrlParam(url, 'node', '')
|
||||
url = setUrlParam(url, 'asset', assetId)
|
||||
url = setUrlParam(url, 'nodes', '')
|
||||
url = setUrlParam(url, 'assets', assetId)
|
||||
}
|
||||
this.accountsUrl = url
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ export default {
|
||||
name: 'Delete',
|
||||
title: this.$t('common.Delete'),
|
||||
type: 'danger',
|
||||
can: !this.$store.getters.currentOrgIsRoot && vm.$hasPerm('assets.delete_authbook'),
|
||||
can: !this.$store.getters.currentOrgIsRoot && vm.$hasPerm('assets.delete_account'),
|
||||
callback: (val) => {
|
||||
this.$axios.delete(`/api/v1/assets/system-users-assets-relations/${val.row.id}/`).then(() => {
|
||||
this.$message.success(this.$t('common.deleteSuccessMsg'))
|
||||
@ -164,7 +164,7 @@ export default {
|
||||
}
|
||||
],
|
||||
systemUserRelationConfig: {
|
||||
disabled: !vm.$hasPerm('assets.add_authbook'),
|
||||
disabled: !vm.$hasPerm('assets.add_account'),
|
||||
icon: 'fa-link',
|
||||
type: 'info',
|
||||
title: this.$t('assets.AssociateSystemUsers'),
|
||||
|
@ -41,12 +41,12 @@ export default {
|
||||
{
|
||||
title: this.$t('assets.SystemUser'),
|
||||
name: 'SystemUserList',
|
||||
hidden: () => !this.$hasPerm('assets.view_authbook')
|
||||
hidden: () => !this.$hasPerm('assets.view_account')
|
||||
},
|
||||
{
|
||||
title: this.$t('assets.AccountList'),
|
||||
name: 'Account',
|
||||
hidden: () => !this.$hasPerm('assets.view_authbook')
|
||||
hidden: () => !this.$hasPerm('assets.view_account')
|
||||
},
|
||||
{
|
||||
title: this.$t('assets.PermUserList'),
|
||||
|
@ -100,7 +100,7 @@ export default {
|
||||
'assets.gateway': ['assets.view_domain'],
|
||||
'assets.add_asset': ['assets.view_platform'],
|
||||
'assets.change_asset': ['assets.view_platform'],
|
||||
'assets.view_authbook': ['assets.view_node'],
|
||||
'assets.view_account': ['assets.view_node'],
|
||||
'assets.gathereduser': ['assets.view_node'],
|
||||
'assets.refresh_assethardwareinfo': ['assets.change_asset'],
|
||||
'xpack.gatherusertaskexecution': ['xpack.view_gatherusertask'],
|
||||
|
Loading…
Reference in New Issue
Block a user