mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-18 16:32:28 +00:00
Merge pull request #3084 from jumpserver/pr@dev@fix_asset_gatheredinfo_undefined
fix: 修复资产硬件信息显示undefined问题
This commit is contained in:
@@ -149,7 +149,7 @@ export default {
|
||||
nodes_display: {
|
||||
formatter: ArrayFormatter
|
||||
},
|
||||
info: {
|
||||
gathered_info: {
|
||||
label: this.$t('assets.HardwareInfo'),
|
||||
formatter: HostInfoFormatter,
|
||||
formatterArgs: {
|
||||
@@ -299,7 +299,7 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
optionInfo(iNew) {
|
||||
this.$set(this.defaultConfig.columnsMeta.info.formatterArgs, 'info', iNew)
|
||||
this.$set(this.defaultConfig.columnsMeta.gathered_info.formatterArgs, 'info', iNew)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@@ -11,34 +11,14 @@ export default {
|
||||
GenericCreateUpdatePage
|
||||
},
|
||||
data() {
|
||||
const nodesInitial = []
|
||||
if (this.$route.query['node']) {
|
||||
nodesInitial.push(this.$route.query.node)
|
||||
}
|
||||
return {
|
||||
initial: {
|
||||
is_active: true,
|
||||
platform: 'Linux',
|
||||
protocols: ['ssh/22'],
|
||||
nodes: nodesInitial
|
||||
},
|
||||
initial: {},
|
||||
fields: [
|
||||
[this.$t('common.Basic'), ['name', 'address']],
|
||||
[this.$t('assets.Hardware'), ['info']]
|
||||
[this.$t('assets.Hardware'), ['gathered_info']]
|
||||
],
|
||||
fieldsMeta: {
|
||||
platform: {
|
||||
el: {
|
||||
multiple: false,
|
||||
ajax: {
|
||||
url: '/api/v1/assets/platforms/',
|
||||
transformOption: (item) => {
|
||||
return { label: `${item.name}`, value: item.name }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
info: {
|
||||
gathered_info: {
|
||||
fields: [
|
||||
'vendor', 'model', 'sn', 'cpu_model', 'cpu_count',
|
||||
'cpu_cores', 'cpu_vcpus', 'memory', 'disk_total',
|
||||
|
Reference in New Issue
Block a user