fix: 修复更新平台时有多个协议只显示一个协议问题

This commit is contained in:
“huailei000”
2022-11-04 20:06:19 +08:00
committed by huailei
parent aafc6af69c
commit 9322c4e7ae
4 changed files with 8 additions and 14 deletions

View File

@@ -113,7 +113,7 @@ export default {
},
{
id: 'sftp_enabled',
label: '启用 SFTP',
label: this.$t('common.Enable') + ' SFTP',
type: 'switch',
hidden: () => this.item.name !== 'ssh'
},

View File

@@ -137,13 +137,10 @@ export default {
item.port = selected.port
},
setDefaultItems(choices) {
const defaults = choices.filter(item => (item.required || item.primary || item.default))
if (this.value.length > 0) {
const notInDefaults = this.value.filter(item => {
return defaults.find(d => d.name === item.name)
})
this.items = notInDefaults
this.items = this.value
} else {
const defaults = choices.filter(item => (item.required || item.primary || item.default))
this.items = defaults
}
},

View File

@@ -16,13 +16,17 @@ export const platformFieldsMeta = (vm) => {
'gather_facts_enabled', 'gather_facts_method',
'push_account_enabled', 'push_account_method',
'change_secret_enabled', 'change_secret_method',
'verify_account_enabled', 'verify_account_method'
'verify_account_enabled', 'verify_account_method',
'gather_accounts_enabled', 'gather_accounts_method'
],
fieldsMeta: {
ansible_config: {
component: JsonEditor,
hidden: (formValue) => !formValue['ansible_enabled']
},
gather_facts_enabled: {
label: i18n.t('assets.CollectHardwareInfo')
},
ping_method: {},
gather_facts_method: {},
push_account_method: {},

View File

@@ -9,13 +9,6 @@ export const assetFieldsMeta = (vm) => {
const secretTypes = []
return {
address: {},
automation: {
fieldsMeta: {
gather_facts_enabled: {
label: i18n.t('assets.CollectHardwareInfo')
}
}
},
protocols: {
component: ProtocolSelector,
el: {