diff --git a/src/layout/components/GenericDetailPage/index.vue b/src/layout/components/GenericDetailPage/index.vue index 1a77ba1f1..d5aed82af 100644 --- a/src/layout/components/GenericDetailPage/index.vue +++ b/src/layout/components/GenericDetailPage/index.vue @@ -195,6 +195,7 @@ export default { this.$log.debug('Start perform delete: ', url) return this.$axios.delete(url) } + this.$alert(msg, title, { type: 'warning', confirmButtonClass: 'el-button--danger', diff --git a/src/views/assets/Cloud/Account/AccountList.vue b/src/views/assets/Cloud/Account/AccountList.vue index 5dafa56c5..1e718545f 100644 --- a/src/views/assets/Cloud/Account/AccountList.vue +++ b/src/views/assets/Cloud/Account/AccountList.vue @@ -122,6 +122,9 @@ export default { } } }, + activated() { + this.$refs.accountTable.reloadTable() + }, methods: { valid(status) { if (status !== 200) { diff --git a/src/views/assets/Cloud/Account/components/AuthPanel.vue b/src/views/assets/Cloud/Account/components/AuthPanel.vue index 54eae440d..049b52e62 100644 --- a/src/views/assets/Cloud/Account/components/AuthPanel.vue +++ b/src/views/assets/Cloud/Account/components/AuthPanel.vue @@ -106,11 +106,12 @@ export default { el: { provider: this.provider, regions: this.object.task?.regions || [], - getAuthInfo: () => { + getAuthInfo: async() => { if (this.object?.id) { return this.object.id } const form = this.$refs.form.$refs.form.dataForm + await form.submitForm('form', true) return form.getFormValue()['attrs'] } } diff --git a/src/views/assets/Cloud/Account/components/RegionPanel.vue b/src/views/assets/Cloud/Account/components/RegionPanel.vue index 88dbf4b55..1e081eead 100644 --- a/src/views/assets/Cloud/Account/components/RegionPanel.vue +++ b/src/views/assets/Cloud/Account/components/RegionPanel.vue @@ -91,21 +91,27 @@ export default { this.content = `${this.$t('Modify')} [${count}]` }, handlerLinkClick() { - this.content = this.$t('Loading') const authInfo = this.getAuthInfo() let method = 'get' let data = {} let url = `/api/v1/xpack/cloud/regions/?account_id=${authInfo}` + if (typeof authInfo === 'object') { const attrs = JSON.parse(JSON.stringify(authInfo)) + method = 'post' url = `/api/v1/xpack/cloud/regions/?provider=${this.provider}` data = { 'attrs': encryptAttrsField(attrs) } } + this.content = this.$t('Loading') + this.$axios[method](url, data).then(resp => { this.allRegions = resp?.regions - this.regionVisible = true - this.updateCheckedStatus() + console.log(Object.getOwnPropertyNames(data.attrs).length) + if (this.allRegions.length && Object.getOwnPropertyNames(data.attrs).length > 0) { + this.regionVisible = true + this.updateCheckedStatus() + } }).catch(error => { this.$message.error(this.$tc('CloudRegionTip' + ' ' + error)) }).finally(() => {