From 7305bf772c4b2bd9e88f97d0a8c9e96040f5ae4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Mon, 24 Apr 2023 11:28:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E7=A1=AC=E4=BB=B6=E4=BF=A1=E6=81=AF=E6=98=BE=E7=A4=BAundefined?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Asset/AssetList/components/BaseList.vue | 4 +-- .../assets/Asset/AssetMoreInformationEdit.vue | 26 +++---------------- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/src/views/assets/Asset/AssetList/components/BaseList.vue b/src/views/assets/Asset/AssetList/components/BaseList.vue index a34225d79..71d083db1 100644 --- a/src/views/assets/Asset/AssetList/components/BaseList.vue +++ b/src/views/assets/Asset/AssetList/components/BaseList.vue @@ -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: { diff --git a/src/views/assets/Asset/AssetMoreInformationEdit.vue b/src/views/assets/Asset/AssetMoreInformationEdit.vue index 4e14e34a3..3f4b42761 100644 --- a/src/views/assets/Asset/AssetMoreInformationEdit.vue +++ b/src/views/assets/Asset/AssetMoreInformationEdit.vue @@ -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',