perf: Added cloud sync global released asset tab (#4929)

This commit is contained in:
fit2bot 2025-04-08 18:27:02 +08:00 committed by GitHub
parent 61bb8c07c4
commit e309d7e049
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 3 deletions

View File

@ -1,4 +1,4 @@
FROM jumpserver/lina-base:20250327_104059 AS stage-build
FROM jumpserver/lina-base:20250408_074136 AS stage-build
ARG VERSION
ENV VERSION=$VERSION

View File

@ -41,7 +41,7 @@ export default {
]
},
tableConfig: {
url: `/api/v1/xpack/cloud/sync-instance-tasks/${this.object.task?.id}/instances/`,
url: '',
hasSelection: false,
columns: [
'instance_id',
@ -49,6 +49,10 @@ export default {
prop: 'asset_ip',
label: this.$t('IP')
},
{
prop: 'asset_display',
label: this.$t('Asset')
},
'region',
{
prop: 'status',
@ -76,9 +80,20 @@ export default {
}
}
},
computed: {
dynamicUrl() {
const baseUrl = '/api/v1/xpack/cloud/sync-instance-tasks/instances/'
return this.object ? `${baseUrl}?task_id=${this.object.task.id}` : baseUrl
}
},
mounted() {
this.tableConfig.url = this.dynamicUrl
},
methods: {
DeleteReleasedAssets() {
this.$axios.delete(`/api/v1/xpack/cloud/sync-instance-tasks/${this.object.task?.id}/released-assets/`).then(
const baseUrl = '/api/v1/xpack/cloud/sync-instance-tasks/released-assets/'
const url = this.object ? `${baseUrl}?task_id=${this.object.task.id}` : baseUrl
this.$axios.delete(url).then(
res => {
this.$message.success(this.$tc('DeleteSuccessMsg'))
this.$refs.GenericListTable.$refs.ListTable.reloadTable()

View File

@ -26,6 +26,12 @@ export default {
name: 'StrategyList',
hidden: () => !this.$hasPerm('xpack.view_strategy'),
component: () => import('@/views/assets/Cloud/Strategy/StrategyList.vue')
},
{
title: this.$t('SyncInstanceTaskHistoryAssetList'),
name: 'TaskSyncAssetList',
hidden: () => !this.$hasLicense() || !this.$hasPerm('xpack.view_syncinstancedetail'),
component: () => import('@/views/assets/Cloud/Account/AccountDetail/TaskSyncAssetList.vue')
}
],
actions: {