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