From 6a7757ae2f620407e99a621d51ec4946b6191a77 Mon Sep 17 00:00:00 2001 From: Wang Defa <1+wangdefa@noreply.gitea.bcde.io> Date: Thu, 16 Jul 2026 12:32:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E4=BE=8BVNIC:=E9=99=84=E5=8A=A0?= =?UTF-8?q?=E5=90=8E=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0=E3=80=81IPv6?= =?UTF-8?q?=E9=99=90=E6=8C=82=E8=BD=BD=E6=80=81=E4=B8=8E=E8=84=9A=E6=B3=A8?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/instance/VnicPanel.vue | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/components/instance/VnicPanel.vue b/src/components/instance/VnicPanel.vue index 3b7d76f..7eec6a8 100644 --- a/src/components/instance/VnicPanel.vue +++ b/src/components/instance/VnicPanel.vue @@ -27,9 +27,15 @@ const emit = defineEmits<{ changed: [] }>() const message = useToast() const vnics = useAsync(() => listVnics(props.cfgId, props.instanceId, props.region)) +/** 附加已受理但 OCI 挂载列表有可见性延迟:限时轮询等新卡入列,入列后交由过渡态轮询接管 */ +const expectAtLeast = ref(0) +let expectUntil = 0 + useTransientPoll( () => vnics.data.value, - (list) => !!list?.some((v) => ATTACHMENT_TRANSIENT_STATES.includes(v.lifecycleState)), + (list) => + !!list?.some((v) => ATTACHMENT_TRANSIENT_STATES.includes(v.lifecycleState)) || + ((list?.length ?? 0) < expectAtLeast.value && Date.now() < expectUntil), () => void vnics.run({ silent: true }), ) @@ -44,6 +50,12 @@ function refresh() { emit('changed') } +function onAttached() { + expectAtLeast.value = (vnics.data.value ?? []).length + 1 + expectUntil = Date.now() + 90_000 + refresh() +} + async function doDetach(attachmentId: string) { detaching.value = attachmentId try { @@ -174,7 +186,7 @@ defineExpose({ refresh: () => vnics.run() })
IPV6 -