fix: 修复云同步任务创建 protocols 问题

This commit is contained in:
Bai
2023-02-10 18:13:40 +08:00
committed by Jiangjie.Bai
parent de7005a82d
commit c39b5a5d79
2 changed files with 5 additions and 12 deletions

View File

@@ -119,6 +119,10 @@ export default {
updateSuccessNextRoute: { name: 'CloudCenter' },
createSuccessNextRoute: { name: 'CloudCenter' },
afterGetFormValue(formValue) {
formValue.protocols = formValue.protocols?.split(' ').map(i => {
const [name, port] = i.split('/')
return { name, port }
})
formValue.ip_network_segment_group = formValue.ip_network_segment_group.toString()
return formValue
},

View File

@@ -52,20 +52,9 @@ export default {
url: `/api/v1/xpack/cloud/accounts/${this.object.id}`,
detailFields: [
'name', 'account_display', 'node_display',
{
key: this.$t('xpack.Cloud.LinuxAdminUser'),
value: this.object.unix_admin_user?.name
},
{
key: this.$t('xpack.Cloud.WindowsAdminUser'),
value: this.object.windows_admin_user?.name
},
{
key: this.$t('assets.Protocols'),
value: this.object.protocols,
formatter: (item, val) => {
return <div>{val?.map((v) => <el-tag size='small'>{v['name']}/{v['port']}</el-tag>)}</div>
}
value: this.object.protocols
},
{
key: this.$t('xpack.Cloud.IPNetworkSegment'),