mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-20 02:31:43 +00:00
perf: Domain detail add gateways
This commit is contained in:
@@ -110,6 +110,7 @@ export default {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$axios.patch(`/api/v1/assets/assets/`, patch_data).then(() => {
|
this.$axios.patch(`/api/v1/assets/assets/`, patch_data).then(() => {
|
||||||
this.reloadTable()
|
this.reloadTable()
|
||||||
|
this.$message.success(this.$t('common.RemoveSuccessMsg'))
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
})
|
})
|
||||||
|
@@ -214,6 +214,7 @@ export default {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$axios.patch(`/api/v1/assets/gateways/`, patch_data).then(() => {
|
this.$axios.patch(`/api/v1/assets/gateways/`, patch_data).then(() => {
|
||||||
this.reloadTable()
|
this.reloadTable()
|
||||||
|
this.$message.success(this.$t('common.RemoveSuccessMsg'))
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
})
|
})
|
||||||
|
@@ -43,13 +43,13 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
formConfig: {
|
formConfig: {
|
||||||
url: `/api/v1/assets/assets/?domain=${this.$route.params.id}&exclude_platform=Gateway`,
|
|
||||||
getUrl: () => {
|
getUrl: () => {
|
||||||
return `/api/v1/assets/assets/`
|
return '/api/v1/assets/assets/'
|
||||||
},
|
},
|
||||||
submitMethod: () => 'patch',
|
submitMethod: () => 'patch',
|
||||||
hasReset: false,
|
hasReset: false,
|
||||||
hasSaveContinue: false,
|
hasSaveContinue: false,
|
||||||
|
needGetObjectDetail: false,
|
||||||
createSuccessMsg: this.$t('common.AddSuccessMsg'),
|
createSuccessMsg: this.$t('common.AddSuccessMsg'),
|
||||||
updateSuccessNextRoute: {
|
updateSuccessNextRoute: {
|
||||||
name: 'DomainDetail',
|
name: 'DomainDetail',
|
||||||
@@ -68,7 +68,7 @@ export default {
|
|||||||
domain_enabled: true
|
domain_enabled: true
|
||||||
},
|
},
|
||||||
canSelect: (row) => {
|
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() {
|
data() {
|
||||||
return {
|
return {
|
||||||
formConfig: {
|
formConfig: {
|
||||||
url: `/api/v1/assets/assets/?domain=${this.$route.params.id}&platform=Gateway`,
|
|
||||||
getUrl: () => {
|
getUrl: () => {
|
||||||
return `/api/v1/assets/domains/${this.$route.params.id}/`
|
return '/api/v1/assets/assets/'
|
||||||
},
|
},
|
||||||
submitMethod: () => 'patch',
|
submitMethod: () => 'patch',
|
||||||
hasReset: false,
|
hasReset: false,
|
||||||
hasSaveContinue: false,
|
hasSaveContinue: false,
|
||||||
|
needGetObjectDetail: false,
|
||||||
createSuccessMsg: this.$t('common.AddSuccessMsg'),
|
createSuccessMsg: this.$t('common.AddSuccessMsg'),
|
||||||
|
updateSuccessNextRoute: {
|
||||||
|
name: 'DomainDetail',
|
||||||
|
params: { id: this.$route.params.id }
|
||||||
|
},
|
||||||
fields: ['gateways'],
|
fields: ['gateways'],
|
||||||
fieldsMeta: {
|
fieldsMeta: {
|
||||||
gateways: {
|
gateways: {
|
||||||
@@ -60,9 +64,18 @@ export default {
|
|||||||
clearable: true,
|
clearable: true,
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/v1/assets/assets/?domain_enabled=true&platform=Gateway'
|
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