mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-02 07:27:01 +00:00
Fixed: Gateway Clone
This commit is contained in:
parent
7ecbff79c7
commit
5a2f430815
@ -70,10 +70,13 @@ export default {
|
||||
let url = this.url
|
||||
const { id = '', action } = vm.meta
|
||||
const values = _.cloneDeep(validValues)
|
||||
|
||||
let submitMethod = id ? 'put' : 'post'
|
||||
|
||||
if (values.nodes && values.nodes.length === 0) {
|
||||
delete values['nodes']
|
||||
}
|
||||
|
||||
if (action === 'update') {
|
||||
url = getUpdateObjURL(url, id)
|
||||
delete values['accounts']
|
||||
@ -84,10 +87,12 @@ export default {
|
||||
return item
|
||||
})
|
||||
}
|
||||
if (vm.meta?.payload === 'pam_asset_clone') {
|
||||
|
||||
if (vm.meta?.payload === 'pam_asset_clone' || vm.meta.row?.payload === 'pam_asset_clone') {
|
||||
submitMethod = 'post'
|
||||
url = this.url
|
||||
}
|
||||
|
||||
return this.$axios[submitMethod](url, values)
|
||||
}
|
||||
}
|
||||
|
@ -110,6 +110,9 @@ export default {
|
||||
name: 'GatewayUpdate',
|
||||
query: { domain: this.object.id, platform_type: 'linux', 'category': 'host' }
|
||||
},
|
||||
onClone: ({ row }) => {
|
||||
this.$refs.ListTable.onClone({ row: { ...row, payload: 'pam_asset_clone' }})
|
||||
},
|
||||
performDelete: ({ row }) => {
|
||||
const id = row.id
|
||||
const url = `/api/v1/assets/gateways/${id}/`
|
||||
|
Loading…
Reference in New Issue
Block a user