1
0
mirror of https://github.com/jumpserver/lina.git synced 2025-05-08 08:06:57 +00:00

perf: Added cloud sync global released asset tab ()

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
Dockerfile
src/views/assets/Cloud
Account/AccountDetail
index.vue

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 ARG VERSION
ENV VERSION=$VERSION ENV VERSION=$VERSION

View File

@ -41,7 +41,7 @@ export default {
] ]
}, },
tableConfig: { tableConfig: {
url: `/api/v1/xpack/cloud/sync-instance-tasks/${this.object.task?.id}/instances/`, url: '',
hasSelection: false, hasSelection: false,
columns: [ columns: [
'instance_id', 'instance_id',
@ -49,6 +49,10 @@ export default {
prop: 'asset_ip', prop: 'asset_ip',
label: this.$t('IP') label: this.$t('IP')
}, },
{
prop: 'asset_display',
label: this.$t('Asset')
},
'region', 'region',
{ {
prop: 'status', 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: { methods: {
DeleteReleasedAssets() { 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 => { res => {
this.$message.success(this.$tc('DeleteSuccessMsg')) this.$message.success(this.$tc('DeleteSuccessMsg'))
this.$refs.GenericListTable.$refs.ListTable.reloadTable() this.$refs.GenericListTable.$refs.ListTable.reloadTable()

View File

@ -26,6 +26,12 @@ export default {
name: 'StrategyList', name: 'StrategyList',
hidden: () => !this.$hasPerm('xpack.view_strategy'), hidden: () => !this.$hasPerm('xpack.view_strategy'),
component: () => import('@/views/assets/Cloud/Strategy/StrategyList.vue') 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: { actions: {