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 <sowmya.kamavaram@rackspace.com>
This commit is contained in:
@@ -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 = [
|
||||
{
|
||||
|
@@ -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'),
|
||||
|
Reference in New Issue
Block a user