@@ -44,6 +44,11 @@ const canSubmit = computed(
|
||||
|
||||
async function submit() {
|
||||
if (props.cfgId === null || !specForm.value) return
|
||||
const spec = specForm.value.buildSpec()
|
||||
if (spec.reservedPublicIpId && form.count > 1) {
|
||||
message.warning('保留 IP 仅支持单台创建,请把数量改为 1')
|
||||
return
|
||||
}
|
||||
submitting.value = true
|
||||
try {
|
||||
const result = await createInstances(props.cfgId, {
|
||||
@@ -51,7 +56,7 @@ async function submit() {
|
||||
compartmentId: props.compartmentId || undefined,
|
||||
displayName: form.displayName.trim(),
|
||||
count: form.count,
|
||||
...specForm.value.buildSpec(),
|
||||
...spec,
|
||||
})
|
||||
// 后端 errors / instances 为空时序列化为 null,判空防炸
|
||||
const ok = result.instances?.length ?? 0
|
||||
|
||||
Reference in New Issue
Block a user