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