Skip to content

Commit

Permalink
Merge pull request #3751 from jumpserver/pr@dev@push_account
Browse files Browse the repository at this point in the history
fix: 【资产列表】资产详情中推送账号,推送参数未获取平台的参数
  • Loading branch information
feng626 authored Feb 27, 2024
2 parents da570e2 + 2fe6cb3 commit 1ee9e5d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/Apps/AccountCreateUpdateForm/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
7 changes: 7 additions & 0 deletions src/views/assets/Platform/AutomationParamsSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ export default {
type: String,
default: ''
},
pushAccountParams: {
type: Object,
default: () => ({})
},
visible: {
type: Boolean,
default: false
Expand Down Expand Up @@ -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'
Expand All @@ -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
Expand Down

0 comments on commit 1ee9e5d

Please sign in to comment.