mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 14:25:23 +00:00
perf: asset update
This commit is contained in:
@@ -44,7 +44,6 @@ export default {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
loading: true,
|
||||
platform: {},
|
||||
@@ -68,16 +67,15 @@ export default {
|
||||
fieldsMeta: {},
|
||||
performSubmit(validValues) {
|
||||
let url = this.url
|
||||
const { id = '', action } = vm.meta
|
||||
const { id = '' } = this.$route.query
|
||||
const values = _.cloneDeep(validValues)
|
||||
|
||||
const submitMethod = id ? 'put' : 'post'
|
||||
|
||||
if (values.nodes && values.nodes.length === 0) {
|
||||
delete values['nodes']
|
||||
}
|
||||
|
||||
if (action === 'update') {
|
||||
if (submitMethod === 'put') {
|
||||
url = getUpdateObjURL(url, id)
|
||||
delete values['accounts']
|
||||
} else {
|
||||
|
@@ -215,9 +215,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async updateOrCloneAsset(row, action) {
|
||||
if (action === 'update') {
|
||||
this.$route.params.id = row.id
|
||||
}
|
||||
this.createDrawer = this.drawer[row.category.value]
|
||||
const meta = {
|
||||
action: action,
|
||||
id: row.id,
|
||||
@@ -227,11 +225,7 @@ export default {
|
||||
row: row,
|
||||
payload: row.payload
|
||||
}
|
||||
await this.$store.dispatch('common/setDrawerActionMeta', meta)
|
||||
this.createDrawer = this.drawer[row.category.value]
|
||||
setTimeout(() => {
|
||||
this.$refs.ListTable.showDrawer(action)
|
||||
}, 100)
|
||||
this.$refs.ListTable.onUpdate({ row, query: meta })
|
||||
},
|
||||
createAsset(platform) {
|
||||
this.showPlatform = false
|
||||
|
Reference in New Issue
Block a user