mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-19 09:43:32 +00:00
fix: 【资产列表】资产详情中推送账号,推送参数未获取平台的参数
This commit is contained in:
@@ -165,15 +165,16 @@ export const accountFieldsMeta = (vm) => {
|
||||
params: {
|
||||
label: vm.$t('assets.PushParams'),
|
||||
component: AutomationParamsForm,
|
||||
el: {
|
||||
method: vm.asset?.auto_config?.push_account_method
|
||||
},
|
||||
el: {},
|
||||
hidden: (formValue) => {
|
||||
const automation = vm.iPlatform.automation || {}
|
||||
vm.fieldsMeta.params.el.method = vm.iPlatform.automation.push_account_method
|
||||
vm.fieldsMeta.params.el.pushAccountParams = vm.iPlatform.automation.push_account_params
|
||||
return !formValue.push_now ||
|
||||
!automation.push_account_enabled ||
|
||||
!automation.ansible_enabled ||
|
||||
(formValue.secret_type === 'ssh_key' && vm.iPlatform.type.value === 'windows') ||
|
||||
(formValue.secret_type === 'ssh_key' &&
|
||||
vm.iPlatform.type.value === 'windows') ||
|
||||
!vm.$hasPerm('accounts.push_account') ||
|
||||
vm.addTemplate
|
||||
}
|
||||
|
@@ -70,6 +70,10 @@ export default {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
pushAccountParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
@@ -135,6 +139,7 @@ export default {
|
||||
fieldsMeta: {}
|
||||
}
|
||||
|
||||
const param = this.pushAccountParams[method]
|
||||
if (Object.keys(filterField?.children || {}).length > 0) {
|
||||
for (const [k, v] of Object.entries(filterField.children)) {
|
||||
let component = 'el-input'
|
||||
@@ -143,6 +148,8 @@ export default {
|
||||
component = DynamicInput
|
||||
break
|
||||
}
|
||||
|
||||
v.default = param[k] || v.default
|
||||
const item = { ...v, component: component }
|
||||
fieldsMeta[method].fields.push(k)
|
||||
fieldsMeta[method].fieldsMeta[k] = item
|
||||
|
Reference in New Issue
Block a user