@@ -616,7 +626,8 @@ const createForm = reactive({
name: '', host_id: null, image_id: 0, vcpu: 0, memory: 0,
system_size: 0, rx_bandwidth: 0, tx_bandwidth: 0, data_volume_size: 0,
host_group_id: null, user_id: 0, ipv4_num: 0, ipv6_num: 0, network_ids: [],
- _imageName: '', _groupName: '', _userName: ''
+ _imageName: '', _groupName: '', _userName: '',
+ traffic_max: 0, traffic_exhausted_rx_mbps: 0, traffic_exhausted_tx_mbps: 0
})
const createRules = {
@@ -802,6 +813,9 @@ const submitCreate = () => {
if (createForm.ipv4_num) fd.append('ipv4_num', createForm.ipv4_num)
if (createForm.ipv6_num) fd.append('ipv6_num', createForm.ipv6_num)
} else createForm.network_ids.forEach(id => fd.append('network_ids', id))
+ if (createForm.traffic_max > 0) fd.append('traffic_max', createForm.traffic_max)
+ if (createForm.traffic_exhausted_rx_mbps > 0) fd.append('traffic_exhausted_rx_mbps', createForm.traffic_exhausted_rx_mbps)
+ if (createForm.traffic_exhausted_tx_mbps > 0) fd.append('traffic_exhausted_tx_mbps', createForm.traffic_exhausted_tx_mbps)
const res = await createVm(fd)
if (res?.data?.code === 200) { ElMessage.success('创建成功'); createDialogVisible.value = false; loadList() }
else ElMessage.error(extractApiError(res?.data, '创建失败'))