feat: 完善虚拟机阈值与迁移管理
This commit is contained in:
@@ -6,7 +6,10 @@
|
||||
<el-divider direction="vertical" />
|
||||
<span class="page-title">用户虚拟机详情</span>
|
||||
</div>
|
||||
<el-button :icon="Refresh" plain @click="loadDetail" :loading="loading">刷新</el-button>
|
||||
<div>
|
||||
<el-button plain @click="router.push({ path: '/virtualization/migration-record', query: { user_goods_id: userGoodsId } })">迁移记录</el-button>
|
||||
<el-button :icon="Refresh" plain @click="loadDetail" :loading="loading">刷新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main-content" v-loading="loading">
|
||||
@@ -2096,7 +2099,12 @@ const submitMigrateVm = async () => {
|
||||
if (migrateForm.ipv4_num) payload.ipv4_num = migrateForm.ipv4_num
|
||||
if (migrateForm.ipv6_num) payload.ipv6_num = migrateForm.ipv6_num
|
||||
const res = await migrateUserVm(payload)
|
||||
if (res?.data?.code === 200) { ElMessage.success('迁移成功'); migrateVisible.value = false; loadDetail() }
|
||||
if (res?.data?.code === 200) {
|
||||
const migrationData = res.data.data || {}
|
||||
ElMessage.success(`迁移已提交${migrationData.migration_record_id ? `,记录 #${migrationData.migration_record_id}` : ''}`)
|
||||
migrateVisible.value = false
|
||||
loadDetail()
|
||||
}
|
||||
else ElMessage.error(extractApiError(res?.data, '迁移失败'))
|
||||
} catch (e) { ElMessage.error(extractApiError(e?.response?.data, '迁移失败')) } finally { actionLoading.value = false }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user