mirror of
https://github.com/jumpserver/lina.git
synced 2025-04-27 11:10:51 +00:00
Fixed: Fix the issue of losing the automation status when cloning the platform list. (#4951)
* Fixed: Fix the issue of losing the automation status when cloning the platform list. * Fixed: Remove console --------- Co-authored-by: zhaojisen <1301338853@qq.com>
This commit is contained in:
parent
6fa4efaa5f
commit
03d1e9a881
@ -60,23 +60,20 @@ export default {
|
||||
url: `/api/v1/assets/platforms/`,
|
||||
cleanFormValue: (values) => {
|
||||
const protocols = values['protocols'] || []
|
||||
const query = this.$route.query || {}
|
||||
const automation = values['automation'] || {}
|
||||
const category_type = values['category_type']
|
||||
const ansibleConfig = automation?.['ansible_config'] || {}
|
||||
automation.ansible_config = ansibleConfig instanceof Object ? ansibleConfig : JSON.parse(ansibleConfig)
|
||||
|
||||
if (query.hasOwnProperty('_clone_from')) {
|
||||
if (automation.hasOwnProperty('id')) {
|
||||
delete automation['id']
|
||||
}
|
||||
values['protocols'] = protocols.map(i => {
|
||||
if (i.hasOwnProperty('id')) {
|
||||
delete i['id']
|
||||
}
|
||||
return i
|
||||
})
|
||||
if (automation.hasOwnProperty('id')) {
|
||||
delete automation['id']
|
||||
}
|
||||
values['protocols'] = protocols.map(i => {
|
||||
if (i.hasOwnProperty('id')) {
|
||||
delete i['id']
|
||||
}
|
||||
return i
|
||||
})
|
||||
values['category'] = category_type[0]
|
||||
values['type'] = category_type[1]
|
||||
return values
|
||||
|
Loading…
Reference in New Issue
Block a user