mirror of
https://github.com/jumpserver/lina.git
synced 2025-10-20 15:09:01 +00:00
perf: asset add account info
This commit is contained in:
@@ -124,7 +124,7 @@ export default {
|
||||
}
|
||||
},
|
||||
cloneNameSuffix: {
|
||||
type: String,
|
||||
type: [String, Number],
|
||||
default: function() {
|
||||
return this.$t('Duplicate').toLowerCase()
|
||||
}
|
||||
@@ -372,7 +372,7 @@ export default {
|
||||
name = object['hostname']
|
||||
attr = 'hostname'
|
||||
}
|
||||
object[attr] = name + '-' + this.cloneNameSuffix
|
||||
object[attr] = name + '-' + this.cloneNameSuffix.toString()
|
||||
} else {
|
||||
object = await this.getObjectDetail(this.iUrl)
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ export default {
|
||||
name: 'Detail'
|
||||
},
|
||||
{
|
||||
title: this.$t('AccountList'),
|
||||
title: this.$t('Accounts'),
|
||||
name: 'Account',
|
||||
hidden: () => !this.$hasPerm('accounts.view_account')
|
||||
},
|
||||
|
@@ -31,6 +31,7 @@ import PlatformDialog from '../components/PlatformDialog'
|
||||
import GatewayDialog from '@/components/Apps/GatewayDialog'
|
||||
import { openTaskPage } from '@/utils/jms'
|
||||
import HostInfoFormatter from '@/components/Table/TableFormatters/HostInfoFormatter'
|
||||
import AmountFormatter from '@/components/Table/TableFormatters/AmountFormatter.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -129,7 +130,7 @@ export default {
|
||||
columnsShow: {
|
||||
min: ['name', 'address', 'actions'],
|
||||
default: [
|
||||
'name', 'address', 'platform',
|
||||
'name', 'address', 'accounts_amount', 'platform',
|
||||
'connectivity', 'actions'
|
||||
]
|
||||
},
|
||||
@@ -171,6 +172,28 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
accounts_amount: {
|
||||
label: this.$t('Accounts'),
|
||||
formatter: AmountFormatter,
|
||||
width: '100px',
|
||||
formatterArgs: {
|
||||
async: true,
|
||||
getItem(item) {
|
||||
return `${item.name}(${item.username})`
|
||||
},
|
||||
getRoute({ row }) {
|
||||
return {
|
||||
name: 'AssetDetail',
|
||||
params: {
|
||||
id: row.id
|
||||
},
|
||||
query: {
|
||||
tab: 'Account'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
connectivity: connectivityMeta,
|
||||
actions: {
|
||||
formatter: ActionsFormatter,
|
||||
|
@@ -93,8 +93,14 @@ export default {
|
||||
hasButtons: true,
|
||||
hasReset: false,
|
||||
fields: [],
|
||||
method: 'get',
|
||||
fieldsMeta: {}
|
||||
method: 'get'
|
||||
},
|
||||
preFieldsMeta: {
|
||||
'change_secret_by_ssh': {
|
||||
commands: {
|
||||
helpTextAsTip: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -159,6 +165,15 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
const preDefineFieldMeta = this.preFieldsMeta[method]
|
||||
if (preDefineFieldMeta) {
|
||||
for (const [k, v] of Object.entries(preDefineFieldMeta)) {
|
||||
for (const [j, l] of Object.entries(v)) {
|
||||
fieldsMeta[method]['fieldsMeta'][k][j] = l
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.config.fields = fields
|
||||
this.config.fieldsMeta = fieldsMeta
|
||||
},
|
||||
|
Reference in New Issue
Block a user