From a6f359bf5bcf6e0aa0fd7b0341d5b0330ef744ae Mon Sep 17 00:00:00 2001 From: Sowmya Nethi Date: Fri, 26 Sep 2025 17:00:37 +0530 Subject: [PATCH] fix: Notify users to Confirm/Revert after VM resize When a VM is resized or migrated, the UI only shows "Resizing or Migrating" without indicating that user action is required. The server stays in this state until the user confirms or reverts. This change adds a notification prompting the user to confirm or revert. Change-Id: I8bf452129ecfb301f8e94037007ef821e3a975fe Signed-off-by: Sowmya Nethi --- .../compute/containers/Instance/index.jsx | 43 +++++++++++++++++++ src/resources/nova/instance.jsx | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/pages/compute/containers/Instance/index.jsx b/src/pages/compute/containers/Instance/index.jsx index 580bb57a..4c6a4006 100644 --- a/src/pages/compute/containers/Instance/index.jsx +++ b/src/pages/compute/containers/Instance/index.jsx @@ -14,8 +14,10 @@ import React from 'react'; import { observer, inject } from 'mobx-react'; +import { reaction } from 'mobx'; import ImageType from 'components/ImageType'; import Base from 'containers/List'; +import Notify from 'components/Notify'; import { instanceStatus, transitionStatus, @@ -29,6 +31,8 @@ import { ServerGroupInstanceStore } from 'stores/skyline/server-group-instance'; import actionConfigs from './actions'; export class Instance extends Base { + notifiedInstances = new Set(); + init() { if (!this.inDetailPage) { this.store = globalServerStore; @@ -114,6 +118,45 @@ export class Instance extends Base { }; } + componentDidMount() { + super.componentDidMount(); + + this.dispose = reaction( + () => { + const { data } = this.store.list; + return data && data.length > 0 + ? data.filter((instance) => instance.status === 'verify_resize') + : []; + }, + (verifyResizeInstances) => { + if (verifyResizeInstances.length === 0) return; + verifyResizeInstances.forEach((instance) => { + if (!this.notifiedInstances.has(instance.id)) { + Notify.warn( + t( + `Waiting for user to Confirm/Revert the Resize for\n ${instance.id}` + ) + ); + this.notifiedInstances.add(instance.id); + } + }); + }, + { + fireImmediately: false, + delay: 100, + } + ); + } + + componentWillUnmount() { + super.componentWillUnmount(); + + if (this.dispose) { + this.dispose(); + } + this.notifiedInstances.clear(); + } + getColumns() { const columns = [ { diff --git a/src/resources/nova/instance.jsx b/src/resources/nova/instance.jsx index 6430a55c..8c968f39 100644 --- a/src/resources/nova/instance.jsx +++ b/src/resources/nova/instance.jsx @@ -56,7 +56,7 @@ export const stableStatus = { paused: t('Paused'), error: t('Error'), resize: t('Resizing or Migrating'), - verify_resize: t('Resizing or Migrating'), + verify_resize: t('Verify Resize/Migrate'), revert_resize: t('Revert Resize/Migrate'), // reboot: t('Reboot'), // hard_reboot: t('Hard Reboot'),