mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-19 17:54:37 +00:00
perf: Domain detail add gateways
This commit is contained in:
@@ -110,6 +110,7 @@ export default {
|
||||
}).then(() => {
|
||||
this.$axios.patch(`/api/v1/assets/assets/`, patch_data).then(() => {
|
||||
this.reloadTable()
|
||||
this.$message.success(this.$t('common.RemoveSuccessMsg'))
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
|
@@ -214,6 +214,7 @@ export default {
|
||||
}).then(() => {
|
||||
this.$axios.patch(`/api/v1/assets/gateways/`, patch_data).then(() => {
|
||||
this.reloadTable()
|
||||
this.$message.success(this.$t('common.RemoveSuccessMsg'))
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
|
@@ -43,13 +43,13 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
formConfig: {
|
||||
url: `/api/v1/assets/assets/?domain=${this.$route.params.id}&exclude_platform=Gateway`,
|
||||
getUrl: () => {
|
||||
return `/api/v1/assets/assets/`
|
||||
return '/api/v1/assets/assets/'
|
||||
},
|
||||
submitMethod: () => 'patch',
|
||||
hasReset: false,
|
||||
hasSaveContinue: false,
|
||||
needGetObjectDetail: false,
|
||||
createSuccessMsg: this.$t('common.AddSuccessMsg'),
|
||||
updateSuccessNextRoute: {
|
||||
name: 'DomainDetail',
|
||||
@@ -68,7 +68,7 @@ export default {
|
||||
domain_enabled: true
|
||||
},
|
||||
canSelect: (row) => {
|
||||
return row.platform?.name !== 'Gateway'
|
||||
return row.platform?.name !== 'Gateway' && this.object.assets.map(item => item.id).indexOf(row.id) === -1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -43,14 +43,18 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
formConfig: {
|
||||
url: `/api/v1/assets/assets/?domain=${this.$route.params.id}&platform=Gateway`,
|
||||
getUrl: () => {
|
||||
return `/api/v1/assets/domains/${this.$route.params.id}/`
|
||||
return '/api/v1/assets/assets/'
|
||||
},
|
||||
submitMethod: () => 'patch',
|
||||
hasReset: false,
|
||||
hasSaveContinue: false,
|
||||
needGetObjectDetail: false,
|
||||
createSuccessMsg: this.$t('common.AddSuccessMsg'),
|
||||
updateSuccessNextRoute: {
|
||||
name: 'DomainDetail',
|
||||
params: { id: this.$route.params.id }
|
||||
},
|
||||
fields: ['gateways'],
|
||||
fieldsMeta: {
|
||||
gateways: {
|
||||
@@ -60,9 +64,18 @@ export default {
|
||||
clearable: true,
|
||||
ajax: {
|
||||
url: '/api/v1/assets/assets/?domain_enabled=true&platform=Gateway'
|
||||
}
|
||||
},
|
||||
disabledValues: this.object.gateways.map(item => item.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
cleanFormValue(values) {
|
||||
const data = []
|
||||
values.gateways.forEach(item => {
|
||||
const d = { id: item.pk, domain: this.$route.params.id }
|
||||
data.push(d)
|
||||
})
|
||||
return data
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user