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