mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-01 15:11:16 +00:00
perf: 修复自动推送按钮在不是 password 和 ssh_key 时禁用
This commit is contained in:
parent
e8a37a9c5b
commit
ea89ce1796
@ -21,7 +21,8 @@ export const templateFields = (vm) => {
|
||||
export const templateFieldsMeta = (vm) => {
|
||||
const id = getUuidUpdateFromUrl(vm.$route.path)
|
||||
const platformIds = []
|
||||
const canRandomSecretTypes = ['password']
|
||||
const canRandomSecretTypes = ['password', 'ssh_key']
|
||||
const autoPushEl = { disabled: false }
|
||||
return {
|
||||
su_from: {
|
||||
component: Select2,
|
||||
@ -41,6 +42,10 @@ export const templateFieldsMeta = (vm) => {
|
||||
change: ([event], updateForm) => {
|
||||
if (!canRandomSecretTypes.includes(event)) {
|
||||
updateForm({ secret_strategy: 'specific' })
|
||||
updateForm({ auto_push: false })
|
||||
autoPushEl.disabled = true
|
||||
} else {
|
||||
autoPushEl.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -113,14 +118,15 @@ export const templateFieldsMeta = (vm) => {
|
||||
change: ([event], updateForm) => {
|
||||
platformIds.splice(0, platformIds.length)
|
||||
platformIds.push(...event)
|
||||
console.log('On platfrom change: ', platformIds)
|
||||
console.log(vm.fieldsMeta)
|
||||
}
|
||||
},
|
||||
hidden: (formValue) => {
|
||||
return !formValue['auto_push']
|
||||
}
|
||||
},
|
||||
auto_push: {
|
||||
el: autoPushEl
|
||||
},
|
||||
push_params: {
|
||||
component: AutomationParams,
|
||||
el: {
|
||||
|
Loading…
Reference in New Issue
Block a user