mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-09 18:47:43 +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) => {
|
export const templateFieldsMeta = (vm) => {
|
||||||
const id = getUuidUpdateFromUrl(vm.$route.path)
|
const id = getUuidUpdateFromUrl(vm.$route.path)
|
||||||
const platformIds = []
|
const platformIds = []
|
||||||
const canRandomSecretTypes = ['password']
|
const canRandomSecretTypes = ['password', 'ssh_key']
|
||||||
|
const autoPushEl = { disabled: false }
|
||||||
return {
|
return {
|
||||||
su_from: {
|
su_from: {
|
||||||
component: Select2,
|
component: Select2,
|
||||||
@ -41,6 +42,10 @@ export const templateFieldsMeta = (vm) => {
|
|||||||
change: ([event], updateForm) => {
|
change: ([event], updateForm) => {
|
||||||
if (!canRandomSecretTypes.includes(event)) {
|
if (!canRandomSecretTypes.includes(event)) {
|
||||||
updateForm({ secret_strategy: 'specific' })
|
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) => {
|
change: ([event], updateForm) => {
|
||||||
platformIds.splice(0, platformIds.length)
|
platformIds.splice(0, platformIds.length)
|
||||||
platformIds.push(...event)
|
platformIds.push(...event)
|
||||||
console.log('On platfrom change: ', platformIds)
|
|
||||||
console.log(vm.fieldsMeta)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hidden: (formValue) => {
|
hidden: (formValue) => {
|
||||||
return !formValue['auto_push']
|
return !formValue['auto_push']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
auto_push: {
|
||||||
|
el: autoPushEl
|
||||||
|
},
|
||||||
push_params: {
|
push_params: {
|
||||||
component: AutomationParams,
|
component: AutomationParams,
|
||||||
el: {
|
el: {
|
||||||
|
Loading…
Reference in New Issue
Block a user