feat: add batch host migration and expiry offset
This commit is contained in:
@@ -889,6 +889,10 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="到期顺延">
|
||||
<el-input-number v-model="migrateForm.expire_offset_days" :min="0" :step="1" :precision="0" controls-position="right" style="width:100%" />
|
||||
<div style="font-size:12px;color:#909399">迁移完成后,用户商品到期时间向后顺延;0 表示不调整</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="migrateVisible = false">取消</el-button>
|
||||
@@ -2049,10 +2053,10 @@ const migrateOptionsLoading = ref(false)
|
||||
const migrateMode = ref('host')
|
||||
const migrateHostOptions = ref([])
|
||||
const migrateGroupOptions = ref([])
|
||||
const migrateForm = reactive({ target_host_id: null, target_host_group_id: null, ipv4_num: 0, ipv6_num: 0 })
|
||||
const migrateForm = reactive({ target_host_id: null, target_host_group_id: null, ipv4_num: 0, ipv6_num: 0, expire_offset_days: 0 })
|
||||
|
||||
const openMigrateVm = async () => {
|
||||
Object.assign(migrateForm, { target_host_id: null, target_host_group_id: null, ipv4_num: 0, ipv6_num: 0 })
|
||||
Object.assign(migrateForm, { target_host_id: null, target_host_group_id: null, ipv4_num: 0, ipv6_num: 0, expire_offset_days: 0 })
|
||||
migrateMode.value = 'host'
|
||||
migrateVisible.value = true
|
||||
migrateOptionsLoading.value = true
|
||||
@@ -2097,6 +2101,7 @@ const submitMigrateVm = async () => {
|
||||
else payload.target_host_group_id = migrateForm.target_host_group_id
|
||||
if (migrateForm.ipv4_num) payload.ipv4_num = migrateForm.ipv4_num
|
||||
if (migrateForm.ipv6_num) payload.ipv6_num = migrateForm.ipv6_num
|
||||
if (migrateForm.expire_offset_days > 0) payload.expire_offset_days = migrateForm.expire_offset_days
|
||||
const res = await migrateUserVm(payload)
|
||||
if (res?.data?.code === 200) {
|
||||
const migrationData = res.data.data || {}
|
||||
|
||||
Reference in New Issue
Block a user