- Please contact Cloudbase Solutions with your Appliance ID in order to
+ Please contact your Coriolis representative with the Appliance ID in order to
obtain a Coriolis® licence.
diff --git a/src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.spec.tsx b/src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.spec.tsx
index d12c8032..33715081 100644
--- a/src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.spec.tsx
+++ b/src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.spec.tsx
@@ -15,7 +15,7 @@ along with this program. If not, see .
import React from "react";
import { Endpoint } from "@src/@types/Endpoint";
-import { MigrationItem, ReplicaItem } from "@src/@types/MainItem";
+import { MigrationItem, TransferItem } from "@src/@types/MainItem";
import { fireEvent, render } from "@testing-library/react";
import TestUtils from "@tests/TestUtils";
@@ -24,7 +24,7 @@ import DashboardTopEndpoints from "./DashboardTopEndpoints";
jest.mock("react-router-dom", () => ({ Link: "a" }));
type BuildType = T extends "replica"
- ? ReplicaItem
+ ? TransferItem
: MigrationItem;
const buildItem = (
@@ -64,7 +64,7 @@ const buildEndpoint = (id: string): Endpoint => ({
connection_info: {},
});
-const replicas: DashboardTopEndpoints["props"]["replicas"] = [
+const replicas: DashboardTopEndpoints["props"]["transfers"] = [
buildItem("replica", "a", "b"),
buildItem("replica", "a", "b"),
buildItem("replica", "c", "d"),
@@ -86,7 +86,7 @@ const endpoints: DashboardTopEndpoints["props"]["endpoints"] = [
describe("DashboardTopEndpoints", () => {
const defaultProps: DashboardTopEndpoints["props"] = {
- replicas,
+ transfers: replicas,
migrations,
endpoints,
style: {},
@@ -98,7 +98,7 @@ describe("DashboardTopEndpoints", () => {
render(
{
render(
@@ -125,7 +125,7 @@ describe("DashboardTopEndpoints", () => {
diff --git a/src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.tsx b/src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.tsx
index 2d1d20b3..bf3d35b6 100644
--- a/src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.tsx
+++ b/src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.tsx
@@ -26,7 +26,7 @@ import { ThemePalette, ThemeProps } from "@src/components/Theme";
import type { Endpoint } from "@src/@types/Endpoint";
-import { ReplicaItem, MigrationItem, TransferItem } from "@src/@types/MainItem";
+import { TransferItem } from "@src/@types/MainItem";
import endpointImage from "./images/endpoint.svg";
const Wrapper = styled.div`
@@ -136,9 +136,7 @@ type GroupedEndpoint = {
};
type Props = {
// eslint-disable-next-line react/no-unused-prop-types
- replicas: ReplicaItem[];
- // eslint-disable-next-line react/no-unused-prop-types
- migrations: MigrationItem[];
+ transfers: TransferItem[];
// eslint-disable-next-line react/no-unused-prop-types
endpoints: Endpoint[];
style: React.CSSProperties;
@@ -178,20 +176,21 @@ class DashboardTopEndpoints extends React.Component {
calculateGroupedEndpoints(props: Props) {
const groupedEndpoints: GroupedEndpoint[] = [];
- const count = (mainItems: TransferItem[], endpointId: string) =>
+ const count = (mainItems: TransferItem[], endpointId: string, scenario: string) =>
mainItems.filter(
r =>
- r.destination_endpoint_id === endpointId ||
- r.origin_endpoint_id === endpointId
+ r.scenario === scenario && (
+ r.destination_endpoint_id === endpointId ||
+ r.origin_endpoint_id === endpointId)
).length;
props.endpoints.forEach(endpoint => {
- const replicasCount = count(props.replicas, endpoint.id);
- const migrationsCount = count(props.migrations, endpoint.id);
+ const replicasCount = count(props.transfers, endpoint.id, "replica");
+ const migrationsCount = count(props.transfers, endpoint.id, "live_migration");
groupedEndpoints.push({
endpoint,
- replicasCount,
- migrationsCount,
+ replicasCount: replicasCount,
+ migrationsCount: migrationsCount,
value: replicasCount + migrationsCount,
});
});
diff --git a/src/components/modules/EndpointModule/EndpointDetailsContent/EndpointDetailsContent.tsx b/src/components/modules/EndpointModule/EndpointDetailsContent/EndpointDetailsContent.tsx
index cb9508b2..3b10ee8f 100644
--- a/src/components/modules/EndpointModule/EndpointDetailsContent/EndpointDetailsContent.tsx
+++ b/src/components/modules/EndpointModule/EndpointDetailsContent/EndpointDetailsContent.tsx
@@ -20,8 +20,6 @@ import styled from "styled-components";
import { Field as FieldType } from "@src/@types/Field";
import {
getTransferItemTitle,
- MigrationItem,
- ReplicaItem,
TransferItem,
} from "@src/@types/MainItem";
import { Region } from "@src/@types/Region";
@@ -102,7 +100,7 @@ type Props = {
regions: Region[];
connectionInfo: Endpoint["connection_info"] | null;
loading: boolean;
- usage: { migrations: MigrationItem[]; replicas: ReplicaItem[] };
+ transfers: TransferItem[],
connectionInfoSchema: FieldType[];
onDeleteClick: () => void;
onValidateClick: () => void;
@@ -232,7 +230,7 @@ class EndpointDetailsContent extends React.Component {
{items.map(item => (
-
+
{getTransferItemTitle(item)}
@@ -250,9 +248,6 @@ class EndpointDetailsContent extends React.Component {
created_at: createdAt,
id,
} = this.props.item || {};
- const usage: TransferItem[] = this.props.usage.replicas.concat(
- this.props.usage.migrations as any[]
- );
return (
@@ -293,8 +288,8 @@ class EndpointDetailsContent extends React.Component {
)}
- Used in replicas/migrations ({usage.length})
- {usage.length > 0 ? this.renderUsage(usage) : - }
+ Used in transfers ({this.props.transfers.length})
+ {this.props.transfers.length > 0 ? this.renderUsage(this.props.transfers) : - }
{!this.props.connectionInfo
? this.renderConnectionInfoLoading()
diff --git a/src/components/modules/LicenceModule/LicenceModule.tsx b/src/components/modules/LicenceModule/LicenceModule.tsx
index 0078077d..a6e659a5 100644
--- a/src/components/modules/LicenceModule/LicenceModule.tsx
+++ b/src/components/modules/LicenceModule/LicenceModule.tsx
@@ -299,7 +299,7 @@ class LicenceModule extends React.Component {
if (
new Date(info.earliestLicenceExpiryDate).getTime() < new Date().getTime()
) {
- return "Please contact Cloudbase Solutions with your Appliance ID in order to obtain a Coriolis® licence";
+ return "Please contact your Coriolis representative with the Appliance ID in order to obtain a Coriolis® licence";
}
return (
@@ -346,7 +346,7 @@ class LicenceModule extends React.Component {
- Read Coriolis© EULA
+ Read the Coriolis© EULA
{
defaultProps = {
item: MINION_POOL_DETAILS_MOCK,
itemId: "minion-pool-id",
- replicas: [REPLICA_MOCK],
+ transfers: [REPLICA_MOCK],
migrations: [],
endpoints: [OPENSTACK_ENDPOINT_MOCK],
schema: [
diff --git a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolDetailsContent.tsx b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolDetailsContent.tsx
index c1deea95..36d9c096 100644
--- a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolDetailsContent.tsx
+++ b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolDetailsContent.tsx
@@ -20,7 +20,7 @@ import Button from "@src/components/ui/Button";
import DetailsNavigation from "@src/components/modules/NavigationModule/DetailsNavigation";
import type { Endpoint } from "@src/@types/Endpoint";
import type { Field } from "@src/@types/Field";
-import { ReplicaItem, MigrationItem } from "@src/@types/MainItem";
+import { TransferItem, DeploymentItem } from "@src/@types/MainItem";
import { MinionPoolDetails } from "@src/@types/MinionPool";
import StatusImage from "@src/components/ui/StatusComponents/StatusImage";
import { ThemeProps } from "@src/components/Theme";
@@ -75,8 +75,8 @@ const NavigationItems = [
type Props = {
item?: MinionPoolDetails | null;
itemId: string;
- replicas: ReplicaItem[];
- migrations: MigrationItem[];
+ transfers: TransferItem[];
+ deployments: DeploymentItem[];
endpoints: Endpoint[];
schema: Field[];
schemaLoading: boolean;
@@ -144,8 +144,8 @@ class MinionPoolDetailsContent extends React.Component {
return (
);
}
@@ -166,8 +166,8 @@ class MinionPoolDetailsContent extends React.Component {
return (
{
beforeEach(() => {
defaultProps = {
item: MINION_POOL_MOCK,
- replicas: [REPLICA_MOCK],
+ transfers: [REPLICA_MOCK],
migrations: [MIGRATION_MOCK],
};
});
diff --git a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMachines.tsx b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMachines.tsx
index adff097e..54234f0d 100644
--- a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMachines.tsx
+++ b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMachines.tsx
@@ -17,12 +17,12 @@ import { Collapse } from "react-collapse";
import { Link } from "react-router-dom";
import styled, { createGlobalStyle, css } from "styled-components";
-import { MigrationItem, ReplicaItem, TransferItem } from "@src/@types/MainItem";
+import { DeploymentItem, TransferItem, ActionItem } from "@src/@types/MainItem";
import { MinionMachine, MinionPool } from "@src/@types/MinionPool";
import { ThemePalette, ThemeProps } from "@src/components/Theme";
import Arrow from "@src/components/ui/Arrow";
import DropdownLink from "@src/components/ui/Dropdowns/DropdownLink";
-import { ItemReplicaBadge } from "@src/components/ui/Dropdowns/NotificationDropdown";
+import { ItemTransferBadge } from "@src/components/ui/Dropdowns/NotificationDropdown";
import StatusPill from "@src/components/ui/StatusComponents/StatusPill";
import DateUtils from "@src/utils/DateUtils";
@@ -144,8 +144,8 @@ const ValueLink = styled(Link)`
type FilterType = "all" | "allocated" | "not-allocated";
type Props = {
item?: MinionPool | null;
- replicas: ReplicaItem[];
- migrations: MigrationItem[];
+ transfers: TransferItem[];
+ deployments: DeploymentItem[];
};
type State = {
filterStatus: FilterType;
@@ -278,11 +278,11 @@ class MinionPoolMachines extends React.Component {
return (
{this.filteredMachines.map(machine => {
- const findTransferItem = (transferItems: TransferItem[]) =>
+ const findTransferItem = (transferItems: ActionItem[]) =>
transferItems.find(i => i.id === machine.allocated_action);
const allocatedAction = machine.allocated_action
- ? findTransferItem(this.props.replicas) ||
- findTransferItem(this.props.migrations)
+ ? findTransferItem(this.props.transfers) ||
+ findTransferItem(this.props.deployments)
: null;
return (
@@ -329,11 +329,11 @@ class MinionPoolMachines extends React.Component {
Allocated Action:
{allocatedAction ? (
<>
-
- {allocatedAction.type === "replica" ? "RE" : "MI"}
-
+
+ {allocatedAction.type === "transfer" ? "TR" : "DE"}
+
{allocatedAction.instances[0]}
diff --git a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.spec.tsx b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.spec.tsx
index 9b71a09e..260f33f3 100644
--- a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.spec.tsx
+++ b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.spec.tsx
@@ -35,7 +35,7 @@ describe("MinionPoolMainDetails", () => {
beforeEach(() => {
defaultProps = {
item: MINION_POOL_MOCK,
- replicas: [REPLICA_MOCK],
+ transfers: [REPLICA_MOCK],
migrations: [MIGRATION_MOCK],
schema: [],
schemaLoading: false,
diff --git a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.tsx b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.tsx
index 83658201..1d658e7c 100644
--- a/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.tsx
+++ b/src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.tsx
@@ -18,7 +18,7 @@ import { Link } from "react-router-dom";
import styled, { css } from "styled-components";
import fieldHelper from "@src/@types/Field";
-import { MigrationItem, ReplicaItem, TransferItem } from "@src/@types/MainItem";
+import { DeploymentItem, TransferItem, ActionItem } from "@src/@types/MainItem";
import { MinionPool } from "@src/@types/MinionPool";
import EndpointLogos from "@src/components/modules/EndpointModule/EndpointLogos";
import { ThemePalette, ThemeProps } from "@src/components/Theme";
@@ -101,8 +101,8 @@ const PropertyValue = styled.div`
type Props = {
item?: MinionPool | null;
- replicas: ReplicaItem[];
- migrations: MigrationItem[];
+ transfers: TransferItem[];
+ deployments: DeploymentItem[];
schema: FieldType[];
schemaLoading: boolean;
endpoints: Endpoint[];
@@ -178,8 +178,8 @@ class MinionPoolMainDetails extends React.Component {
let properties: any[] = [];
const plugin = endpoint && OptionsSchemaPlugin.for(endpoint.type);
- const migrationImageMapFieldName =
- plugin && plugin.migrationImageMapFieldName;
+ const deploymentImageMapFieldName =
+ plugin && plugin.deploymentImageMapFieldName;
let dictionaryKey = "";
if (endpoint) {
dictionaryKey = `${endpoint.type}-minion-pool`;
@@ -202,8 +202,8 @@ class MinionPoolMainDetails extends React.Component {
}
let fieldName = pn;
if (
- migrationImageMapFieldName &&
- fieldName === migrationImageMapFieldName
+ deploymentImageMapFieldName &&
+ fieldName === deploymentImageMapFieldName
) {
fieldName = p;
}
@@ -235,14 +235,18 @@ class MinionPoolMainDetails extends React.Component {
);
}
- renderUsage(items: TransferItem[]) {
- return items.map(item => (
-
-
+ renderUsage(items: ActionItem[]) {
+ return items.map(item => {
+ const actionHref =
+ item.type === "transfer"
+ ? "transfers" : "deployments"
+
+ return (
+
{item.instances[0]}
-
- ));
+ );
+ });
}
renderTable() {
@@ -263,8 +267,8 @@ class MinionPoolMainDetails extends React.Component {
: [];
};
- const usage: TransferItem[] = this.props.replicas.concat(
- this.props.migrations as any[]
+ const usage: ActionItem[] = this.props.transfers.concat(
+ this.props.deployments as any[]
);
return (
@@ -329,7 +333,7 @@ class MinionPoolMainDetails extends React.Component {
) : null}
- Used in Replicas/Migrations ({usage.length})
+ Used in Transfers ({usage.length})
{usage.length > 0 ? this.renderUsage(usage) : - }
diff --git a/src/components/modules/NavigationModule/Navigation/Navigation.tsx b/src/components/modules/NavigationModule/Navigation/Navigation.tsx
index dc85271c..ca23a271 100644
--- a/src/components/modules/NavigationModule/Navigation/Navigation.tsx
+++ b/src/components/modules/NavigationModule/Navigation/Navigation.tsx
@@ -29,7 +29,7 @@ import cbsImage from "./images/cbsl-logo.svg";
import cbsImageSmall from "./images/cbsl-logo-small.svg";
import tinyLogo from "./images/logo-small.svg";
-import replicaImage from "./images/replica-menu.svg";
+import transferImage from "./images/transfer-menu.svg";
import endpointImage from "./images/endpoint-menu.svg";
import planningImage from "./images/planning-menu.svg";
import projectImage from "./images/project-menu.svg";
@@ -179,7 +179,7 @@ const SmallMenuItemBullet = styled.div`
border-radius: 50%;
position: absolute;
left: -12px;
- background: ${props => (props.bullet === "replica" ? "#E62565" : "#0044CA")};
+ background: ${props => (props.bullet === "transfer" ? "#E62565" : "#0044CA")};
`;
const MenuImage = styled.div`
@@ -406,13 +406,13 @@ class Navigation extends React.Component {
menuImage = dashboardImage;
style = { width: "19px", height: "19px" };
break;
- case "replicas":
- bullet = "replica";
- menuImage = replicaImage;
+ case "transfers":
+ bullet = "transfer";
+ menuImage = transferImage;
break;
- case "migrations":
- bullet = "migration";
- menuImage = replicaImage;
+ case "deployments":
+ bullet = "deployment";
+ menuImage = transferImage;
break;
case "endpoints":
menuImage = endpointImage;
diff --git a/src/components/modules/NavigationModule/Navigation/images/replica-menu.svg b/src/components/modules/NavigationModule/Navigation/images/deployments-menu.svg
similarity index 100%
rename from src/components/modules/NavigationModule/Navigation/images/replica-menu.svg
rename to src/components/modules/NavigationModule/Navigation/images/deployments-menu.svg
diff --git a/src/components/modules/NavigationModule/Navigation/images/transfer-menu.svg b/src/components/modules/NavigationModule/Navigation/images/transfer-menu.svg
new file mode 100644
index 00000000..c5d049d3
--- /dev/null
+++ b/src/components/modules/NavigationModule/Navigation/images/transfer-menu.svg
@@ -0,0 +1,17 @@
+
+
+
+
+ Created with Sketch.
+
+
+
+
+
+
diff --git a/src/components/modules/TransferModule/DeleteReplicaModal/package.json b/src/components/modules/TransferModule/DeleteReplicaModal/package.json
deleted file mode 100644
index e9ade791..00000000
--- a/src/components/modules/TransferModule/DeleteReplicaModal/package.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "name": "DeleteReplicaModal",
- "version": "0.0.0",
- "private": true,
- "main": "./DeleteReplicaModal.tsx"
-}
diff --git a/src/components/modules/TransferModule/DeleteReplicaModal/DeleteReplicaModal.spec.tsx b/src/components/modules/TransferModule/DeleteTransferModal/DeleteReplicaModal.spec.tsx
similarity index 78%
rename from src/components/modules/TransferModule/DeleteReplicaModal/DeleteReplicaModal.spec.tsx
rename to src/components/modules/TransferModule/DeleteTransferModal/DeleteReplicaModal.spec.tsx
index eb5348de..1c4ef29e 100644
--- a/src/components/modules/TransferModule/DeleteReplicaModal/DeleteReplicaModal.spec.tsx
+++ b/src/components/modules/TransferModule/DeleteTransferModal/DeleteReplicaModal.spec.tsx
@@ -17,27 +17,27 @@ import React from "react";
import { render } from "@testing-library/react";
import TestUtils from "@tests/TestUtils";
-import DeleteReplicaModal from "./";
+import DeleteTransferModal from "./DeleteTransferModal";
describe("DeleteReplicaModal", () => {
- let defaultProps: DeleteReplicaModal["props"];
+ let defaultProps: DeleteTransferModal["props"];
beforeEach(() => {
defaultProps = {
hasDisks: false,
- onDeleteReplica: jest.fn(),
+ onDeleteTransfer: jest.fn(),
onDeleteDisks: jest.fn(),
onRequestClose: jest.fn(),
};
});
it("renders without crashing", () => {
- const { getByText } = render( );
+ const { getByText } = render( );
expect(getByText("Delete Replica")).toBeTruthy();
});
it("renders with disks", () => {
- render( );
+ render( );
expect(
TestUtils.select("DeleteReplicaModal__ExtraMessage")?.textContent
).toContain("has been executed at least once");
@@ -45,7 +45,7 @@ describe("DeleteReplicaModal", () => {
it("is multiple replica selection with disks", () => {
render(
-
+
);
expect(
TestUtils.select("DeleteReplicaModal__ExtraMessage")?.textContent
@@ -53,7 +53,7 @@ describe("DeleteReplicaModal", () => {
});
it("renders loading", () => {
- render( );
+ render( );
expect(TestUtils.select("DeleteReplicaModal__Loading")).toBeTruthy();
});
});
diff --git a/src/components/modules/TransferModule/DeleteReplicaModal/DeleteReplicaModal.tsx b/src/components/modules/TransferModule/DeleteTransferModal/DeleteTransferModal.tsx
similarity index 74%
rename from src/components/modules/TransferModule/DeleteReplicaModal/DeleteReplicaModal.tsx
rename to src/components/modules/TransferModule/DeleteTransferModal/DeleteTransferModal.tsx
index fa085c0b..e59068e0 100644
--- a/src/components/modules/TransferModule/DeleteReplicaModal/DeleteReplicaModal.tsx
+++ b/src/components/modules/TransferModule/DeleteTransferModal/DeleteTransferModal.tsx
@@ -71,43 +71,43 @@ const LoadingSubtitle = styled.div`
type Props = {
hasDisks: boolean;
- isMultiReplicaSelection?: boolean;
+ isMultiTransferSelection?: boolean;
loading?: boolean;
- onDeleteReplica: () => void;
+ onDeleteTransfer: () => void;
onDeleteDisks: () => void;
onRequestClose: () => void;
};
@observer
-class DeleteReplicaModal extends React.Component {
+class DeleteTransferModal extends React.Component {
renderExtraMessage() {
if (this.props.hasDisks) {
- if (this.props.isMultiReplicaSelection) {
+ if (this.props.isMultiTransferSelection) {
return (
- Some of the selected Replicas have been executed at least once and
+ Some of the selected Transfer have been executed at least once and
thus may have disks created on the destination platform. If those
- Replicas are to be deleted now, the disks on the destination will
- persist. If this is not desired, please use the "Delete Replica
+ Transfers are to be deleted now, the disks on the destination will
+ persist. If this is not desired, please use the "Delete Transfer
Disks" option to delete those disks before deleting the
- Replicas themselves.
+ Transfers themselves.
);
}
return (
- This Replica has been executed at least once and thus may have disks
- created on the destination platform. If the Replica is to be deleted
+ This Transfer has been executed at least once and thus may have disks
+ created on the destination platform. If the Transfer is to be deleted
now, the disks on the destination will persist. If this is not
- desired, please use the "Delete Replica Disks" option to
- delete the disks before deleting the Replica itself.
+ desired, please use the "Delete Transfer Disks" option to
+ delete the disks before deleting the Transfer itself.
);
}
return (
- Deleting a Coriolis Replica is permanent!
+ Deleting a Coriolis Transfer is permanent!
);
}
@@ -116,7 +116,7 @@ class DeleteReplicaModal extends React.Component {
- Validating Replicas Details
+ Validating Transfer Details
Please wait ...
@@ -124,9 +124,9 @@ class DeleteReplicaModal extends React.Component {
}
renderContent() {
- const message = this.props.isMultiReplicaSelection
- ? "Are you sure you want to delete the selected replicas?"
- : "Are you sure you want to delete this replica?";
+ const message = this.props.isMultiTransferSelection
+ ? "Are you sure you want to delete the selected transfers?"
+ : "Are you sure you want to delete this transfer?";
return (
@@ -145,11 +145,11 @@ class DeleteReplicaModal extends React.Component {
style={{ marginBottom: "16px" }}
alert
>
- Delete Replica Disks
+ Delete Transfer Disks
) : null}
-
- Delete Replica{this.props.isMultiReplicaSelection ? "s" : ""}
+
+ Delete Transfer{this.props.isMultiTransferSelection ? "s" : ""}
@@ -158,9 +158,9 @@ class DeleteReplicaModal extends React.Component {
}
render() {
- const title = this.props.isMultiReplicaSelection
- ? "Delete Selected Replicas?"
- : "Delete Replica?";
+ const title = this.props.isMultiTransferSelection
+ ? "Delete Selected Transfers?"
+ : "Delete Transfer?";
return (
{this.props.loading ? this.renderLoading() : this.renderContent()}
@@ -169,4 +169,4 @@ class DeleteReplicaModal extends React.Component {
}
}
-export default DeleteReplicaModal;
+export default DeleteTransferModal;
diff --git a/src/components/modules/TransferModule/DeleteTransferModal/package.json b/src/components/modules/TransferModule/DeleteTransferModal/package.json
new file mode 100644
index 00000000..4a59dc88
--- /dev/null
+++ b/src/components/modules/TransferModule/DeleteTransferModal/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "DeleteTransferModal",
+ "version": "0.0.0",
+ "private": true,
+ "main": "./DeleteTransferModal.tsx"
+}
diff --git a/src/components/modules/TransferModule/MigrationDetailsContent/MigrationDetailsContent.spec.tsx b/src/components/modules/TransferModule/DeploymentDetailsContent/DeploymentDetailsContent.spec.tsx
similarity index 74%
rename from src/components/modules/TransferModule/MigrationDetailsContent/MigrationDetailsContent.spec.tsx
rename to src/components/modules/TransferModule/DeploymentDetailsContent/DeploymentDetailsContent.spec.tsx
index c2e4bc9a..ef501fa3 100644
--- a/src/components/modules/TransferModule/MigrationDetailsContent/MigrationDetailsContent.spec.tsx
+++ b/src/components/modules/TransferModule/DeploymentDetailsContent/DeploymentDetailsContent.spec.tsx
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2023 Cloudbase Solutions SRL
+Copyright (C) 2024 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
@@ -16,8 +16,8 @@ import React from "react";
import { render } from "@testing-library/react";
-import MigrationDetailsContent from ".";
-import { MIGRATION_ITEM_DETAILS_MOCK } from "@tests/mocks/TransferMock";
+import DeploymentDetailsContent from ".";
+import { DEPLOYMENT_ITEM_DETAILS_MOCK } from "@tests/mocks/TransferMock";
import { MINION_POOL_MOCK } from "@tests/mocks/MinionPoolMock";
import { STORAGE_BACKEND_MOCK } from "@tests/mocks/StoragesMock";
import { INSTANCE_MOCK } from "@tests/mocks/InstancesMock";
@@ -33,13 +33,13 @@ jest.mock("@src/components/modules/EndpointModule/EndpointLogos", () => ({
}));
jest.mock("react-router-dom", () => ({ Link: "a" }));
-describe("MigrationDetailsContent", () => {
- let defaultProps: MigrationDetailsContent["props"];
+describe("DeploymentDetailsContent", () => {
+ let defaultProps: DeploymentDetailsContent["props"];
beforeEach(() => {
defaultProps = {
- item: MIGRATION_ITEM_DETAILS_MOCK,
- itemId: MIGRATION_ITEM_DETAILS_MOCK.id,
+ item: DEPLOYMENT_ITEM_DETAILS_MOCK,
+ itemId: DEPLOYMENT_ITEM_DETAILS_MOCK.id,
minionPools: [MINION_POOL_MOCK],
detailsLoading: false,
storageBackends: [STORAGE_BACKEND_MOCK],
@@ -52,22 +52,22 @@ describe("MigrationDetailsContent", () => {
destinationSchemaLoading: false,
endpoints: [OPENSTACK_ENDPOINT_MOCK, VMWARE_ENDPOINT_MOCK],
page: "",
- onDeleteMigrationClick: jest.fn(),
+ onDeleteDeploymentClick: jest.fn(),
};
});
it("renders without crashing", () => {
- const { getByText } = render( );
- expect(getByText(MIGRATION_ITEM_DETAILS_MOCK.id)).toBeTruthy();
+ const { getByText } = render( );
+ expect(getByText(DEPLOYMENT_ITEM_DETAILS_MOCK.id)).toBeTruthy();
});
it("renders tasks page", () => {
const { getByText } = render(
-
+
);
expect(
getByText(
- MIGRATION_ITEM_DETAILS_MOCK.tasks[0].task_type.replace("_", " ")
+ DEPLOYMENT_ITEM_DETAILS_MOCK.tasks[0].task_type.replace("_", " ")
)
).toBeTruthy();
});
diff --git a/src/components/modules/TransferModule/MigrationDetailsContent/MigrationDetailsContent.tsx b/src/components/modules/TransferModule/DeploymentDetailsContent/DeploymentDetailsContent.tsx
similarity index 90%
rename from src/components/modules/TransferModule/MigrationDetailsContent/MigrationDetailsContent.tsx
rename to src/components/modules/TransferModule/DeploymentDetailsContent/DeploymentDetailsContent.tsx
index 27cb7711..ed316a0f 100644
--- a/src/components/modules/TransferModule/MigrationDetailsContent/MigrationDetailsContent.tsx
+++ b/src/components/modules/TransferModule/DeploymentDetailsContent/DeploymentDetailsContent.tsx
@@ -16,7 +16,7 @@ import { observer } from "mobx-react";
import React from "react";
import styled from "styled-components";
-import { MigrationItemDetails } from "@src/@types/MainItem";
+import { DeploymentItemDetails } from "@src/@types/MainItem";
import { MinionPool } from "@src/@types/MinionPool";
import { Network } from "@src/@types/Network";
import DetailsNavigation from "@src/components/modules/NavigationModule/DetailsNavigation";
@@ -45,7 +45,7 @@ const DetailsBody = styled.div`
const NavigationItems = [
{
- label: "Migration",
+ label: "Deployment",
value: "",
},
{
@@ -55,7 +55,7 @@ const NavigationItems = [
];
type Props = {
- item: MigrationItemDetails | null;
+ item: DeploymentItemDetails | null;
itemId: string;
minionPools: MinionPool[];
detailsLoading: boolean;
@@ -69,15 +69,15 @@ type Props = {
destinationSchemaLoading: boolean;
endpoints: Endpoint[];
page: string;
- onDeleteMigrationClick: () => void;
+ onDeleteDeploymentClick: () => void;
};
@observer
-class MigrationDetailsContent extends React.Component {
+class DeploymentDetailsContent extends React.Component {
renderBottomControls() {
return (
-
- Delete Migration
+
+ Delete Deployment
);
@@ -128,7 +128,7 @@ class MigrationDetailsContent extends React.Component {
items={NavigationItems}
selectedValue={this.props.page}
itemId={this.props.itemId}
- itemType="migration"
+ itemType="deployment"
/>
{this.renderMainDetails()}
@@ -139,4 +139,4 @@ class MigrationDetailsContent extends React.Component {
}
}
-export default MigrationDetailsContent;
+export default DeploymentDetailsContent;
diff --git a/src/components/modules/TransferModule/DeploymentDetailsContent/package.json b/src/components/modules/TransferModule/DeploymentDetailsContent/package.json
new file mode 100644
index 00000000..fc28403a
--- /dev/null
+++ b/src/components/modules/TransferModule/DeploymentDetailsContent/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "DeploymentDetailsContent",
+ "version": "0.0.0",
+ "private": true,
+ "main": "./DeploymentDetailsContent.tsx"
+}
diff --git a/src/components/modules/TransferModule/MigrationDetailsContent/story.tsx b/src/components/modules/TransferModule/DeploymentDetailsContent/story.tsx
similarity index 90%
rename from src/components/modules/TransferModule/MigrationDetailsContent/story.tsx
rename to src/components/modules/TransferModule/DeploymentDetailsContent/story.tsx
index 99a6e7f6..286605f1 100644
--- a/src/components/modules/TransferModule/MigrationDetailsContent/story.tsx
+++ b/src/components/modules/TransferModule/DeploymentDetailsContent/story.tsx
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2017 Cloudbase Solutions SRL
+Copyright (C) 2024 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
@@ -16,7 +16,7 @@ along with this program. If not, see .
import React from "react";
import { storiesOf } from "@storybook/react";
-import MigrationDetailsContent from ".";
+import DeploymentDetailsContent from ".";
const tasks: any = [
{
@@ -64,12 +64,12 @@ const item: any = {
map_1: "Mapping 1",
},
},
- type: "Migration",
+ type: "Deployment",
};
const props: any = {};
-storiesOf("MigrationDetailsContent", module)
+storiesOf("DeploymentDetailsContent", module)
.add("default", () => (
-
))
.add("details loading", () => (
-
))
.add("tasks", () => (
- .
import { Field } from "@src/@types/Field";
-const replicaMigrationFields: Field[] = [
+const deploymentFields: Field[] = [
{
name: "clone_disks",
type: "boolean",
@@ -30,4 +30,4 @@ const replicaMigrationFields: Field[] = [
},
];
-export default replicaMigrationFields;
+export default deploymentFields;
diff --git a/src/components/modules/TransferModule/ReplicaMigrationOptions/ReplicaMigrationOptions.tsx b/src/components/modules/TransferModule/DeploymentOptions/DeploymentOptions.tsx
similarity index 91%
rename from src/components/modules/TransferModule/ReplicaMigrationOptions/ReplicaMigrationOptions.tsx
rename to src/components/modules/TransferModule/DeploymentOptions/DeploymentOptions.tsx
index 0dce1170..aca05ae0 100644
--- a/src/components/modules/TransferModule/ReplicaMigrationOptions/ReplicaMigrationOptions.tsx
+++ b/src/components/modules/TransferModule/DeploymentOptions/DeploymentOptions.tsx
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2017 Cloudbase Solutions SRL
+Copyright (C) 2024 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
@@ -16,7 +16,7 @@ import { observer } from "mobx-react";
import React from "react";
import styled from "styled-components";
-import { TransferItemDetails } from "@src/@types/MainItem";
+import { ActionItemDetails } from "@src/@types/MainItem";
import { MinionPool } from "@src/@types/MinionPool";
import { INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS } from "@src/components/modules/WizardModule/WizardOptions";
import WizardScripts from "@src/components/modules/WizardModule/WizardScripts";
@@ -28,8 +28,8 @@ import ToggleButtonBar from "@src/components/ui/ToggleButtonBar";
import KeyboardManager from "@src/utils/KeyboardManager";
import LabelDictionary from "@src/utils/LabelDictionary";
-import replicaMigrationImage from "./images/replica-migration.svg";
-import replicaMigrationFields from "./replicaMigrationFields";
+import deploymentImage from "./images/deployment.svg";
+import deploymentFields from "./DeploymentFields";
import type { Field } from "@src/@types/Field";
import type { Instance, InstanceScript } from "@src/@types/Instance";
@@ -43,7 +43,7 @@ const Wrapper = styled.div`
const Image = styled.div`
${ThemeProps.exactWidth("288px")}
${ThemeProps.exactHeight("96px")}
- background: url('${replicaMigrationImage}') center no-repeat;
+ background: url('${deploymentImage}') center no-repeat;
margin: 80px 0;
`;
const OptionsBody = styled.div`
@@ -78,13 +78,13 @@ const FieldInputStyled = styled(FieldInput)`
type Props = {
instances: Instance[];
- transferItem: TransferItemDetails | null;
+ transferItem: ActionItemDetails | null;
minionPools: MinionPool[];
loadingInstances: boolean;
defaultSkipOsMorphing?: boolean | null;
- migrating?: boolean;
+ deploying?: boolean;
onCancelClick: () => void;
- onMigrateClick: (opts: {
+ onDeployClick: (opts: {
fields: Field[];
uploadedUserScripts: InstanceScript[];
removedUserScripts: InstanceScript[];
@@ -101,7 +101,7 @@ type State = {
};
@observer
-class ReplicaMigrationOptions extends React.Component {
+class DeploymentOptions extends React.Component {
state: State = {
fields: [],
selectedBarButton: "options",
@@ -117,7 +117,7 @@ class ReplicaMigrationOptions extends React.Component {
this.props.transferItem?.instance_osmorphing_minion_pool_mappings || {};
this.setState({
- fields: replicaMigrationFields.map(f =>
+ fields: deploymentFields.map(f =>
f.name === "skip_os_morphing"
? { ...f, value: this.props.defaultSkipOsMorphing || null }
: f
@@ -128,9 +128,9 @@ class ReplicaMigrationOptions extends React.Component {
componentDidMount() {
KeyboardManager.onEnter(
- "migration-options",
+ "deployment-options",
() => {
- this.migrate();
+ this.deploy();
},
2
);
@@ -145,11 +145,11 @@ class ReplicaMigrationOptions extends React.Component {
}
componentWillUnmount() {
- KeyboardManager.removeKeyDown("migration-options");
+ KeyboardManager.removeKeyDown("deployment-options");
}
- migrate() {
- this.props.onMigrateClick({
+ deploy() {
+ this.props.onDeployClick({
fields: this.state.fields,
uploadedUserScripts: this.state.uploadedScripts,
removedUserScripts: this.state.removedScripts,
@@ -323,15 +323,15 @@ class ReplicaMigrationOptions extends React.Component {
Cancel
- {this.props.migrating ? (
- Migrating ...
+ {this.props.deploying ? (
+ Deploying ...
) : (
{
- this.migrate();
+ this.deploy();
}}
>
- Migrate
+ Deploy
)}
@@ -340,4 +340,4 @@ class ReplicaMigrationOptions extends React.Component {
}
}
-export default ReplicaMigrationOptions;
+export default DeploymentOptions;
diff --git a/src/components/modules/TransferModule/ReplicaMigrationOptions/ReplicaMigrationOptions.spec.tsx b/src/components/modules/TransferModule/DeploymentOptions/ReplicaDeploymentOptions.spec.tsx
similarity index 81%
rename from src/components/modules/TransferModule/ReplicaMigrationOptions/ReplicaMigrationOptions.spec.tsx
rename to src/components/modules/TransferModule/DeploymentOptions/ReplicaDeploymentOptions.spec.tsx
index f78f5728..0ef9f3ec 100644
--- a/src/components/modules/TransferModule/ReplicaMigrationOptions/ReplicaMigrationOptions.spec.tsx
+++ b/src/components/modules/TransferModule/DeploymentOptions/ReplicaDeploymentOptions.spec.tsx
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2023 Cloudbase Solutions SRL
+Copyright (C) 2024 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
@@ -21,7 +21,7 @@ import { MINION_POOL_MOCK } from "@tests/mocks/MinionPoolMock";
import { REPLICA_ITEM_DETAILS_MOCK } from "@tests/mocks/TransferMock";
import TestUtils from "@tests/TestUtils";
-import ReplicaMigrationOptions from "./";
+import ReplicaDeploymentOptions from ".";
jest.mock("@src/plugins/default/ContentPlugin", () => jest.fn(() => null));
jest.mock("@src/components/modules/WizardModule/WizardScripts", () => ({
@@ -62,8 +62,8 @@ jest.mock("@src/components/modules/WizardModule/WizardScripts", () => ({
),
}));
-describe("ReplicaMigrationOptions", () => {
- let defaultProps: ReplicaMigrationOptions["props"];
+describe("ReplicaDeploymentOptions", () => {
+ let defaultProps: ReplicaDeploymentOptions["props"];
beforeEach(() => {
defaultProps = {
@@ -75,30 +75,30 @@ describe("ReplicaMigrationOptions", () => {
],
loadingInstances: false,
onCancelClick: jest.fn(),
- onMigrateClick: jest.fn(),
+ onDeployClick: jest.fn(),
onResizeUpdate: jest.fn(),
};
});
it("renders without crashing", () => {
- const { getByText } = render( );
- expect(getByText("Migrate")).toBeTruthy();
+ const { getByText } = render( );
+ expect(getByText("Deploy")).toBeTruthy();
});
it("executes on Enter", () => {
- render( );
+ render( );
fireEvent.keyDown(document.body, { key: "Enter" });
- expect(defaultProps.onMigrateClick).toHaveBeenCalled();
+ expect(defaultProps.onDeployClick).toHaveBeenCalled();
});
it("calls onResizeUpdate on selectedBarButton state change", () => {
- render( );
+ render( );
fireEvent.click(TestUtils.selectAll("ToggleButtonBar__Item-")[1]);
expect(defaultProps.onResizeUpdate).toHaveBeenCalled();
});
it("handles value change", () => {
- render( );
+ render( );
expect(TestUtils.select("Switch__Wrapper")?.textContent).toBe("Yes");
fireEvent.click(TestUtils.select("Switch__InputWrapper")!);
expect(TestUtils.select("Switch__Wrapper")?.textContent).toBe("No");
@@ -106,7 +106,7 @@ describe("ReplicaMigrationOptions", () => {
it("handles script operations", () => {
const { getByTestId } = render(
-
+
);
fireEvent.click(TestUtils.selectAll("ToggleButtonBar__Item-")[1]);
fireEvent.click(getByTestId("ScriptsUpload"));
@@ -128,15 +128,15 @@ describe("ReplicaMigrationOptions", () => {
});
it("doesn't render minion pool mappings", () => {
- const { rerender } = render( );
+ const { rerender } = render( );
expect(document.body.textContent).toContain("Minion Pool Mappings");
- rerender( );
+ rerender( );
expect(document.body.textContent).not.toContain("Minion Pool Mappings");
});
it("changes minion pool mappings value", () => {
- render( );
+ render( );
fireEvent.click(TestUtils.select("DropdownButton__Wrapper-")!);
const dropdownItem = TestUtils.selectAll("Dropdown__ListItem-")[2];
expect(dropdownItem.textContent).toBe("Pool2");
@@ -147,8 +147,8 @@ describe("ReplicaMigrationOptions", () => {
});
it("handles migrate click", () => {
- const { getByText } = render( );
- fireEvent.click(getByText("Migrate"));
- expect(defaultProps.onMigrateClick).toHaveBeenCalled();
+ const { getByText } = render( );
+ fireEvent.click(getByText("Deploy"));
+ expect(defaultProps.onDeployClick).toHaveBeenCalled();
});
});
diff --git a/src/components/modules/TransferModule/ReplicaMigrationOptions/images/replica-migration.svg b/src/components/modules/TransferModule/DeploymentOptions/images/deployment.svg
similarity index 100%
rename from src/components/modules/TransferModule/ReplicaMigrationOptions/images/replica-migration.svg
rename to src/components/modules/TransferModule/DeploymentOptions/images/deployment.svg
diff --git a/src/components/modules/TransferModule/DeploymentOptions/package.json b/src/components/modules/TransferModule/DeploymentOptions/package.json
new file mode 100644
index 00000000..054fb709
--- /dev/null
+++ b/src/components/modules/TransferModule/DeploymentOptions/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "DeploymentOptions",
+ "version": "0.0.0",
+ "private": true,
+ "main": "./DeploymentOptions.tsx"
+}
diff --git a/src/components/modules/TransferModule/ReplicaMigrationOptions/story.tsx b/src/components/modules/TransferModule/DeploymentOptions/story.tsx
similarity index 80%
rename from src/components/modules/TransferModule/ReplicaMigrationOptions/story.tsx
rename to src/components/modules/TransferModule/DeploymentOptions/story.tsx
index 1eea2ca6..87e3cebb 100644
--- a/src/components/modules/TransferModule/ReplicaMigrationOptions/story.tsx
+++ b/src/components/modules/TransferModule/DeploymentOptions/story.tsx
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2017 Cloudbase Solutions SRL
+Copyright (C) 2024 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
@@ -14,12 +14,12 @@ along with this program. If not, see .
import React from "react";
import { storiesOf } from "@storybook/react";
-import ReplicaMigrationOptions from ".";
+import ReplicaDeploymentOptions from ".";
const props: any = {};
-storiesOf("ReplicaMigrationOptions", module).add("default", () => (
+storiesOf("ReplicaDeploymentOptions", module).add("default", () => (
// eslint-disable-next-line react/jsx-props-no-spreading
-
+
));
diff --git a/src/components/modules/TransferModule/Executions/Executions.tsx b/src/components/modules/TransferModule/Executions/Executions.tsx
index 9583a64a..231f7902 100644
--- a/src/components/modules/TransferModule/Executions/Executions.tsx
+++ b/src/components/modules/TransferModule/Executions/Executions.tsx
@@ -412,10 +412,10 @@ class Executions extends React.Component {
- It looks like there are no executions in this replica.
+ It looks like there are no executions in this tranfer.
- This replica has not been executed yet.
+ This tranfer has not been executed yet.
Execute Now
diff --git a/src/components/modules/TransferModule/MainDetails/MainDetails.tsx b/src/components/modules/TransferModule/MainDetails/MainDetails.tsx
index 3d476639..1932266d 100644
--- a/src/components/modules/TransferModule/MainDetails/MainDetails.tsx
+++ b/src/components/modules/TransferModule/MainDetails/MainDetails.tsx
@@ -18,7 +18,7 @@ import { Link } from "react-router-dom";
import styled, { css } from "styled-components";
import fieldHelper from "@src/@types/Field";
-import { TransferItem } from "@src/@types/MainItem";
+import { ActionItem } from "@src/@types/MainItem";
import { MinionPool } from "@src/@types/MinionPool";
import EndpointLogos from "@src/components/modules/EndpointModule/EndpointLogos";
import TransferDetailsTable from "@src/components/modules/TransferModule/TransferDetailsTable";
@@ -128,7 +128,7 @@ const PropertyValue = styled.div`
`;
type Props = {
- item?: TransferItem | null;
+ item?: ActionItem | null;
minionPools: MinionPool[];
storageBackends: StorageBackend[];
destinationSchema: FieldType[];
@@ -423,13 +423,13 @@ class MainDetails extends React.Component {
) : null}
- {this.props.item?.type === "migration" &&
- this.props.item.replica_id ? (
+ {this.props.item?.type === "deployment" &&
+ this.props.item.transfer_id ? (
- Created from Replica
-
- {this.props.item.replica_id}
+ Created from Transfer
+
+ {this.props.item.transfer_id}
diff --git a/src/components/modules/TransferModule/MigrationDetailsContent/package.json b/src/components/modules/TransferModule/MigrationDetailsContent/package.json
deleted file mode 100644
index 3f60d51d..00000000
--- a/src/components/modules/TransferModule/MigrationDetailsContent/package.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "name": "MigrationDetailsContent",
- "version": "0.0.0",
- "private": true,
- "main": "./MigrationDetailsContent.tsx"
-}
diff --git a/src/components/modules/TransferModule/ReplicaDetailsContent/package.json b/src/components/modules/TransferModule/ReplicaDetailsContent/package.json
deleted file mode 100644
index 340a812a..00000000
--- a/src/components/modules/TransferModule/ReplicaDetailsContent/package.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "name": "ReplicaDetailsContent",
- "version": "0.0.0",
- "private": true,
- "main": "./ReplicaDetailsContent.tsx"
-}
diff --git a/src/components/modules/TransferModule/ReplicaExecutionOptions/package.json b/src/components/modules/TransferModule/ReplicaExecutionOptions/package.json
deleted file mode 100644
index 94805486..00000000
--- a/src/components/modules/TransferModule/ReplicaExecutionOptions/package.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "name": "ReplicaExecutionOptions",
- "version": "0.0.0",
- "private": true,
- "main": "./ReplicaExecutionOptions.tsx"
-}
diff --git a/src/components/modules/TransferModule/ReplicaMigrationOptions/package.json b/src/components/modules/TransferModule/ReplicaMigrationOptions/package.json
deleted file mode 100644
index 5f158d0c..00000000
--- a/src/components/modules/TransferModule/ReplicaMigrationOptions/package.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "name": "ReplicaMigrationOptions",
- "version": "0.0.0",
- "private": true,
- "main": "./ReplicaMigrationOptions.tsx"
-}
diff --git a/src/components/modules/TransferModule/Schedule/Schedule.tsx b/src/components/modules/TransferModule/Schedule/Schedule.tsx
index c95edd99..522a6b21 100644
--- a/src/components/modules/TransferModule/Schedule/Schedule.tsx
+++ b/src/components/modules/TransferModule/Schedule/Schedule.tsx
@@ -17,7 +17,7 @@ import { observer } from "mobx-react";
import React from "react";
import styled from "styled-components";
-import ReplicaExecutionOptions from "@src/components/modules/TransferModule/ReplicaExecutionOptions";
+import TransferExecutionOptions from "@src/components/modules/TransferModule/TransferExecutionOptions";
import ScheduleItem from "@src/components/modules/TransferModule/ScheduleItem";
import { ThemePalette, ThemeProps } from "@src/components/Theme";
import AlertModal from "@src/components/ui/AlertModal";
@@ -318,13 +318,13 @@ class Schedule extends React.Component {
{this.props.secondaryEmpty
- ? "Schedule this Replica"
- : "This Replica has no Schedules."}
+ ? "Schedule this Transfer"
+ : "This Transfer has no Schedules."}
{this.props.secondaryEmpty
- ? "You can schedule this replica so that it executes automatically."
- : "Add a new schedule so that the Replica executes automatically."}
+ ? "You can schedule this Transfer so that it executes automatically."
+ : "Add a new schedule so that the Transfer executes automatically."}
{this.props.adding ? (
Adding ...
@@ -407,7 +407,7 @@ class Schedule extends React.Component {
this.handleCloseOptionsModal();
}}
>
- {
diff --git a/src/components/modules/TransferModule/ReplicaDetailsContent/ReplicaDetailsContent.spec.tsx b/src/components/modules/TransferModule/TransferDetailsContent/ReplicaDetailsContent.spec.tsx
similarity index 98%
rename from src/components/modules/TransferModule/ReplicaDetailsContent/ReplicaDetailsContent.spec.tsx
rename to src/components/modules/TransferModule/TransferDetailsContent/ReplicaDetailsContent.spec.tsx
index 12728dd4..0624df7f 100644
--- a/src/components/modules/TransferModule/ReplicaDetailsContent/ReplicaDetailsContent.spec.tsx
+++ b/src/components/modules/TransferModule/TransferDetailsContent/ReplicaDetailsContent.spec.tsx
@@ -31,7 +31,7 @@ import { NETWORK_MOCK } from "@tests/mocks/NetworksMock";
import { STORAGE_BACKEND_MOCK } from "@tests/mocks/StoragesMock";
import { REPLICA_ITEM_DETAILS_MOCK } from "@tests/mocks/TransferMock";
-import ReplicaDetailsContent from "./";
+import ReplicaDetailsContent from ".";
const scheduleStoreMock = jest.createMockFromModule(
"@src/stores/ScheduleStore"
@@ -92,7 +92,7 @@ describe("ReplicaDetailsContent", () => {
onCancelExecutionClick: jest.fn(),
onDeleteExecutionClick: jest.fn(),
onExecuteClick: jest.fn(),
- onCreateMigrationClick: jest.fn(),
+ onCreateDeploymentClick: jest.fn(),
onDeleteReplicaClick: jest.fn(),
onAddScheduleClick: jest.fn(),
onScheduleChange: jest.fn(),
diff --git a/src/components/modules/TransferModule/ReplicaDetailsContent/ReplicaDetailsContent.tsx b/src/components/modules/TransferModule/TransferDetailsContent/TransferDetailsContent.tsx
similarity index 93%
rename from src/components/modules/TransferModule/ReplicaDetailsContent/ReplicaDetailsContent.tsx
rename to src/components/modules/TransferModule/TransferDetailsContent/TransferDetailsContent.tsx
index 013e295f..4cf1cf89 100644
--- a/src/components/modules/TransferModule/ReplicaDetailsContent/ReplicaDetailsContent.tsx
+++ b/src/components/modules/TransferModule/TransferDetailsContent/TransferDetailsContent.tsx
@@ -16,7 +16,7 @@ import { observer } from "mobx-react";
import React from "react";
import styled from "styled-components";
-import { ReplicaItemDetails } from "@src/@types/MainItem";
+import { TransferItemDetails } from "@src/@types/MainItem";
import { MinionPool } from "@src/@types/MinionPool";
import DetailsNavigation from "@src/components/modules/NavigationModule/DetailsNavigation";
import Executions from "@src/components/modules/TransferModule/Executions";
@@ -59,7 +59,7 @@ const DetailsBody = styled.div`
const NavigationItems = [
{
- label: "Replica",
+ label: "Transfer",
value: "",
},
{
@@ -74,7 +74,7 @@ const NavigationItems = [
type TimezoneValue = "utc" | "local";
type Props = {
- item?: ReplicaItemDetails | null;
+ item?: TransferItemDetails | null;
itemId: string;
endpoints: Endpoint[];
sourceSchema: Field[];
@@ -100,8 +100,8 @@ type Props = {
) => void;
onDeleteExecutionClick: (execution: Execution | null) => void;
onExecuteClick: () => void;
- onCreateMigrationClick: () => void;
- onDeleteReplicaClick: () => void;
+ onCreateDeploymentClick: () => void;
+ onDeleteTransferClick: () => void;
onAddScheduleClick: (schedule: ScheduleType) => void;
onScheduleChange: (
scheduleId: string | null,
@@ -115,7 +115,7 @@ type State = {
timezone: TimezoneValue;
};
@observer
-class ReplicaDetailsContent extends React.Component {
+class TransferDetailsContent extends React.Component {
state: State = {
timezone: "local",
};
@@ -153,19 +153,19 @@ class ReplicaDetailsContent extends React.Component {
disabled={this.getStatus() === "RUNNING"}
onClick={this.props.onExecuteClick}
>
- Execute Replica
+ Execute
- Create Migration
+ Deploy
-
- Delete Replica
+
+ Delete
@@ -256,7 +256,7 @@ class ReplicaDetailsContent extends React.Component {
items={NavigationItems}
selectedValue={this.props.page}
itemId={this.props.itemId}
- itemType="replica"
+ itemType="transfer"
/>
{this.renderMainDetails()}
@@ -268,4 +268,4 @@ class ReplicaDetailsContent extends React.Component {
}
}
-export default ReplicaDetailsContent;
+export default TransferDetailsContent;
diff --git a/src/components/modules/TransferModule/TransferDetailsContent/package.json b/src/components/modules/TransferModule/TransferDetailsContent/package.json
new file mode 100644
index 00000000..17f2b80d
--- /dev/null
+++ b/src/components/modules/TransferModule/TransferDetailsContent/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "TransferDetailsContent",
+ "version": "0.0.0",
+ "private": true,
+ "main": "./TransferDetailsContent.tsx"
+}
diff --git a/src/components/modules/TransferModule/ReplicaDetailsContent/story.tsx b/src/components/modules/TransferModule/TransferDetailsContent/story.tsx
similarity index 100%
rename from src/components/modules/TransferModule/ReplicaDetailsContent/story.tsx
rename to src/components/modules/TransferModule/TransferDetailsContent/story.tsx
diff --git a/src/components/modules/TransferModule/TransferDetailsTable/TransferDetailsTable.tsx b/src/components/modules/TransferModule/TransferDetailsTable/TransferDetailsTable.tsx
index 9f1ca9f7..ef2c51a8 100644
--- a/src/components/modules/TransferModule/TransferDetailsTable/TransferDetailsTable.tsx
+++ b/src/components/modules/TransferModule/TransferDetailsTable/TransferDetailsTable.tsx
@@ -20,7 +20,7 @@ import { EndpointUtils, StorageBackend } from "@src/@types/Endpoint";
import {
isNetworkMapSecurityGroups,
isNetworkMapSourceDest,
- TransferItem,
+ ActionItem,
TransferNetworkMap,
} from "@src/@types/MainItem";
import { MinionPool } from "@src/@types/MinionPool";
@@ -156,7 +156,7 @@ export const ArrowIcon = styled.div`
`;
export type Props = {
- item?: TransferItem | null;
+ item?: ActionItem | null;
instancesDetails: Instance[];
networks?: Network[];
minionPools: MinionPool[];
@@ -338,7 +338,7 @@ class TransferDetailsTable extends React.Component {
destinationBody = destinationBody.concat(getBody(transferDisk));
}
} else if (
- this.props.item?.type === "migration" &&
+ this.props.item?.type === "deployment" &&
(this.props.item.last_execution_status === "RUNNING" ||
this.props.item.last_execution_status ===
"AWAITING_MINION_ALLOCATIONS")
@@ -446,7 +446,7 @@ class TransferDetailsTable extends React.Component {
destinationBody = getBody(destinationNic);
}
} else if (
- this.props.item?.type === "migration" &&
+ this.props.item?.type === "deployment" &&
(this.props.item.last_execution_status === "RUNNING" ||
this.props.item.last_execution_status ===
"AWAITING_MINION_ALLOCATIONS")
@@ -501,7 +501,7 @@ class TransferDetailsTable extends React.Component {
destinationName = transferResult.instance_name || transferResult.name;
destinationBody = getBody(transferResult);
} else if (
- this.props.item?.type === "migration" &&
+ this.props.item?.type === "deployment" &&
(this.props.item.last_execution_status === "RUNNING" ||
this.props.item.last_execution_status === "AWAITING_MINION_ALLOCATIONS")
) {
diff --git a/src/components/modules/TransferModule/ReplicaExecutionOptions/ReplicaExecutionOptions.spec.tsx b/src/components/modules/TransferModule/TransferExecutionOptions/ReplicaExecutionOptions.spec.tsx
similarity index 98%
rename from src/components/modules/TransferModule/ReplicaExecutionOptions/ReplicaExecutionOptions.spec.tsx
rename to src/components/modules/TransferModule/TransferExecutionOptions/ReplicaExecutionOptions.spec.tsx
index 40e11391..729a1b8a 100644
--- a/src/components/modules/TransferModule/ReplicaExecutionOptions/ReplicaExecutionOptions.spec.tsx
+++ b/src/components/modules/TransferModule/TransferExecutionOptions/ReplicaExecutionOptions.spec.tsx
@@ -17,7 +17,7 @@ import React from "react";
import { fireEvent, render } from "@testing-library/react";
import TestUtils from "@tests/TestUtils";
-import ReplicaExecutionOptions from "./";
+import ReplicaExecutionOptions from ".";
jest.mock("@src/plugins/default/ContentPlugin", () => jest.fn(() => null));
diff --git a/src/components/modules/TransferModule/ReplicaExecutionOptions/ReplicaExecutionOptions.tsx b/src/components/modules/TransferModule/TransferExecutionOptions/TransferExecutionOptions.tsx
similarity index 86%
rename from src/components/modules/TransferModule/ReplicaExecutionOptions/ReplicaExecutionOptions.tsx
rename to src/components/modules/TransferModule/TransferExecutionOptions/TransferExecutionOptions.tsx
index d59f5a89..f8332dbf 100644
--- a/src/components/modules/TransferModule/ReplicaExecutionOptions/ReplicaExecutionOptions.tsx
+++ b/src/components/modules/TransferModule/TransferExecutionOptions/TransferExecutionOptions.tsx
@@ -25,6 +25,7 @@ import { executionOptions } from "@src/constants";
import type { Field } from "@src/@types/Field";
import executionImage from "./images/execution.svg";
+import LoadingButton from "@src/components/ui/LoadingButton/LoadingButton";
const Wrapper = styled.div`
display: flex;
@@ -56,6 +57,7 @@ type Props = {
disableExecutionOptions: boolean;
onChange?: (fieldName: string, fieldValue: string) => void;
executionLabel: string;
+ executing?: boolean;
onCancelClick: () => void;
onExecuteClick: (options: Field[]) => void;
};
@@ -63,9 +65,10 @@ type State = {
fields: Field[];
};
@observer
-class ReplicaExecutionOptions extends React.Component {
+class TransferExecutionOptions extends React.Component {
static defaultProps = {
executionLabel: "Execute",
+ executing: false,
};
state: State = {
@@ -128,7 +131,7 @@ class ReplicaExecutionOptions extends React.Component {
description={
this.props.disableExecutionOptions
? "The execution options are disabled for the source provider"
- : ""
+ : LabelDictionary.getDescription(field.name)
}
/>
))}
@@ -137,17 +140,21 @@ class ReplicaExecutionOptions extends React.Component {
Cancel
- {
- this.props.onExecuteClick(this.state.fields);
- }}
- >
- {this.props.executionLabel}
-
+ {this.props.executing ? (
+ Executing ...
+ ) : (
+ {
+ this.props.onExecuteClick(this.state.fields);
+ }}
+ >
+ {this.props.executionLabel}
+
+ )}
);
}
}
-export default ReplicaExecutionOptions;
+export default TransferExecutionOptions;
diff --git a/src/components/modules/TransferModule/ReplicaExecutionOptions/images/execution.svg b/src/components/modules/TransferModule/TransferExecutionOptions/images/execution.svg
similarity index 100%
rename from src/components/modules/TransferModule/ReplicaExecutionOptions/images/execution.svg
rename to src/components/modules/TransferModule/TransferExecutionOptions/images/execution.svg
diff --git a/src/components/modules/TransferModule/TransferExecutionOptions/package.json b/src/components/modules/TransferModule/TransferExecutionOptions/package.json
new file mode 100644
index 00000000..d3a07135
--- /dev/null
+++ b/src/components/modules/TransferModule/TransferExecutionOptions/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "TransferExecutionOptions",
+ "version": "0.0.0",
+ "private": true,
+ "main": "./TransferExecutionOptions.tsx"
+}
diff --git a/src/components/modules/TransferModule/ReplicaExecutionOptions/story.tsx b/src/components/modules/TransferModule/TransferExecutionOptions/story.tsx
similarity index 100%
rename from src/components/modules/TransferModule/ReplicaExecutionOptions/story.tsx
rename to src/components/modules/TransferModule/TransferExecutionOptions/story.tsx
diff --git a/src/components/modules/TransferModule/TransferItemModal/TransferItemModal.tsx b/src/components/modules/TransferModule/TransferItemModal/TransferItemModal.tsx
index 7923e53b..ce9c4837 100644
--- a/src/components/modules/TransferModule/TransferItemModal/TransferItemModal.tsx
+++ b/src/components/modules/TransferModule/TransferItemModal/TransferItemModal.tsx
@@ -19,8 +19,7 @@ import styled from "styled-components";
import providerStore, {
getFieldChangeOptions,
} from "@src/stores/ProviderStore";
-import replicaStore from "@src/stores/ReplicaStore";
-import migrationStore from "@src/stores/MigrationStore";
+import transferStore from "@src/stores/TransferStore";
import endpointStore from "@src/stores/EndpointStore";
import { OptionsSchemaPlugin } from "@src/plugins";
@@ -39,8 +38,8 @@ import WizardStorage from "@src/components/modules/WizardModule/WizardStorage";
import type {
UpdateData,
- TransferItemDetails,
- MigrationItemDetails,
+ ActionItemDetails,
+ DeploymentItemDetails,
} from "@src/@types/MainItem";
import {
Endpoint,
@@ -57,7 +56,7 @@ import {
SecurityGroup,
} from "@src/@types/Network";
-import { providerTypes, migrationFields } from "@src/constants";
+import { providerTypes } from "@src/constants";
import configLoader from "@src/utils/Config";
import LoadingButton from "@src/components/ui/LoadingButton";
import minionPoolStore from "@src/stores/MinionPoolStore";
@@ -105,11 +104,11 @@ const Buttons = styled.div`
type Width = "normal" | "wide";
type Props = {
- type?: "replica" | "migration";
+ type?: "transfer" | "deployment";
isOpen: boolean;
onRequestClose: () => void;
onUpdateComplete: (redirectTo: string) => void;
- replica: TransferItemDetails;
+ transfer: ActionItemDetails;
destinationEndpoint: Endpoint;
sourceEndpoint: Endpoint;
instancesDetails: Instance[];
@@ -187,7 +186,7 @@ class TransferItemModal extends React.Component {
getStorageMap(storageBackends: StorageBackend[]): StorageMap[] {
const storageMap: StorageMap[] = [];
- const currentStorage = this.props.replica.storage_mappings;
+ const currentStorage = this.props.transfer.storage_mappings;
const buildStorageMap = (
type: "backend" | "disk",
mapping: any
@@ -246,7 +245,7 @@ class TransferItemModal extends React.Component {
getSelectedNetworks(): NetworkMap[] {
const selectedNetworks: NetworkMap[] = [];
- const networkMap: any = this.props.replica.network_map;
+ const networkMap: any = this.props.transfer.network_map;
if (networkMap) {
Object.keys(networkMap).forEach(sourceNetworkName => {
@@ -334,8 +333,8 @@ class TransferItemModal extends React.Component {
return defaultStorage;
};
- if (this.props.replica.storage_mappings?.default) {
- return buildDefaultStorage(this.props.replica.storage_mappings.default);
+ if (this.props.transfer.storage_mappings?.default) {
+ return buildDefaultStorage(this.props.transfer.storage_mappings.default);
}
if (endpointStore.storageConfigDefault) {
@@ -354,8 +353,8 @@ class TransferItemModal extends React.Component {
const currentData =
type === "source" ? this.state.sourceData : this.state.destinationData;
- const replicaMinionMappings =
- this.props.replica[INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS];
+ const transferMinionMappings =
+ this.props.transfer[INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS];
if (parentFieldName) {
if (
@@ -366,10 +365,10 @@ class TransferItemModal extends React.Component {
}
if (
parentFieldName === INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS &&
- replicaMinionMappings &&
- replicaMinionMappings[fieldName] !== undefined
+ transferMinionMappings &&
+ transferMinionMappings[fieldName] !== undefined
) {
- return replicaMinionMappings[fieldName];
+ return transferMinionMappings[fieldName];
}
}
@@ -378,8 +377,8 @@ class TransferItemModal extends React.Component {
}
if (fieldName === "title") {
- if (this.props.replica.notes) {
- return this.props.replica.notes;
+ if (this.props.transfer.notes) {
+ return this.props.transfer.notes;
}
let title = this.props.instancesDetails?.[0]?.name;
if (
@@ -393,22 +392,22 @@ class TransferItemModal extends React.Component {
if (fieldName === "minion_pool_id") {
return type === "source"
- ? this.props.replica.origin_minion_pool_id
- : this.props.replica.destination_minion_pool_id;
+ ? this.props.transfer.origin_minion_pool_id
+ : this.props.transfer.destination_minion_pool_id;
}
- const replicaData: any =
+ const transferData: any =
type === "source"
- ? this.props.replica.source_environment
- : this.props.replica.destination_environment;
+ ? this.props.transfer.source_environment
+ : this.props.transfer.destination_environment;
if (parentFieldName) {
- if (replicaData[parentFieldName]?.[fieldName] !== undefined) {
- return replicaData[parentFieldName][fieldName];
+ if (transferData[parentFieldName]?.[fieldName] !== undefined) {
+ return transferData[parentFieldName][fieldName];
}
}
- if (replicaData[fieldName] !== undefined) {
- return replicaData[fieldName];
+ if (transferData[fieldName] !== undefined) {
+ return transferData[fieldName];
}
const endpoint =
type === "source"
@@ -419,16 +418,10 @@ class TransferItemModal extends React.Component {
const osMapping = /^(windows|linux)/.exec(fieldName);
if (osMapping) {
const osData =
- replicaData[`${plugin.migrationImageMapFieldName}/${osMapping[0]}`];
+ transferData[`${plugin.migrationImageMapFieldName}/${osMapping[0]}`];
return osData;
}
- const anyData = this.props.replica as any;
- if (migrationFields.find(f => f.name === fieldName) && anyData[fieldName]) {
- return anyData[fieldName];
- }
- if (fieldName === "skip_os_morphing" && this.props.type === "migration") {
- return migrationStore.getDefaultSkipOsMorphing(anyData);
- }
+
return defaultValue;
}
@@ -474,11 +467,9 @@ class TransferItemModal extends React.Component {
useCache,
});
} catch (err) {
- if (optionsType === "destination" || this.props.type === "migration") {
+ if (optionsType === "destination") {
const destinationFailedMessage =
- this.props.type === "replica"
- ? "An error has occurred during the loading of the Replica's options for editing. There could be connection issues with the destination platform. Please retry the operation."
- : "An error has occurred during loading of the source or destination platforms' environment options for editing of the Migration's parameters. You may still recreate the Migration with the same parameters as the original one by clicking \"Create\".";
+ "An error has occurred during the loading of the Transfer's options for editing. There could be connection issues with the destination platform. Please retry the operation.";
this.setState({ destinationFailedMessage });
}
throw err;
@@ -505,8 +496,8 @@ class TransferItemModal extends React.Component {
: this.props.destinationEndpoint;
const env = ObjectUtils.clone(
type === "source"
- ? this.props.replica.source_environment
- : this.props.replica.destination_environment
+ ? this.props.transfer.source_environment
+ : this.props.transfer.destination_environment
);
const stateEnv =
type === "source" ? this.state.sourceData : this.state.destinationData;
@@ -555,7 +546,7 @@ class TransferItemModal extends React.Component {
isUpdateDisabled() {
const isDestFailed =
- this.props.type === "replica" && this.state.destinationFailedMessage;
+ this.props.type === "transfer" && this.state.destinationFailedMessage;
return this.state.updateDisabled || isDestFailed;
}
@@ -593,8 +584,8 @@ class TransferItemModal extends React.Component {
validateOptions(type: "source" | "destination") {
const env = ObjectUtils.clone(
type === "source"
- ? this.props.replica.source_environment
- : this.props.replica.destination_environment
+ ? this.props.transfer.source_environment
+ : this.props.transfer.destination_environment
);
const data =
@@ -632,13 +623,13 @@ class TransferItemModal extends React.Component {
? { ...this.state.sourceData }
: { ...this.state.destinationData };
- const replicaData: any =
+ const transferData: any =
type === "source"
- ? this.props.replica.source_environment
- : this.props.replica.destination_environment;
+ ? this.props.transfer.source_environment
+ : this.props.transfer.destination_environment;
if (field.type === "array") {
const currentValues: string[] = data[field.name] || [];
- const oldValues: string[] = replicaData[field.name] || [];
+ const oldValues: string[] = transferData[field.name] || [];
let values: string[] = currentValues;
if (!currentValues.length) {
values = [...oldValues];
@@ -658,7 +649,7 @@ class TransferItemModal extends React.Component {
// existing fields from Object options from the previous Migration/Replica,
// we always re-merge all the values on an object field update.
data[parentFieldName] =
- data[parentFieldName] || replicaData[parentFieldName] || {};
+ data[parentFieldName] || transferData[parentFieldName] || {};
data[parentFieldName][field.name] = value;
} else {
data[field.name] = value;
@@ -706,51 +697,21 @@ class TransferItemModal extends React.Component {
uploadedScripts: this.state.uploadedScripts,
removedScripts: this.state.removedScripts,
};
- if (this.props.type === "replica") {
- try {
- await replicaStore.update({
- replica: this.props.replica as any,
- sourceEndpoint: this.props.sourceEndpoint,
- destinationEndpoint: this.props.destinationEndpoint,
- updateData,
- defaultStorage: this.getDefaultStorage(),
- storageConfigDefault: endpointStore.storageConfigDefault,
- });
- this.props.onRequestClose();
- this.props.onUpdateComplete(
- `/replicas/${this.props.replica.id}/executions`
- );
- } catch (err) {
- this.setState({ updating: false });
- }
- } else {
- try {
- const defaultStorage = EndpointUtils.getBusTypeStorageId(
- endpointStore.storageBackends,
- this.props.replica.storage_mappings?.default || null
- );
- const replicaDefaultStorage: {
- value: string | null;
- busType?: string | null;
- } = {
- value: defaultStorage.id,
- busType: defaultStorage.busType,
- };
- const migration: MigrationItemDetails = await migrationStore.recreate({
- migration: this.props.replica as any,
- sourceEndpoint: this.props.sourceEndpoint,
- destEndpoint: this.props.destinationEndpoint,
- updateData,
- defaultStorage: replicaDefaultStorage,
- updatedDefaultStorage: this.state.defaultStorage,
- replicationCount: this.props.replica.replication_count,
- });
- migrationStore.clearDetails();
- this.props.onRequestClose();
- this.props.onUpdateComplete(`/migrations/${migration.id}/tasks`);
- } catch (err) {
- this.setState({ updating: false });
- }
+ try {
+ await transferStore.update({
+ transfer: this.props.transfer as any,
+ sourceEndpoint: this.props.sourceEndpoint,
+ destinationEndpoint: this.props.destinationEndpoint,
+ updateData,
+ defaultStorage: this.getDefaultStorage(),
+ storageConfigDefault: endpointStore.storageConfigDefault,
+ });
+ this.props.onRequestClose();
+ this.props.onUpdateComplete(
+ `/transfers/${this.props.transfer.id}/executions`
+ );
+ } catch (err) {
+ this.setState({ updating: false });
}
}
@@ -842,7 +803,7 @@ class TransferItemModal extends React.Component {
? providerStore.sourceSchema
: providerStore.destinationSchema;
const fields =
- this.props.type === "replica" ? schema.filter(f => !f.readOnly) : schema;
+ this.props.type === "transfer" ? schema.filter(f => !f.readOnly) : schema;
const extraOptionsConfig = configLoader.config.extraOptionsApiCalls.find(
o => {
const provider =
@@ -870,7 +831,7 @@ class TransferItemModal extends React.Component {
return (
this.getFieldValue({
type,
@@ -918,7 +879,6 @@ class TransferItemModal extends React.Component {
"description",
"execute_now",
"execute_now_options",
- ...migrationFields.map(f => f.name),
]}
dictionaryKey={dictionaryKey}
executeNowOptionsDisabled={
@@ -989,7 +949,7 @@ class TransferItemModal extends React.Component {
}}
uploadedScripts={this.state.uploadedScripts}
removedScripts={this.state.removedScripts}
- userScriptData={this.props.replica?.user_scripts}
+ userScriptData={this.props.transfer?.user_scripts}
scrollableRef={(r: HTMLElement) => {
this.scrollableRef = r;
}}
@@ -1030,7 +990,7 @@ class TransferItemModal extends React.Component {
Loading ...
) : this.state.updating ? (
- {this.props.type === "replica" ? "Updating" : "Creating"} ...
+ {this.props.type === "transfer" ? "Updating" : "Creating"} ...
) : (
{
}}
disabled={this.isUpdateDisabled()}
>
- {this.props.type === "replica" ? "Update" : "Create"}
+ {this.props.type === "transfer" ? "Update" : "Create"}
)}
@@ -1098,9 +1058,7 @@ class TransferItemModal extends React.Component {
return (
this.scrollableRef}
@@ -1117,11 +1075,7 @@ class TransferItemModal extends React.Component {
onReloadClick={() => {
this.handleReload();
}}
- reloadLabel={
- this.props.type === "replica"
- ? "Reload All Replica Options"
- : "Reload All Migration Options"
- }
+ reloadLabel="Reload All Options"
/>
);
diff --git a/src/components/modules/TransferModule/TransferListItem/TransferListItem.tsx b/src/components/modules/TransferModule/TransferListItem/TransferListItem.tsx
index 4ad6ee16..c9c35a98 100644
--- a/src/components/modules/TransferModule/TransferListItem/TransferListItem.tsx
+++ b/src/components/modules/TransferModule/TransferListItem/TransferListItem.tsx
@@ -16,7 +16,7 @@ import { observer } from "mobx-react";
import React from "react";
import styled from "styled-components";
-import { getTransferItemTitle, TransferItem } from "@src/@types/MainItem";
+import { getTransferItemTitle, ActionItem } from "@src/@types/MainItem";
import EndpointLogos from "@src/components/modules/EndpointModule/EndpointLogos";
import { ThemePalette, ThemeProps } from "@src/components/Theme";
import Checkbox from "@src/components/ui/Checkbox";
@@ -106,10 +106,10 @@ const Column = styled.div`
`;
type Props = {
- item: TransferItem;
+ item: ActionItem;
onClick: () => void;
selected: boolean;
- image: string;
+ getListItemImage: (item: ActionItem) => string;
showScheduleIcon?: boolean;
endpointType: (endpointId: string) => string;
getUserName: (userId: string) => string | undefined;
@@ -122,6 +122,20 @@ class TransferListItem extends React.Component {
return this.props.item.last_execution_status;
}
+ getTransferScenarioType() {
+ let scenario = "";
+ switch(this.props.item.type) {
+ case "transfer":
+ scenario = this.props.item.scenario;
+ break;
+ case "deployment":
+ scenario = this.props.item.transfer_scenario;
+ break;
+ default:
+ }
+ return scenario;
+ }
+
renderCreationDate() {
return (
{
onChange={this.props.onSelectedChange}
/>
-
+
{getTransferItemTitle(this.props.item)}
@@ -204,7 +218,7 @@ class TransferListItem extends React.Component {
) : null}
{this.props.showScheduleIcon ? (
-
+
) : null}
diff --git a/src/components/modules/WizardModule/WizardOptions/WizardOptions.tsx b/src/components/modules/WizardModule/WizardOptions/WizardOptions.tsx
index 56069435..8e5752a2 100644
--- a/src/components/modules/WizardModule/WizardOptions/WizardOptions.tsx
+++ b/src/components/modules/WizardModule/WizardOptions/WizardOptions.tsx
@@ -24,7 +24,7 @@ import { ThemePalette, ThemeProps } from "@src/components/Theme";
import FieldInput from "@src/components/ui/FieldInput";
import StatusImage from "@src/components/ui/StatusComponents/StatusImage";
import ToggleButtonBar from "@src/components/ui/ToggleButtonBar";
-import { executionOptions, migrationFields } from "@src/constants";
+import { executionOptions } from "@src/constants";
import { MinionPoolStoreUtils } from "@src/stores/MinionPoolStore";
import configLoader from "@src/utils/Config";
import LabelDictionary from "@src/utils/LabelDictionary";
@@ -297,10 +297,7 @@ class WizardOptions extends React.Component {
});
}
- if (
- this.props.wizardType === "migration" ||
- this.props.wizardType === "migration-destination-options-edit"
- ) {
+ if (this.props.wizardType === "migration-destination-options-edit") {
fieldsSchema.push({
name: "skip_os_morphing",
type: "boolean",
@@ -331,7 +328,7 @@ class WizardOptions extends React.Component {
fieldsSchema.push(titleFieldSchema);
}
- if (this.props.wizardType === "replica") {
+ if (this.props.wizardType === "replica" || this.props.wizardType === "migration") {
fieldsSchema.push({
name: "execute_now",
type: "boolean",
@@ -350,23 +347,6 @@ class WizardOptions extends React.Component {
? "Enable 'Execute Now' to set 'Execute Now Options'"
: `Set the options for ${this.props.wizardType} execution`,
});
- } else if (
- this.props.wizardType === "migration" ||
- this.props.wizardType === "migration-destination-options-edit"
- ) {
- const shutdownInstanceField = migrationFields.find(
- f => f.name === "shutdown_instances"
- )!;
- shutdownInstanceField.disabled = this.props.executeNowOptionsDisabled;
- shutdownInstanceField.description = this.props.executeNowOptionsDisabled
- ? "The 'Shutdown Instances' option is disabled for the source provider"
- : shutdownInstanceField.description;
- fieldsSchema = [
- ...fieldsSchema,
- ...migrationFields.map(f =>
- f.name === "shutdown_instances" ? shutdownInstanceField : f
- ),
- ];
}
return fieldsSchema;
diff --git a/src/components/modules/WizardModule/WizardPageContent/WizardPageContent.tsx b/src/components/modules/WizardModule/WizardPageContent/WizardPageContent.tsx
index 7601ef48..bdad4437 100644
--- a/src/components/modules/WizardModule/WizardPageContent/WizardPageContent.tsx
+++ b/src/components/modules/WizardModule/WizardPageContent/WizardPageContent.tsx
@@ -35,7 +35,7 @@ import { ThemePalette, ThemeProps } from "@src/components/Theme";
import Button from "@src/components/ui/Button";
import InfoIcon from "@src/components/ui/InfoIcon";
import LoadingButton from "@src/components/ui/LoadingButton";
-import { migrationFields, providerTypes, wizardPages } from "@src/constants";
+import { providerTypes, wizardPages } from "@src/constants";
import endpointStore from "@src/stores/EndpointStore";
import instanceStore from "@src/stores/InstanceStore";
import minionPoolStore from "@src/stores/MinionPoolStore";
@@ -197,8 +197,8 @@ class WizardPageContent extends React.Component {
getProvidersType(type: string) {
return type === "source"
- ? providerTypes.SOURCE_REPLICA
- : providerTypes.TARGET_REPLICA;
+ ? providerTypes.SOURCE_TRANSFER
+ : providerTypes.TARGET_TRANSFER;
}
getProviders(direction: string): ProviderTypes[] {
@@ -524,7 +524,6 @@ class WizardPageContent extends React.Component {
"title",
"execute_now",
"execute_now_options",
- ...migrationFields.map(f => f.name),
]}
selectedInstances={this.props.wizardData.selectedInstances}
showSeparatePerVm={Boolean(
diff --git a/src/components/modules/WizardModule/WizardSummary/WizardSummary.tsx b/src/components/modules/WizardModule/WizardSummary/WizardSummary.tsx
index 7582d34f..41ad90aa 100644
--- a/src/components/modules/WizardModule/WizardSummary/WizardSummary.tsx
+++ b/src/components/modules/WizardModule/WizardSummary/WizardSummary.tsx
@@ -24,7 +24,6 @@ import { INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS } from "@src/components/module
import { getDisks } from "@src/components/modules/WizardModule/WizardStorage";
import { ThemePalette, ThemeProps } from "@src/components/Theme";
import StatusPill from "@src/components/ui/StatusComponents/StatusPill";
-import { migrationFields } from "@src/constants";
import configLoader from "@src/utils/Config";
import DateUtils from "@src/utils/DateUtils";
import LabelDictionary from "@src/utils/LabelDictionary";
@@ -448,25 +447,6 @@ class WizardSummary extends React.Component {
);
- const migrationOptions = [
-
- Shutdown Instances
-
- {this.getDefaultBooleanOption("shutdown_instances", false)
- ? "Yes"
- : "No"}
-
- ,
-
- Replication Count
-
- {(this.props.data.destOptions &&
- this.props.data.destOptions.replication_count) ||
- 2}
-
- ,
- ];
-
const renderDefaultStorageOption = () => (
Default Storage
@@ -487,7 +467,7 @@ class WizardSummary extends React.Component {
{type} Target Options
{this.props.wizardType === "replica" ? executeNowOption : null}
- {this.props.wizardType === "migration" ? migrationOptions : null}
+ {this.props.wizardType === "migration" ? executeNowOption: null}
{this.props.data.selectedInstances &&
this.props.data.selectedInstances.length > 1
? separateVmOption
@@ -498,7 +478,6 @@ class WizardSummary extends React.Component {
if (
optionName === "execute_now" ||
optionName === "separate_vm" ||
- migrationFields.find(f => f.name === optionName) ||
!data.destOptions ||
data.destOptions[optionName] == null ||
data.destOptions[optionName] === "" ||
diff --git a/src/components/modules/WizardModule/WizardType/WizardType.tsx b/src/components/modules/WizardModule/WizardType/WizardType.tsx
index fadd36a1..4e2b69cb 100644
--- a/src/components/modules/WizardModule/WizardType/WizardType.tsx
+++ b/src/components/modules/WizardModule/WizardType/WizardType.tsx
@@ -76,8 +76,14 @@ class WizardType extends React.Component {
Coriolis Migration
- A Coriolis Migration is a full instance migration between two
- cloud endpoints.
+ Coriolis Migrations allow for the incremental copying of
+ a virtual machine's data from the source environment to
+ disks in the target environment with zero downtime.
+
+ Migrations can be synced (executed) any number of times,
+ but can be deployed in the target environment only once.
+
+ Migrations are licenced one-time per each transferred VM.
@@ -90,12 +96,15 @@ class WizardType extends React.Component {
Coriolis Replica
- The Coriolis Replica is obtained by copying (replicating)
- incrementally the virtual machines data from the source
- environment to the target, without interfering with any running
- workload. A migration replica can then be finalized by
- automatically applying the required changes to adapt it to the
- target environment (migration phase).
+ Coriolis Replicas allow for the incremental copying of
+ a virtual machine's data from the source environment to
+ disks in the target environment with zero downtime.
+
+ Replicas can be synced (executed) any number of times,
+ and can be deployed in the target environment any time a
+ disaster recovery procedure is desired.
+
+ Replicas are licenced monthly per each replicated VM.
diff --git a/src/components/smart/AssessmentDetailsPage/AssessmentDetailsPage.tsx b/src/components/smart/AssessmentDetailsPage/AssessmentDetailsPage.tsx
deleted file mode 100644
index 4cd4f679..00000000
--- a/src/components/smart/AssessmentDetailsPage/AssessmentDetailsPage.tsx
+++ /dev/null
@@ -1,689 +0,0 @@
-/*
-Copyright (C) 2017 Cloudbase Solutions SRL
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU Affero General Public License as
-published by the Free Software Foundation, either version 3 of the
-License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Affero General Public License for more details.
-You should have received a copy of the GNU Affero General Public License
-along with this program. If not, see .
-*/
-
-import React from "react";
-import styled from "styled-components";
-import cookie from "js-cookie";
-import { observer } from "mobx-react";
-
-import DetailsTemplate from "@src/components/modules/TemplateModule/DetailsTemplate";
-import DetailsPageHeader from "@src/components/modules/DetailsModule/DetailsPageHeader";
-import DetailsContentHeader from "@src/components/modules/DetailsModule/DetailsContentHeader";
-import AssessmentDetailsContent from "@src/components/modules/AssessmentModule/AssessmentDetailsContent";
-import Modal from "@src/components/ui/Modal";
-import AssessmentMigrationOptions from "@src/components/modules/AssessmentModule/AssessmentMigrationOptions";
-import type { Endpoint } from "@src/@types/Endpoint";
-import type { Nic } from "@src/@types/Instance";
-import type { VmItem } from "@src/@types/Assessment";
-import type { Field } from "@src/@types/Field";
-import type { Network, NetworkMap } from "@src/@types/Network";
-
-import azureStore from "@src/stores/AzureStore";
-import type { LocalData } from "@src/stores/AzureStore";
-import endpointStore from "@src/stores/EndpointStore";
-import notificationStore from "@src/stores/NotificationStore";
-import replicaStore from "@src/stores/ReplicaStore";
-import instanceStore from "@src/stores/InstanceStore";
-import networkStore from "@src/stores/NetworkStore";
-import userStore from "@src/stores/UserStore";
-import assessmentStore from "@src/stores/AssessmentStore";
-import providerStore from "@src/stores/ProviderStore";
-
-import DomUtils from "@src/utils/DomUtils";
-import assessmentImage from "./images/assessment.svg";
-
-const Wrapper = styled.div``;
-
-type Props = {
- match: any;
- history: any;
-};
-type State = {
- selectedNetworks: NetworkMap[];
- showMigrationOptions: boolean;
- executeButtonDisabled: boolean;
- vmSearchValue: string;
- loadingTargetVmSizes: boolean;
- replicaSchema: Field[];
- migrationSchema: Field[];
-};
-@observer
-class AssessmentDetailsPage extends React.Component {
- state: State = {
- selectedNetworks: [],
- showMigrationOptions: false,
- executeButtonDisabled: false,
- vmSearchValue: "",
- loadingTargetVmSizes: false,
- replicaSchema: [],
- migrationSchema: [],
- };
-
- UNSAFE_componentWillMount() {
- document.title = "Assessment Details";
- const urlData: LocalData = DomUtils.decodeFromBase64Url(
- this.props.match.params.info
- );
- if (!azureStore.loadLocalData(urlData.assessmentName)) {
- azureStore.setLocalData(urlData);
- }
- this.azureAuthenticate();
- }
-
- componentWillUnmount() {
- azureStore.clearAssessmentDetails();
- azureStore.clearAssessedVms();
- instanceStore.clearInstancesDetails();
- }
-
- getLocalData(): LocalData {
- // at this point we know for sure that at least URL data is there
- const data: any = azureStore.localData;
- return data;
- }
-
- getUrlInfo() {
- return DomUtils.decodeFromBase64Url(this.props.match.params.info);
- }
-
- getSourceEndpoints() {
- const vms = azureStore.assessedVms;
- const connectionsInfo = endpointStore.connectionsInfo;
-
- if (vms.length === 0 || connectionsInfo.length === 0) {
- return [];
- }
- const endpoints = connectionsInfo.filter(endpoint =>
- vms.find(
- vm =>
- endpoint.connection_info.host &&
- endpoint.connection_info.host.toLowerCase() ===
- vm.properties.datacenterManagementServerName.toLowerCase()
- )
- );
- return endpoints;
- }
-
- getTargetEndpoints() {
- const endpoints = endpointStore.endpoints;
- return endpoints.filter(e => e.type === "azure");
- }
-
- getInstancesDetailsProgress() {
- const count = instanceStore.instancesDetailsCount;
- if (count < 5) {
- return null;
- }
- const remaining = instanceStore.instancesDetailsRemaining;
- return (count - remaining) / count;
- }
-
- getFilteredAssessedVms(vms?: VmItem[]) {
- let usableVms = vms;
- if (!usableVms) {
- usableVms = azureStore.assessedVms;
- }
- return usableVms.filter(
- vm =>
- `${vm.properties.displayName}`
- .toLowerCase()
- .indexOf(this.state.vmSearchValue.toLowerCase()) > -1
- );
- }
-
- getSourceEndpointId() {
- const localData = this.getLocalData();
- return localData.sourceEndpoint ? localData.sourceEndpoint.id : null;
- }
-
- getEnabledVms() {
- const sourceConnInfo = endpointStore.connectionsInfo.find(
- e => e.id === this.getSourceEndpointId()
- );
- if (!sourceConnInfo) {
- return [];
- }
-
- const sourceHost = sourceConnInfo.connection_info.host;
- if (!sourceHost) {
- return [];
- }
- return azureStore.assessedVms.filter(vm => {
- if (
- vm.properties.datacenterManagementServerName.toLowerCase() ===
- sourceHost.toLowerCase() &&
- instanceStore.instances.find(
- i =>
- i.name === vm.properties.displayName ||
- i.instance_name === vm.properties.displayName
- )
- ) {
- return true;
- }
- return false;
- });
- }
-
- getSelectAllVmsChecked() {
- if (
- this.getFilteredAssessedVms().length === 0 ||
- this.getEnabledVms().length === 0
- ) {
- return false;
- }
- const selectedVms = this.getLocalData().selectedVms;
- return (
- selectedVms.length ===
- this.getFilteredAssessedVms(this.getEnabledVms()).length
- );
- }
-
- handleVmSelectedChange(vm: VmItem, selected: boolean) {
- let selectedVms = this.getLocalData().selectedVms;
- const instanceInfo = instanceStore.instances.find(
- i =>
- i.name === vm.properties.displayName ||
- i.instance_name === vm.properties.displayName
- );
- if (selected) {
- selectedVms = [...selectedVms, vm.properties.displayName];
- azureStore.updateSelectedVms(selectedVms);
- if (instanceStore.loadingInstancesDetails) {
- this.loadInstancesDetails();
- return;
- }
- const sourceEndpointId = this.getSourceEndpointId();
- if (!sourceEndpointId || !instanceInfo) {
- return;
- }
- const localData = this.getLocalData();
- instanceStore.addInstanceDetails({
- endpointId: sourceEndpointId,
- instanceInfo,
- cache: true,
- env: {
- location: localData.locationName,
- resource_group: localData.resourceGroupName,
- },
- targetProvider: "azure",
- });
- } else {
- selectedVms = selectedVms.filter(m => m !== vm.properties.displayName);
- azureStore.updateSelectedVms(selectedVms);
- if (instanceStore.loadingInstancesDetails) {
- this.loadInstancesDetails();
- return;
- }
- if (instanceInfo) {
- instanceStore.removeInstanceDetails(instanceInfo);
- }
- }
- }
-
- handleSelectAllVmsChange(selected: boolean) {
- const selectedVms = selected
- ? [...this.getFilteredAssessedVms(this.getEnabledVms())]
- : [];
- azureStore.updateSelectedVms(
- selectedVms.map(v => v.properties.displayName)
- );
- this.loadInstancesDetails();
- }
-
- handleSourceEndpointChange(sourceEndpoint: Endpoint | null) {
- this.setState({ selectedNetworks: [] });
- azureStore.updateSourceEndpoint(sourceEndpoint);
- const sourceEndpointId = this.getSourceEndpointId();
- if (!sourceEndpointId) {
- return;
- }
- instanceStore.loadInstances(sourceEndpointId).then(() => {
- this.initSelectedVms();
- this.loadInstancesDetails();
- });
- }
-
- handleResourceGroupChange(resourceGroupName: string) {
- azureStore.updateResourceGroup(resourceGroupName);
- this.loadNetworks();
- this.loadTargetVmSizes();
- }
-
- handleLocationChange(locationName: string) {
- azureStore.updateLocation(locationName);
- this.loadNetworks();
- this.loadTargetVmSizes();
- }
-
- handleTargetEndpointChange(endpoint: Endpoint) {
- azureStore.updateTargetEndpoint(endpoint);
- this.loadTargetOptions().then(() => {
- this.loadTargetVmSizes();
- this.loadNetworks();
- });
- }
-
- handleUserItemClick(item: { value: string }) {
- switch (item.value) {
- case "signout":
- userStore.logout();
- break;
- default:
- }
- }
-
- handleNetworkChange(sourceNic: Nic, targetNetwork: Network) {
- this.setState(prevState => {
- let selectedNetworks = prevState.selectedNetworks;
-
- selectedNetworks = selectedNetworks.filter(
- n => n.sourceNic.network_name !== sourceNic.network_name
- );
- selectedNetworks.push({ sourceNic, targetNetwork });
- return { selectedNetworks };
- });
- }
-
- handleRefresh() {
- localStorage.removeItem("instances");
- localStorage.removeItem(`assessments-${cookie.get("projectId") || ""}`);
- localStorage.removeItem("instancesDetails");
- localStorage.removeItem("networks");
- window.location.reload();
- }
-
- handleMigrateClick() {
- const endpointType = this.getLocalData().endpoint.type;
- providerStore
- .loadOptionsSchema({
- providerName: endpointType,
- optionsType: "destination",
- })
- .then(() => {
- this.setState({ replicaSchema: providerStore.destinationSchema });
- return providerStore.loadOptionsSchema({
- providerName: endpointType,
- optionsType: "destination",
- });
- })
- .then(() => {
- this.setState({ migrationSchema: providerStore.destinationSchema });
- });
- this.setState({ showMigrationOptions: true });
- }
-
- handleCloseMigrationOptions() {
- this.setState({ showMigrationOptions: false });
- }
-
- handleVmSizeChange(vmId: string, vmSize: string) {
- azureStore.updateVmSize(vmId, vmSize);
- }
-
- handleGetVmSize(vm: VmItem): string {
- return this.getLocalData().selectedVmSizes[vm.properties.displayName];
- }
-
- handleVmSearchValueChange(vmSearchValue: string) {
- this.setState({ vmSearchValue });
- }
-
- azureAuthenticate() {
- const connectionInfo = this.getUrlInfo().connectionInfo;
- azureStore.authenticate(connectionInfo).then(() => {
- this.loadAssessmentDetails();
- });
- }
-
- loadEndpoints() {
- endpointStore.getEndpoints({ showLoading: true }).then(() => {
- this.loadSourceEndpointsInfo();
- });
- }
-
- loadSourceEndpointsInfo() {
- endpointStore
- .getConnectionsInfo(
- endpointStore.endpoints.filter(e => e.type === "vmware_vsphere")
- )
- .then(() => {
- const endpoints = this.getSourceEndpoints();
- const sourceEndpoint = endpoints.find(
- e => e.id === this.getSourceEndpointId()
- );
- if (sourceEndpoint) {
- this.handleSourceEndpointChange(sourceEndpoint);
- } else if (endpoints.length > 0) {
- this.handleSourceEndpointChange(endpoints[0]);
- } else {
- this.handleSourceEndpointChange(null);
- }
- });
- }
-
- loadAssessmentDetails() {
- const urlInfo = this.getUrlInfo();
- azureStore.getAssessmentDetails({ ...urlInfo }).then(() => {
- const location = azureStore.assessmentDetails
- ? azureStore.assessmentDetails.properties.azureLocation
- : "";
- azureStore.setLocation(location);
- // azureStore.getVmSizes({ ...urlInfo, location })
- this.loadNetworks();
- this.loadTargetOptions();
- this.loadTargetVmSizes();
- });
-
- azureStore.getAssessedVms({ ...urlInfo }).then(() => {
- this.initVmSizes();
- this.loadEndpoints();
- });
- }
-
- async loadTargetOptions(): Promise {
- const localData = this.getLocalData();
- const options = await providerStore.getOptionsValues({
- optionsType: "destination",
- endpointId: localData.endpoint.id,
- providerName: localData.endpoint.type,
- allowMultiple: true,
- });
- const locations = options.find(o => o.name === "location") as any;
- if (locations && locations.values) {
- const localDataFind = locations.values.find(
- (l: { id: string }) => l.id === localData.locationName
- );
- if (!localDataFind) {
- azureStore.updateLocation(locations.values[0].id);
- }
-
- azureStore.saveLocations(locations.values);
- }
- const resourceGroups = options.find(
- o_1 => o_1.name === "resource_group"
- ) as any;
- if (resourceGroups && resourceGroups.values) {
- const localDataFind = resourceGroups.values.find(
- (g: string) => g === localData.resourceGroupName
- );
- if (!localDataFind) {
- azureStore.updateResourceGroup(resourceGroups.values[0] as string);
- }
- azureStore.saveResourceGroups(resourceGroups.values);
- }
- }
-
- loadTargetVmSizes() {
- const localData = this.getLocalData();
- this.setState({ loadingTargetVmSizes: true });
- providerStore
- .getOptionsValues({
- optionsType: "destination",
- endpointId: localData.endpoint.id,
- providerName: localData.endpoint.type,
- envData: {
- location: localData.locationName,
- resource_group: localData.resourceGroupName,
- },
- allowMultiple: true,
- })
- .then(options => {
- const vmSizes: any = options.find(o => o.name === "vm_size");
- if (vmSizes && vmSizes.values) {
- azureStore.saveTargetVmSizes(vmSizes.values);
- }
- this.setState({ loadingTargetVmSizes: false });
- });
- }
-
- initSelectedVms() {
- const localData = this.getLocalData();
- const enabledVms = this.getEnabledVms().map(
- vm => vm.properties.displayName
- );
- if (localData.selectedVms.length === 0) {
- azureStore.updateSelectedVms(enabledVms);
- } else {
- azureStore.updateSelectedVms(
- enabledVms.filter(id => localData.selectedVms.find(i => i === id))
- );
- }
- }
-
- initVmSizes() {
- const vmSizes: any = {};
- const vms = azureStore.assessedVms;
- const localData = this.getLocalData();
-
- vms.forEach(vm => {
- vmSizes[vm.properties.displayName] =
- localData.selectedVmSizes[vm.properties.displayName] ||
- vm.properties.recommendedSize ||
- "auto";
- });
- azureStore.updateVmSizes(vmSizes);
- }
-
- loadNetworks() {
- const localData = this.getLocalData();
- this.setState({ selectedNetworks: [] });
- networkStore.loadNetworks(
- localData.endpoint.id,
- {
- location: localData.locationName,
- resource_group: localData.resourceGroupName,
- },
- { cache: true }
- );
- }
-
- loadInstancesDetails() {
- const localData = this.getLocalData();
- const selectedVms = localData.selectedVms;
- const instancesInfo = instanceStore.instances.filter(i =>
- selectedVms.find(m => i.instance_name === m || i.name === m)
- );
- instanceStore.clearInstancesDetails();
- const sourceEndpointId = this.getSourceEndpointId();
- if (!sourceEndpointId) {
- return;
- }
- instanceStore.loadInstancesDetails({
- endpointId: sourceEndpointId,
- instances: instancesInfo,
- // cache: true,
- skipLog: true,
- env: {
- location: localData.locationName,
- resource_group: localData.resourceGroupName,
- },
- targetProvider: "azure",
- });
- }
-
- handleMigrationExecute(fieldValues: { [prop: string]: any }) {
- const selectedVms = this.getLocalData().selectedVms;
- const selectedInstances = instanceStore.instancesDetails.filter(i =>
- selectedVms.find(m => i.name === m || i.instance_name === m)
- );
- const vmSizes: any = {};
- const localData = this.getLocalData();
- selectedInstances.forEach(i => {
- const vm = selectedVms.find(m => i.name === m || i.instance_name === m);
- const selectedVmSize =
- localData.selectedVmSizes[i.instance_name || i.name];
- if (vm && azureStore.vmSizes.find(s => s === selectedVmSize)) {
- vmSizes[i.instance_name || i.name] = selectedVmSize;
- }
- });
-
- this.setState({ executeButtonDisabled: true });
- const fieldValuesLocal = fieldValues;
- fieldValuesLocal.resource_group = localData.resourceGroupName;
- fieldValuesLocal.location = localData.locationName;
-
- assessmentStore
- .migrate({
- source: localData.sourceEndpoint,
- target: localData.endpoint,
- networks: [...this.state.selectedNetworks],
- fieldValues: fieldValuesLocal,
- vmSizes,
- selectedInstances,
- })
- .then(() => {
- this.setState({ showMigrationOptions: false });
- const type = fieldValuesLocal.use_replica ? "Replica" : "Migration";
- notificationStore.alert(`${type} was succesfully created`, "success");
-
- if (type === "Replica") {
- assessmentStore.migrations.forEach(replica => {
- replicaStore.execute(replica.id, [
- {
- name: "shutdown_instances",
- value: fieldValuesLocal.shutdown_instances || false,
- },
- ]);
- });
- }
-
- this.props.history.push(`/${type.toLowerCase()}s`);
- });
- }
-
- render() {
- const details = azureStore.assessmentDetails;
- const loading =
- azureStore.loadingAssessmentDetails ||
- azureStore.authenticating ||
- azureStore.loadingAssessedVms;
- const endpointsLoading =
- endpointStore.connectionsInfoLoading || endpointStore.loading;
- const status = details ? details.properties.status.toUpperCase() : "";
- const statusLabel = status === "COMPLETED" ? "READY" : status;
- const localData = this.getLocalData();
-
- return (
-
- {
- this.handleUserItemClick(item);
- }}
- />
- }
- contentHeaderComponent={
-
- }
- contentComponent={
- {
- this.handleTargetEndpointChange(endpoint);
- }}
- sourceEndpoints={this.getSourceEndpoints()}
- sourceEndpoint={localData.sourceEndpoint}
- locations={azureStore.locations}
- selectedLocation={localData.locationName}
- onLocationChange={locationName => {
- this.handleLocationChange(locationName);
- }}
- selectedResourceGroup={localData.resourceGroupName}
- resourceGroups={azureStore.coriolisResourceGroups}
- onResourceGroupChange={resourceGroupName => {
- this.handleResourceGroupChange(resourceGroupName);
- }}
- assessedVmsCount={azureStore.assessedVms.length}
- filteredAssessedVms={this.getFilteredAssessedVms()}
- onSourceEndpointChange={endpoint =>
- this.handleSourceEndpointChange(endpoint)
- }
- selectedVms={localData.selectedVms}
- onVmSelectedChange={(vm, selected) => {
- this.handleVmSelectedChange(vm, selected);
- }}
- selectAllVmsChecked={this.getSelectAllVmsChecked()}
- onSelectAllVmsChange={checked => {
- this.handleSelectAllVmsChange(checked);
- }}
- instances={instanceStore.instances}
- instancesDetails={instanceStore.instancesDetails}
- networks={networkStore.networks}
- selectedNetworks={this.state.selectedNetworks}
- vmSizes={azureStore.vmSizes}
- onVmSizeChange={(vmId, size) => {
- this.handleVmSizeChange(vmId, size);
- }}
- onGetSelectedVmSize={vm => this.handleGetVmSize(vm)}
- vmSearchValue={this.state.vmSearchValue}
- onVmSearchValueChange={value => {
- this.handleVmSearchValueChange(value);
- }}
- onNetworkChange={(sourceNic, targetNetwork) => {
- this.handleNetworkChange(sourceNic, targetNetwork);
- }}
- onRefresh={() => this.handleRefresh()}
- onMigrateClick={() => {
- this.handleMigrateClick();
- }}
- />
- }
- />
- {
- this.handleCloseMigrationOptions();
- }}
- >
- {
- this.handleCloseMigrationOptions();
- }}
- onExecuteClick={fieldValues => {
- this.handleMigrationExecute(fieldValues);
- }}
- replicaSchema={this.state.replicaSchema}
- migrationSchema={this.state.migrationSchema}
- executeButtonDisabled={this.state.executeButtonDisabled}
- />
-
-
- );
- }
-}
-
-export default AssessmentDetailsPage;
diff --git a/src/components/smart/AssessmentDetailsPage/images/assessment.svg b/src/components/smart/AssessmentDetailsPage/images/assessment.svg
deleted file mode 100644
index bcc12bd3..00000000
--- a/src/components/smart/AssessmentDetailsPage/images/assessment.svg
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
- Created with Sketch.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/components/smart/AssessmentDetailsPage/package.json b/src/components/smart/AssessmentDetailsPage/package.json
deleted file mode 100644
index 2a2d4cd4..00000000
--- a/src/components/smart/AssessmentDetailsPage/package.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "name": "AssessmentDetailsPage",
- "version": "0.0.0",
- "private": true,
- "main": "./AssessmentDetailsPage.tsx"
-}
diff --git a/src/components/smart/AssessmentsPage/AssessmentsPage.tsx b/src/components/smart/AssessmentsPage/AssessmentsPage.tsx
deleted file mode 100644
index 754dbf6a..00000000
--- a/src/components/smart/AssessmentsPage/AssessmentsPage.tsx
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
-Copyright (C) 2017 Cloudbase Solutions SRL
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU Affero General Public License as
-published by the Free Software Foundation, either version 3 of the
-License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Affero General Public License for more details.
-You should have received a copy of the GNU Affero General Public License
-along with this program. If not, see .
-*/
-
-import React from "react";
-import styled from "styled-components";
-import { observer } from "mobx-react";
-
-import FilterList from "@src/components/ui/Lists/FilterList";
-import MainTemplate from "@src/components/modules/TemplateModule/MainTemplate";
-import PageHeader from "@src/components/smart/PageHeader";
-import Navigation from "@src/components/modules/NavigationModule/Navigation";
-import DropdownFilterGroup from "@src/components/ui/Dropdowns/DropdownFilterGroup";
-import AssessmentListItem from "@src/components/modules/AssessmentModule/AssessmentListItem";
-import type { Assessment } from "@src/@types/Assessment";
-import type { Endpoint } from "@src/@types/Endpoint";
-
-import azureStore from "@src/stores/AzureStore";
-import assessmentStore from "@src/stores/AssessmentStore";
-import endpointStore from "@src/stores/EndpointStore";
-import projectStore from "@src/stores/ProjectStore";
-import userStore from "@src/stores/UserStore";
-import configLoader from "@src/utils/Config";
-import DropdownLink from "@src/components/ui/Dropdowns/DropdownLink";
-import DomUtils from "@src/utils/DomUtils";
-
-const Wrapper = styled.div``;
-
-type Props = { history: any };
-type State = { modalIsOpen: boolean };
-@observer
-class AssessmentsPage extends React.Component {
- state = {
- modalIsOpen: false,
- };
-
- disablePolling = false;
-
- pollTimeout = 0;
-
- UNSAFE_componentWillMount() {
- document.title = "Coriolis Planning";
-
- projectStore.getProjects();
-
- if (!azureStore.isLoadedForCurrentProject()) {
- assessmentStore.clearSelection();
- azureStore.clearAssessments();
- }
-
- this.disablePolling = false;
- this.pollData();
-
- endpointStore.getEndpoints({ showLoading: true }).then(() => {
- const endpoints = endpointStore.endpoints.filter(e => e.type === "azure");
- if (endpoints.length > 0) {
- this.chooseEndpoint(
- assessmentStore.selectedEndpoint &&
- assessmentStore.selectedEndpoint.id
- ? assessmentStore.selectedEndpoint
- : endpoints[0]
- );
- }
- });
- }
-
- componentWillUnmount() {
- this.disablePolling = true;
- clearTimeout(this.pollTimeout);
- }
-
- getEndpointsDropdownConfig(): DropdownLink["props"] & { key: string } {
- const endpoints = endpointStore.endpoints.filter(e => e.type === "azure");
- return {
- key: "endpoint",
- selectedItem: assessmentStore.selectedEndpoint
- ? assessmentStore.selectedEndpoint.id
- : "",
- items: endpoints.map(endpoint => ({
- label: endpoint.name,
- value: endpoint.id,
- endpoint,
- })),
- onChange: (item: any) => {
- this.chooseEndpoint(item.endpoint, true);
- },
- selectItemLabel: "Select Endpoint",
- noItemsLabel: endpointStore.loading ? "Loading ..." : "No Endpoints",
- };
- }
-
- getResourceGroupsDropdownConfig(): DropdownLink["props"] & { key: string } {
- const groups = azureStore.assessmentResourceGroups;
- return {
- key: "resource-group",
- selectedItem: assessmentStore.selectedResourceGroup
- ? assessmentStore.selectedResourceGroup.id
- : "",
- items: groups.map(group => ({
- label: group.name,
- value: group.id,
- group,
- })),
- onChange: (item: any) => {
- this.chooseResourceGroup(item.group);
- },
- selectItemLabel: "Loading ...",
- noItemsLabel: this.areResourceGroupsLoading()
- ? "Loading ..."
- : "No Resource Groups",
- };
- }
-
- getFilterItems(): { label: string; value: string }[] {
- const types = [{ label: "All projects", value: "all" }];
- const assessments = azureStore.assessments;
- const uniqueProjects: { name: string }[] = [];
-
- assessments.forEach(a => {
- if (uniqueProjects.findIndex(p => p.name === a.project.name) === -1) {
- uniqueProjects.push(a.project);
- }
- });
-
- const projects = uniqueProjects.map(p => ({
- label: p.name,
- value: p.name,
- }));
- return types.concat(projects);
- }
-
- handleReloadButtonClick() {
- if (!endpointStore.connectionInfo) {
- return;
- }
-
- azureStore.getAssessments({
- subscriptionId: endpointStore.connectionInfo.subscription_id,
- resourceGroupName: assessmentStore.selectedResourceGroup?.name || "",
- projectId: userStore.loggedUser?.project.id || "",
- });
- }
-
- handleItemClick(assessment: Assessment) {
- if (assessment.properties.status.toUpperCase() !== "COMPLETED") {
- return;
- }
-
- const connectionInfo = endpointStore.connectionInfo;
- const endpoint = assessmentStore.selectedEndpoint;
- const resourceGroupName = assessmentStore.selectedResourceGroup
- ? assessmentStore.selectedResourceGroup.name
- : "";
- const projectName = assessment.project.name;
- const groupName = assessment.group.name;
- const assessmentName = assessment.name;
-
- const info = {
- endpoint,
- connectionInfo,
- resourceGroupName,
- projectName,
- groupName,
- assessmentName,
- };
-
- this.props.history.push(
- `/assessment/${DomUtils.encodeToBase64Url({ ...info })}`
- );
- }
-
- handleProjectChange() {
- assessmentStore.clearSelection();
- azureStore.clearAssessments();
- endpointStore.getEndpoints({ showLoading: true }).then(() => {
- const endpoints = endpointStore.endpoints.filter(e => e.type === "azure");
- if (endpoints.length > 0) {
- this.chooseEndpoint(
- assessmentStore.selectedEndpoint &&
- assessmentStore.selectedEndpoint.id
- ? assessmentStore.selectedEndpoint
- : endpoints[0]
- );
- }
- });
- }
-
- handleModalOpen() {
- this.setState({ modalIsOpen: true });
- }
-
- handleModalClose() {
- this.setState({ modalIsOpen: false }, () => {
- this.pollData();
- });
- }
-
- areResourceGroupsLoading() {
- return azureStore.authenticating || azureStore.loadingResourceGroups;
- }
-
- pollData() {
- if (this.disablePolling || this.state.modalIsOpen) {
- return;
- }
-
- const connectionInfo = endpointStore.connectionInfo;
- const selectedResourceGroup = assessmentStore.selectedResourceGroup;
-
- if (
- !connectionInfo ||
- !connectionInfo.subscription_id ||
- !selectedResourceGroup ||
- !selectedResourceGroup.name
- ) {
- this.pollTimeout = window.setTimeout(() => {
- this.pollData();
- }, configLoader.config.requestPollTimeout);
- return;
- }
-
- azureStore
- .getAssessments({
- subscriptionId: connectionInfo.subscription_id,
- resourceGroupName: selectedResourceGroup.name,
- projectId: userStore.loggedUser?.project.id || "",
- backgroundLoading: true,
- skipLog: true,
- })
- .then(() => {
- this.pollTimeout = window.setTimeout(() => {
- this.pollData();
- }, configLoader.config.requestPollTimeout);
- });
- }
-
- chooseResourceGroup(selectedResourceGroup: Assessment["group"]) {
- if (!endpointStore.connectionInfo) {
- return;
- }
-
- assessmentStore.updateSelectedResourceGroup(selectedResourceGroup);
- azureStore.getAssessments({
- subscriptionId: endpointStore.connectionInfo.subscription_id,
- resourceGroupName: selectedResourceGroup.name,
- projectId: userStore.loggedUser?.project.id || "",
- });
- }
-
- chooseEndpoint(selectedEndpoint: Endpoint, clearResourceGroup?: boolean) {
- if (
- assessmentStore.selectedEndpoint &&
- assessmentStore.selectedEndpoint.id === selectedEndpoint.id
- ) {
- return;
- }
-
- assessmentStore.updateSelectedEndpoint(selectedEndpoint);
-
- if (clearResourceGroup) {
- assessmentStore.updateSelectedResourceGroup(null);
- }
-
- endpointStore.getConnectionInfo(selectedEndpoint).then(() => {
- const connectionInfo = endpointStore.connectionInfo;
- if (!connectionInfo) {
- return;
- }
- azureStore.authenticate(connectionInfo).then(() => {
- azureStore
- .getResourceGroups(connectionInfo.subscription_id)
- .then(() => {
- const groups = azureStore.assessmentResourceGroups;
- const selectedGroup = assessmentStore.selectedResourceGroup;
-
- if (
- groups.filter((rg: any) =>
- rg.id === selectedGroup ? selectedGroup?.id : ""
- ).length > 0
- ) {
- return;
- }
- if (groups.length > 0) {
- const defaultResourceGroup =
- groups.find(
- g => g.name === connectionInfo.default_resource_group
- ) || groups[0];
- this.chooseResourceGroup(defaultResourceGroup);
- }
- });
- });
- });
- }
-
- itemFilterFunction(
- item: any,
- filterItem?: string | null,
- filterText?: string
- ) {
- const assessment: Assessment = item;
- if (
- (filterItem !== "all" && assessment.project.name !== filterItem) ||
- (item.name.toLowerCase().indexOf(filterText) === -1 &&
- assessment.id.toLowerCase().indexOf(filterText || "") === -1)
- ) {
- return false;
- }
-
- return true;
- }
-
- render() {
- return (
-
- }
- listComponent={
- {
- const itemAny: any = item;
- const assessment: Assessment = itemAny;
- this.handleItemClick(assessment);
- }}
- onReloadButtonClick={() => {
- this.handleReloadButtonClick();
- }}
- itemFilterFunction={(...args) => this.itemFilterFunction(...args)}
- renderItemComponent={options => {
- const optionsAny: any = options;
- // eslint-disable-next-line react/jsx-props-no-spreading
- return ;
- }}
- customFilterComponent={
-
- }
- emptyListImage={null}
- emptyListMessage="You don’t have any Assessments."
- emptyListExtraMessage="Try selecting a new Endpoint or a new Resource Group."
- />
- }
- headerComponent={
- {
- this.handleProjectChange();
- }}
- onModalOpen={() => {
- this.handleModalOpen();
- }}
- onModalClose={() => {
- this.handleModalClose();
- }}
- />
- }
- />
-
- );
- }
-}
-
-export default AssessmentsPage;
diff --git a/src/components/smart/AssessmentsPage/package.json b/src/components/smart/AssessmentsPage/package.json
deleted file mode 100644
index 76aa24be..00000000
--- a/src/components/smart/AssessmentsPage/package.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "name": "AssessmentsPage",
- "version": "0.0.0",
- "private": true,
- "main": "./AssessmentsPage.tsx"
-}
diff --git a/src/components/smart/DashboardPage/DashboardPage.tsx b/src/components/smart/DashboardPage/DashboardPage.tsx
index f6ddf567..2d76a86b 100644
--- a/src/components/smart/DashboardPage/DashboardPage.tsx
+++ b/src/components/smart/DashboardPage/DashboardPage.tsx
@@ -22,10 +22,10 @@ import MainTemplate from "@src/components/modules/TemplateModule/MainTemplate";
import PageHeader from "@src/components/smart/PageHeader";
import endpointStore from "@src/stores/EndpointStore";
import licenceStore from "@src/stores/LicenceStore";
-import migrationStore from "@src/stores/MigrationStore";
+import deploymentStore from "@src/stores/DeploymentStore";
import notificationStore from "@src/stores/NotificationStore";
import projectStore from "@src/stores/ProjectStore";
-import replicaStore from "@src/stores/ReplicaStore";
+import transferStore from "@src/stores/TransferStore";
import userStore from "@src/stores/UserStore";
import configLoader from "@src/utils/Config";
import Utils from "@src/utils/ObjectUtils";
@@ -99,8 +99,8 @@ class ProjectsPage extends React.Component<{ history: any }, State> {
this.loadAdminData(showLoading);
await Promise.all([
- replicaStore.getReplicas({ skipLog: true, showLoading }),
- migrationStore.getMigrations({ skipLog: true, showLoading }),
+ transferStore.getTransfers({ skipLog: true, showLoading }),
+ deploymentStore.getDeployments({ skipLog: true, showLoading }),
endpointStore.getEndpoints({ skipLog: true, showLoading }),
projectStore.getProjects({ skipLog: true, showLoading }),
]);
@@ -128,8 +128,8 @@ class ProjectsPage extends React.Component<{ history: any }, State> {
listNoMargin
listComponent={
{
notificationItems={notificationStore.notificationItems}
notificationItemsLoading={notificationStore.loading}
endpointsLoading={endpointStore.loading}
- migrationsLoading={migrationStore.loading}
+ deploymentsLoading={deploymentStore.loading}
projectsLoading={projectStore.projects.length === 0}
usersLoading={userStore.users.length === 0}
licenceLoading={licenceStore.loadingLicenceInfo}
licenceError={licenceStore.licenceInfoError}
- replicasLoading={replicaStore.loading}
- onNewReplicaClick={() => {
+ transfersLoading={transferStore.loading}
+ onNewTransferClick={() => {
this.props.history.push("/wizard/replica");
}}
onNewEndpointClick={() => {
diff --git a/src/components/smart/MigrationDetailsPage/MigrationDetailsPage.tsx b/src/components/smart/DeploymentDetailsPage/DeploymentDetailsPage.tsx
similarity index 65%
rename from src/components/smart/MigrationDetailsPage/MigrationDetailsPage.tsx
rename to src/components/smart/DeploymentDetailsPage/DeploymentDetailsPage.tsx
index 837a1998..99ec73fe 100644
--- a/src/components/smart/MigrationDetailsPage/MigrationDetailsPage.tsx
+++ b/src/components/smart/DeploymentDetailsPage/DeploymentDetailsPage.tsx
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2017 Cloudbase Solutions SRL
+Copyright (C) 2024 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
@@ -16,12 +16,12 @@ import { observer } from "mobx-react";
import React from "react";
import styled from "styled-components";
-import { getTransferItemTitle } from "@src/@types/MainItem";
+import { getTransferItemTitle, DeploymentItemDetails } from "@src/@types/MainItem";
import DetailsContentHeader from "@src/components/modules/DetailsModule/DetailsContentHeader";
import DetailsPageHeader from "@src/components/modules/DetailsModule/DetailsPageHeader";
import DetailsTemplate from "@src/components/modules/TemplateModule/DetailsTemplate";
-import MigrationDetailsContent from "@src/components/modules/TransferModule/MigrationDetailsContent";
-import ReplicaMigrationOptions from "@src/components/modules/TransferModule/ReplicaMigrationOptions";
+import DeploymentDetailsContent from "@src/components/modules/TransferModule/DeploymentDetailsContent";
+import DeploymentOptions from "@src/components/modules/TransferModule/DeploymentOptions";
import TransferItemModal from "@src/components/modules/TransferModule/TransferItemModal";
import { ThemePalette } from "@src/components/Theme";
import AlertModal from "@src/components/ui/AlertModal";
@@ -29,7 +29,7 @@ import Modal from "@src/components/ui/Modal";
import { providerTypes } from "@src/constants";
import endpointStore from "@src/stores/EndpointStore";
import instanceStore from "@src/stores/InstanceStore";
-import migrationStore from "@src/stores/MigrationStore";
+import deploymentStore from "@src/stores/DeploymentStore";
import minionPoolStore from "@src/stores/MinionPoolStore";
import networkStore from "@src/stores/NetworkStore";
import notificationStore from "@src/stores/NotificationStore";
@@ -37,7 +37,8 @@ import providerStore from "@src/stores/ProviderStore";
import userStore from "@src/stores/UserStore";
import configLoader from "@src/utils/Config";
-import migrationImage from "./images/migration.svg";
+import replicaDeploymentImage from "./images/replica-deployment.svg";
+import liveMigrationDeploymentImage from "./images/live-migration-deployment.svg"
import type { Field } from "@src/@types/Field";
import type { InstanceScript } from "@src/@types/Instance";
@@ -48,26 +49,26 @@ type Props = {
history: any;
};
type State = {
- showDeleteMigrationConfirmation: boolean;
+ showDeleteDeploymentConfirmation: boolean;
showCancelConfirmation: boolean;
showForceCancelConfirmation: boolean;
showEditModal: boolean;
- showFromReplicaModal: boolean;
+ showFromTransferModal: boolean;
pausePolling: boolean;
initialLoading: boolean;
- migrating: boolean;
+ deploying: boolean;
};
@observer
-class MigrationDetailsPage extends React.Component {
+class DeploymentDetailsPage extends React.Component {
state: State = {
- showDeleteMigrationConfirmation: false,
+ showDeleteDeploymentConfirmation: false,
showCancelConfirmation: false,
showForceCancelConfirmation: false,
showEditModal: false,
- showFromReplicaModal: false,
+ showFromTransferModal: false,
pausePolling: false,
initialLoading: true,
- migrating: false,
+ deploying: false,
};
stopPolling: boolean | null = null;
@@ -75,9 +76,9 @@ class MigrationDetailsPage extends React.Component {
timeoutRef: any = null;
componentDidMount() {
- document.title = "Migration Details";
+ document.title = "Deployment Details";
- this.loadMigrationAndPollData();
+ this.loadDeploymentAndPollData();
}
UNSAFE_componentWillReceiveProps(newProps: any) {
@@ -85,31 +86,58 @@ class MigrationDetailsPage extends React.Component {
return;
}
this.timeoutRef && clearTimeout(this.timeoutRef);
- migrationStore.cancelMigrationDetails();
- migrationStore.clearDetails();
+ deploymentStore.cancelDeploymentDetails();
+ deploymentStore.clearDetails();
endpointStore.getEndpoints();
- this.loadMigrationAndPollData();
+ this.loadDeploymentAndPollData();
}
componentWillUnmount() {
- migrationStore.cancelMigrationDetails();
- migrationStore.clearDetails();
+ deploymentStore.cancelDeploymentDetails();
+ deploymentStore.clearDetails();
this.stopPolling = true;
}
getStatus() {
- return migrationStore.migrationDetails?.last_execution_status;
+ return deploymentStore.deploymentDetails?.last_execution_status;
}
- async loadMigrationAndPollData() {
- const loadMigration = async () => {
+ getDeploymentScenarioItemType(details: DeploymentItemDetails | null): string {
+ let item_type = "replica";
+ let scenario = details?.transfer_scenario;
+ if (scenario && scenario === "live_migration") {
+ item_type = "migration";
+ }
+ return item_type;
+ }
+
+ getTransferTypePillShouldRed(details: DeploymentItemDetails | null): boolean {
+ let should_red = true;
+ let scenario = details?.transfer_scenario;
+ if (scenario && scenario === "live_migration") {
+ should_red = false;
+ }
+ return should_red;
+ }
+
+ getDeploymentScenarioTypeImage(details: DeploymentItemDetails | null): string {
+ let image = replicaDeploymentImage;
+ let scenario = details?.transfer_scenario;
+ if (scenario && scenario === "live_migration") {
+ image = liveMigrationDeploymentImage;
+ }
+ return image;
+ }
+
+ async loadDeploymentAndPollData() {
+ const loadDeployment = async () => {
await endpointStore.getEndpoints({ showLoading: true });
this.setState({ initialLoading: false });
- await this.loadMigrationWithInstances({
- migrationId: this.props.match.params.id,
+ await this.loadDeploymentWithInstances({
+ deploymentId: this.props.match.params.id,
cache: true,
onDetailsLoaded: async () => {
- const details = migrationStore.migrationDetails;
+ const details = deploymentStore.deploymentDetails;
if (!details) {
return;
}
@@ -165,19 +193,19 @@ class MigrationDetailsPage extends React.Component {
},
});
};
- await loadMigration();
+ await loadDeployment();
this.pollData();
}
- async loadMigrationWithInstances(options: {
- migrationId: string;
+ async loadDeploymentWithInstances(options: {
+ deploymentId: string;
cache: boolean;
onDetailsLoaded?: () => void;
}) {
- await migrationStore.getMigration(options.migrationId, {
+ await deploymentStore.getDeployment(options.deploymentId, {
showLoading: true,
});
- const details = migrationStore.migrationDetails;
+ const details = deploymentStore.deploymentDetails;
if (!details) {
return;
}
@@ -235,23 +263,23 @@ class MigrationDetailsPage extends React.Component {
}
}
- handleDeleteMigrationClick() {
- this.setState({ showDeleteMigrationConfirmation: true });
+ handleDeleteDeploymentClick() {
+ this.setState({ showDeleteDeploymentConfirmation: true });
}
- handleDeleteMigrationConfirmation() {
- this.setState({ showDeleteMigrationConfirmation: false });
- this.props.history.push("/migrations");
- if (migrationStore.migrationDetails) {
- migrationStore.delete(migrationStore.migrationDetails.id);
+ handleDeleteDeploymentConfirmation() {
+ this.setState({ showDeleteDeploymentConfirmation: false });
+ this.props.history.push("/deployments");
+ if (deploymentStore.deploymentDetails) {
+ deploymentStore.delete(deploymentStore.deploymentDetails.id);
}
}
- handleCloseDeleteMigrationConfirmation() {
- this.setState({ showDeleteMigrationConfirmation: false });
+ handleCloseDeleteDeploymentConfirmation() {
+ this.setState({ showDeleteDeploymentConfirmation: false });
}
- handleCancelMigrationClick(force?: boolean) {
+ handleCancelDeploymentClick(force?: boolean) {
if (force) {
this.setState({ showForceCancelConfirmation: true });
} else {
@@ -260,15 +288,15 @@ class MigrationDetailsPage extends React.Component {
}
handleRecreateClick() {
- if (!migrationStore.migrationDetails?.replica_id) {
+ if (!deploymentStore.deploymentDetails?.transfer_id) {
this.setState({ showEditModal: true, pausePolling: true });
return;
}
- this.setState({ showFromReplicaModal: true, pausePolling: true });
+ this.setState({ showFromTransferModal: true, pausePolling: true });
}
- handleCloseFromReplicaModal() {
- this.setState({ showFromReplicaModal: false, pausePolling: false });
+ handleCloseFromTransferModal() {
+ this.setState({ showFromTransferModal: false, pausePolling: false });
}
handleCloseCancelConfirmation() {
@@ -283,10 +311,10 @@ class MigrationDetailsPage extends React.Component {
showCancelConfirmation: false,
showForceCancelConfirmation: false,
});
- if (!migrationStore.migrationDetails) {
+ if (!deploymentStore.deploymentDetails) {
return;
}
- await migrationStore.cancel(migrationStore.migrationDetails.id, force);
+ await deploymentStore.cancel(deploymentStore.deploymentDetails.id, force);
if (force) {
notificationStore.alert("Force Canceled", "success");
} else {
@@ -294,7 +322,7 @@ class MigrationDetailsPage extends React.Component {
}
}
- async recreateFromReplica(opts: {
+ async recreateFromTransfer(opts: {
fields: Field[];
uploadedUserScripts: InstanceScript[];
removedUserScripts: InstanceScript[];
@@ -306,57 +334,57 @@ class MigrationDetailsPage extends React.Component {
removedUserScripts,
minionPoolMappings,
} = opts;
- const replicaId = migrationStore.migrationDetails?.replica_id;
- if (!replicaId) {
+ const transferId = deploymentStore.deploymentDetails?.transfer_id;
+ if (!transferId) {
return;
}
- this.setState({ migrating: true });
+ this.setState({ deploying: true });
try {
- const migration = await this.migrate({
- replicaId,
+ const deployment = await this.deploy({
+ transferId: transferId,
fields,
uploadedUserScripts,
removedUserScripts,
minionPoolMappings,
});
- this.props.history.push(`/migrations/${migration.id}/tasks`);
+ this.props.history.push(`/deployments/${deployment.id}/tasks`);
} finally {
- this.setState({ migrating: false });
+ this.setState({ deploying: false });
}
- this.handleCloseFromReplicaModal();
+ this.handleCloseFromTransferModal();
}
- async migrate(opts: {
- replicaId: string;
+ async deploy(opts: {
+ transferId: string;
fields: Field[];
uploadedUserScripts: InstanceScript[];
removedUserScripts: InstanceScript[];
minionPoolMappings: { [instance: string]: string };
}) {
const {
- replicaId,
+ transferId: transferId,
fields,
uploadedUserScripts,
removedUserScripts,
minionPoolMappings,
} = opts;
- const migration = await migrationStore.migrateReplica({
- replicaId,
+ const deployment = await deploymentStore.deployTransfer({
+ transferId: transferId,
fields,
uploadedUserScripts,
removedUserScripts,
- userScriptData: migrationStore.migrationDetails?.user_scripts,
+ userScriptData: deploymentStore.deploymentDetails?.user_scripts,
minionPoolMappings,
});
- return migration;
+ return deployment;
}
async pollData() {
if (this.state.pausePolling || this.stopPolling) {
return;
}
- await migrationStore.getMigration(this.props.match.params.id, {
+ await deploymentStore.getDeployment(this.props.match.params.id, {
showLoading: false,
skipLog: true,
});
@@ -371,9 +399,9 @@ class MigrationDetailsPage extends React.Component {
});
}
- handleEditReplicaReload() {
- this.loadMigrationWithInstances({
- migrationId: this.props.match.params.id,
+ handleEditTransferReload() {
+ this.loadDeploymentWithInstances({
+ deploymentId: this.props.match.params.id,
cache: false,
});
}
@@ -385,18 +413,18 @@ class MigrationDetailsPage extends React.Component {
renderEditModal() {
const sourceEndpoint = endpointStore.endpoints.find(
e =>
- migrationStore.migrationDetails &&
- e.id === migrationStore.migrationDetails.origin_endpoint_id
+ deploymentStore.deploymentDetails &&
+ e.id === deploymentStore.deploymentDetails.origin_endpoint_id
);
const destinationEndpoint = endpointStore.endpoints.find(
e =>
- migrationStore.migrationDetails &&
- e.id === migrationStore.migrationDetails.destination_endpoint_id
+ deploymentStore.deploymentDetails &&
+ e.id === deploymentStore.deploymentDetails.destination_endpoint_id
);
if (
!this.state.showEditModal ||
- !migrationStore.migrationDetails ||
+ !deploymentStore.deploymentDetails ||
!destinationEndpoint ||
!sourceEndpoint
) {
@@ -405,7 +433,7 @@ class MigrationDetailsPage extends React.Component {
return (
{
this.closeEditModal();
@@ -414,14 +442,14 @@ class MigrationDetailsPage extends React.Component {
this.handleUpdateComplete(url);
}}
sourceEndpoint={sourceEndpoint}
- replica={migrationStore.migrationDetails}
+ transfer={deploymentStore.deploymentDetails}
destinationEndpoint={destinationEndpoint}
instancesDetails={instanceStore.instancesDetails}
instancesDetailsLoading={instanceStore.loadingInstancesDetails}
networks={networkStore.networks}
networksLoading={networkStore.loading}
onReloadClick={() => {
- this.handleEditReplicaReload();
+ this.handleEditTransferReload();
}}
/>
);
@@ -436,28 +464,28 @@ class MigrationDetailsPage extends React.Component {
this.getStatus() !== "AWAITING_MINION_ALLOCATIONS",
hidden: this.getStatus() === "CANCELLING",
action: () => {
- this.handleCancelMigrationClick();
+ this.handleCancelDeploymentClick();
},
},
{
label: "Force Cancel",
hidden: this.getStatus() !== "CANCELLING",
action: () => {
- this.handleCancelMigrationClick(true);
+ this.handleCancelDeploymentClick(true);
},
},
{
- label: "Recreate Migration",
+ label: "Recreate Deployment",
color: ThemePalette.primary,
action: () => {
this.handleRecreateClick();
},
},
{
- label: "Delete Migration",
+ label: "Delete Deployment",
color: ThemePalette.alert,
action: () => {
- this.handleDeleteMigrationClick();
+ this.handleDeleteDeploymentClick();
},
},
];
@@ -476,20 +504,33 @@ class MigrationDetailsPage extends React.Component {
contentHeaderComponent={
}
contentComponent={
- {
page={this.props.match.params.page || ""}
minionPools={minionPoolStore.minionPools}
detailsLoading={
- migrationStore.detailsLoading ||
+ deploymentStore.detailsLoading ||
endpointStore.loading ||
minionPoolStore.loadingMinionPools ||
this.state.initialLoading
}
- onDeleteMigrationClick={() => {
- this.handleDeleteMigrationClick();
+ onDeleteDeploymentClick={() => {
+ this.handleDeleteDeploymentClick();
}}
/>
}
/>
{
- this.handleDeleteMigrationConfirmation();
+ this.handleDeleteDeploymentConfirmation();
}}
onRequestClose={() => {
- this.handleCloseDeleteMigrationConfirmation();
+ this.handleCloseDeleteDeploymentConfirmation();
}}
/>
{
this.handleCancelConfirmation();
@@ -552,10 +593,10 @@ class MigrationDetailsPage extends React.Component {
/>
{
@@ -565,29 +606,29 @@ Note that this may lead to scheduled cleanup tasks being forcibly skipped, and t
this.handleCloseCancelConfirmation();
}}
/>
- {this.state.showFromReplicaModal ? (
+ {this.state.showFromTransferModal ? (
{
- this.handleCloseFromReplicaModal();
+ this.handleCloseFromTransferModal();
}}
>
- {
- this.handleCloseFromReplicaModal();
+ this.handleCloseFromTransferModal();
}}
- onMigrateClick={opts => {
- this.recreateFromReplica(opts);
+ onDeployClick={opts => {
+ this.recreateFromTransfer(opts);
}}
instances={instanceStore.instancesDetails}
loadingInstances={instanceStore.loadingInstancesDetails}
- defaultSkipOsMorphing={migrationStore.getDefaultSkipOsMorphing(
- migrationStore.migrationDetails
+ defaultSkipOsMorphing={deploymentStore.getDefaultSkipOsMorphing(
+ deploymentStore.deploymentDetails
)}
- migrating={this.state.migrating}
+ deploying={this.state.deploying}
/>
) : null}
@@ -597,4 +638,4 @@ Note that this may lead to scheduled cleanup tasks being forcibly skipped, and t
}
}
-export default MigrationDetailsPage;
+export default DeploymentDetailsPage;
diff --git a/src/components/smart/MigrationDetailsPage/images/migration.svg b/src/components/smart/DeploymentDetailsPage/images/live-migration-deployment.svg
similarity index 100%
rename from src/components/smart/MigrationDetailsPage/images/migration.svg
rename to src/components/smart/DeploymentDetailsPage/images/live-migration-deployment.svg
diff --git a/src/components/smart/ReplicaDetailsPage/images/replica.svg b/src/components/smart/DeploymentDetailsPage/images/replica-deployment.svg
similarity index 100%
rename from src/components/smart/ReplicaDetailsPage/images/replica.svg
rename to src/components/smart/DeploymentDetailsPage/images/replica-deployment.svg
diff --git a/src/components/smart/DeploymentDetailsPage/package.json b/src/components/smart/DeploymentDetailsPage/package.json
new file mode 100644
index 00000000..579c1a02
--- /dev/null
+++ b/src/components/smart/DeploymentDetailsPage/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "DeploymentDetailsPage",
+ "version": "0.0.0",
+ "private": true,
+ "main": "./DeploymentDetailsPage.tsx"
+}
diff --git a/src/components/smart/MigrationsPage/MigrationsPage.tsx b/src/components/smart/DeploymentsPage/DeploymentsPage.tsx
similarity index 59%
rename from src/components/smart/MigrationsPage/MigrationsPage.tsx
rename to src/components/smart/DeploymentsPage/DeploymentsPage.tsx
index 858972c7..6d37f395 100644
--- a/src/components/smart/MigrationsPage/MigrationsPage.tsx
+++ b/src/components/smart/DeploymentsPage/DeploymentsPage.tsx
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2017 Cloudbase Solutions SRL
+Copyright (C) 2024 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
@@ -23,35 +23,36 @@ import PageHeader from "@src/components/smart/PageHeader";
import AlertModal from "@src/components/ui/AlertModal";
import projectStore from "@src/stores/ProjectStore";
-import migrationStore from "@src/stores/MigrationStore";
+import deploymentStore from "@src/stores/DeploymentStore";
import endpointStore from "@src/stores/EndpointStore";
import notificationStore from "@src/stores/NotificationStore";
import configLoader from "@src/utils/Config";
import { ThemePalette } from "@src/components/Theme";
-import replicaMigrationFields from "@src/components/modules/TransferModule/ReplicaMigrationOptions/replicaMigrationFields";
-import { MigrationItem } from "@src/@types/MainItem";
+import deploymentFields from "@src/components/modules/TransferModule/DeploymentOptions/DeploymentFields";
+import { DeploymentItem } from "@src/@types/MainItem";
import userStore from "@src/stores/UserStore";
import TransferListItem from "@src/components/modules/TransferModule/TransferListItem";
-import migrationLargeImage from "./images/migration-large.svg";
-import migrationItemImage from "./images/migration.svg";
+import deploymentLargeImage from "./images/deployment-large.svg";
+import replicaDeploymentItemImage from "./images/replica-deployment.svg";
+import liveMigrationDeploymentItemImage from "./images/live-migration-deployment.svg"
const Wrapper = styled.div``;
type State = {
- selectedMigrations: MigrationItem[];
+ selectedDeployments: DeploymentItem[];
modalIsOpen: boolean;
- showDeleteMigrationModal: boolean;
- showCancelMigrationModal: boolean;
- showRecreateMigrationsModal: boolean;
+ showDeleteDeploymentModal: boolean;
+ showCancelDeploymentModal: boolean;
+ showRecreateDeploymentsModal: boolean;
};
@observer
-class MigrationsPage extends React.Component<{ history: any }, State> {
+class DeploymentsPage extends React.Component<{ history: any }, State> {
state: State = {
- showDeleteMigrationModal: false,
- showCancelMigrationModal: false,
- showRecreateMigrationsModal: false,
- selectedMigrations: [],
+ showDeleteDeploymentModal: false,
+ showCancelDeploymentModal: false,
+ showRecreateDeploymentsModal: false,
+ selectedDeployments: [],
modalIsOpen: false,
};
@@ -60,7 +61,7 @@ class MigrationsPage extends React.Component<{ history: any }, State> {
stopPolling = false;
componentDidMount() {
- document.title = "Coriolis Migrations";
+ document.title = "Coriolis Deployments";
projectStore.getProjects();
endpointStore.getEndpoints({ showLoading: true });
@@ -92,76 +93,89 @@ class MigrationsPage extends React.Component<{ history: any }, State> {
];
}
- getStatus(migrationId: string): string {
- const migration = migrationStore.migrations.find(m => m.id === migrationId);
- return migration ? migration.last_execution_status : "";
+ getStatus(deploymentId: string): string {
+ const deployment = deploymentStore.deployments.find(m => m.id === deploymentId);
+ return deployment ? deployment.last_execution_status : "";
}
+ getDeploymentType(deploymentId: string): string {
+ const deployment = deploymentStore.deployments.find(m => m.id === deploymentId);
+ return deployment ? deployment.transfer_scenario : "";
+ }
+
+ getDeploymentItemImage(item: DeploymentItem): string {
+ let image = replicaDeploymentItemImage;
+ if (item.transfer_scenario === "live_migration") {
+ image = liveMigrationDeploymentItemImage;
+ }
+ return image;
+ }
+
handleProjectChange() {
endpointStore.getEndpoints({ showLoading: true });
- migrationStore.getMigrations({ showLoading: true });
+ deploymentStore.getDeployments({ showLoading: true });
}
handleReloadButtonClick() {
projectStore.getProjects();
endpointStore.getEndpoints({ showLoading: true });
- migrationStore.getMigrations({ showLoading: true });
+ deploymentStore.getDeployments({ showLoading: true });
userStore.getAllUsers({ showLoading: true, quietError: true });
}
- handleItemClick(item: MigrationItem) {
+ handleItemClick(item: DeploymentItem) {
if (item.last_execution_status === "RUNNING") {
- this.props.history.push(`/migrations/${item.id}/tasks`);
+ this.props.history.push(`/deployments/${item.id}/tasks`);
} else {
- this.props.history.push(`/migrations/${item.id}`);
+ this.props.history.push(`/deployments/${item.id}`);
}
}
- deleteSelectedMigrations() {
- this.state.selectedMigrations.forEach(migration => {
- migrationStore.delete(migration.id);
+ deleteSelectedDeployments() {
+ this.state.selectedDeployments.forEach(deployment => {
+ deploymentStore.delete(deployment.id);
});
- this.setState({ showDeleteMigrationModal: false });
+ this.setState({ showDeleteDeploymentModal: false });
}
- cancelSelectedMigrations() {
- this.state.selectedMigrations.forEach(migration => {
- const status = this.getStatus(migration.id);
+ cancelSelectedDeployments() {
+ this.state.selectedDeployments.forEach(deployment => {
+ const status = this.getStatus(deployment.id);
if (status === "RUNNING" || status === "AWAITING_MINION_ALLOCATIONS") {
- migrationStore.cancel(migration.id);
+ deploymentStore.cancel(deployment.id);
}
});
- notificationStore.alert("Canceling migrations");
- this.setState({ showCancelMigrationModal: false });
+ notificationStore.alert("Canceling deployments");
+ this.setState({ showCancelDeploymentModal: false });
}
- async recreateMigrations() {
- notificationStore.alert("Recreating migrations");
- this.setState({ showRecreateMigrationsModal: false });
+ async recreateDeployments() {
+ notificationStore.alert("Recreating deployments");
+ this.setState({ showRecreateDeploymentsModal: false });
await Promise.all(
- this.state.selectedMigrations.map(async migration => {
- if (migration.replica_id) {
- await migrationStore.migrateReplica({
- replicaId: migration.replica_id,
- fields: replicaMigrationFields,
+ this.state.selectedDeployments.map(async deployment => {
+ if (deployment.transfer_id) {
+ await deploymentStore.deployTransfer({
+ transferId: deployment.transfer_id,
+ fields: deploymentFields,
uploadedUserScripts: [],
removedUserScripts: [],
- userScriptData: migration.user_scripts,
+ userScriptData: deployment.user_scripts,
minionPoolMappings:
- migration.instance_osmorphing_minion_pool_mappings || {},
+ deployment.instance_osmorphing_minion_pool_mappings || {},
});
} else {
- await migrationStore.recreateFullCopy(migration as any);
+ await deploymentStore.recreateFullCopy(deployment as any);
}
})
);
- migrationStore.getMigrations();
+ deploymentStore.getDeployments();
}
handleEmptyListButtonClick() {
- this.props.history.push("/wizard/migration");
+ this.props.history.push("/wizard/deployment");
}
handleModalOpen() {
@@ -174,7 +188,7 @@ class MigrationsPage extends React.Component<{ history: any }, State> {
});
}
- searchText(item: MigrationItem, text: string) {
+ searchText(item: DeploymentItem, text: string) {
let result = false;
if (item.instances[0].toLowerCase().indexOf(text) > -1) {
return true;
@@ -196,7 +210,7 @@ class MigrationsPage extends React.Component<{ history: any }, State> {
}
itemFilterFunction(
- item: MigrationItem,
+ item: DeploymentItem,
filterStatus?: string | null,
filterText?: string
) {
@@ -219,7 +233,7 @@ class MigrationsPage extends React.Component<{ history: any }, State> {
}
await Promise.all([
- migrationStore.getMigrations({ skipLog: true }),
+ deploymentStore.getDeployments({ skipLog: true }),
endpointStore.getEndpoints({ skipLog: true }),
userStore.getAllUsers({ skipLog: true, quietError: true }),
]);
@@ -230,8 +244,8 @@ class MigrationsPage extends React.Component<{ history: any }, State> {
render() {
let atLeaseOneIsRunning = false;
- this.state.selectedMigrations.forEach(migration => {
- const status = this.getStatus(migration.id);
+ this.state.selectedDeployments.forEach(deployment => {
+ const status = this.getStatus(deployment.id);
atLeaseOneIsRunning =
atLeaseOneIsRunning ||
status === "RUNNING" ||
@@ -242,22 +256,22 @@ class MigrationsPage extends React.Component<{ history: any }, State> {
label: "Cancel",
disabled: !atLeaseOneIsRunning,
action: () => {
- this.setState({ showCancelMigrationModal: true });
+ this.setState({ showCancelDeploymentModal: true });
},
},
{
- label: "Recreate Migrations",
+ label: "Recreate Deployments",
disabled: atLeaseOneIsRunning,
color: ThemePalette.primary,
action: () => {
- this.setState({ showRecreateMigrationsModal: true });
+ this.setState({ showRecreateDeploymentsModal: true });
},
},
{
- label: "Delete Migrations",
+ label: "Delete Deployments",
color: ThemePalette.alert,
action: () => {
- this.setState({ showDeleteMigrationModal: true });
+ this.setState({ showDeleteDeploymentModal: true });
},
},
];
@@ -265,13 +279,13 @@ class MigrationsPage extends React.Component<{ history: any }, State> {
return (
}
+ navigationComponent={ }
listComponent={
{
this.handleItemClick(item);
}}
@@ -279,14 +293,16 @@ class MigrationsPage extends React.Component<{ history: any }, State> {
this.handleReloadButtonClick();
}}
itemFilterFunction={(...args) => this.itemFilterFunction(...args)}
- onSelectedItemsChange={selectedMigrations => {
- this.setState({ selectedMigrations });
+ onSelectedItemsChange={selectedDeployments => {
+ this.setState({ selectedDeployments });
}}
dropdownActions={BulkActions}
renderItemComponent={options => (
{
+ return this.getDeploymentItemImage(item);
+ }}
endpointType={id => {
const endpoint = this.getEndpoint(id);
if (endpoint) {
@@ -303,18 +319,14 @@ class MigrationsPage extends React.Component<{ history: any }, State> {
userNameLoading={userStore.allUsersLoading}
/>
)}
- emptyListImage={migrationLargeImage}
- emptyListMessage="It seems like you don't have any Migrations in this project."
- emptyListExtraMessage="A Coriolis Migration is a full virtual machine migration between two cloud endpoints."
- emptyListButtonLabel="Create a Migration"
- onEmptyListButtonClick={() => {
- this.handleEmptyListButtonClick();
- }}
+ emptyListImage={deploymentLargeImage}
+ emptyListMessage="It seems like you don't have any Deployments in this project."
+ emptyListExtraMessage="A Coriolis Deployment is a deployment of a Transfer between two cloud endpoints."
/>
}
headerComponent={
{
this.handleProjectChange();
}}
@@ -327,45 +339,45 @@ class MigrationsPage extends React.Component<{ history: any }, State> {
/>
}
/>
- {this.state.showDeleteMigrationModal ? (
+ {this.state.showDeleteDeploymentModal ? (
{
- this.deleteSelectedMigrations();
+ this.deleteSelectedDeployments();
}}
onRequestClose={() => {
- this.setState({ showDeleteMigrationModal: false });
+ this.setState({ showDeleteDeploymentModal: false });
}}
/>
) : null}
- {this.state.showCancelMigrationModal ? (
+ {this.state.showCancelDeploymentModal ? (
{
- this.cancelSelectedMigrations();
+ this.cancelSelectedDeployments();
}}
onRequestClose={() => {
- this.setState({ showCancelMigrationModal: false });
+ this.setState({ showCancelDeploymentModal: false });
}}
/>
) : null}
- {this.state.showRecreateMigrationsModal ? (
+ {this.state.showRecreateDeploymentsModal ? (
{
- this.recreateMigrations();
+ this.recreateDeployments();
}}
onRequestClose={() => {
- this.setState({ showRecreateMigrationsModal: false });
+ this.setState({ showRecreateDeploymentsModal: false });
}}
/>
) : null}
@@ -374,4 +386,4 @@ class MigrationsPage extends React.Component<{ history: any }, State> {
}
}
-export default MigrationsPage;
+export default DeploymentsPage;
diff --git a/src/components/smart/MigrationsPage/images/migration-large.svg b/src/components/smart/DeploymentsPage/images/deployment-large.svg
similarity index 94%
rename from src/components/smart/MigrationsPage/images/migration-large.svg
rename to src/components/smart/DeploymentsPage/images/deployment-large.svg
index 7b4f42d2..f7086b60 100644
--- a/src/components/smart/MigrationsPage/images/migration-large.svg
+++ b/src/components/smart/DeploymentsPage/images/deployment-large.svg
@@ -5,9 +5,9 @@
Created with Sketch.
-
+
-
+
diff --git a/src/components/smart/DeploymentsPage/images/live-migration-deployment.svg b/src/components/smart/DeploymentsPage/images/live-migration-deployment.svg
new file mode 100644
index 00000000..beb1ab3c
--- /dev/null
+++ b/src/components/smart/DeploymentsPage/images/live-migration-deployment.svg
@@ -0,0 +1,14 @@
+
+
+
+
+ Created with Sketch.
+
+
+
+
+
+
+
+
+
diff --git a/src/components/smart/ReplicasPage/images/replica.svg b/src/components/smart/DeploymentsPage/images/replica-deployment.svg
similarity index 100%
rename from src/components/smart/ReplicasPage/images/replica.svg
rename to src/components/smart/DeploymentsPage/images/replica-deployment.svg
diff --git a/src/components/smart/DeploymentsPage/package.json b/src/components/smart/DeploymentsPage/package.json
new file mode 100644
index 00000000..00dafe28
--- /dev/null
+++ b/src/components/smart/DeploymentsPage/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "DeploymentsPage",
+ "version": "0.0.0",
+ "private": true,
+ "main": "./DeploymentsPage.tsx"
+}
diff --git a/src/components/smart/EndpointDetailsPage/EndpointDetailsPage.tsx b/src/components/smart/EndpointDetailsPage/EndpointDetailsPage.tsx
index ed076a86..1f68c790 100644
--- a/src/components/smart/EndpointDetailsPage/EndpointDetailsPage.tsx
+++ b/src/components/smart/EndpointDetailsPage/EndpointDetailsPage.tsx
@@ -27,8 +27,8 @@ import EndpointModal from "@src/components/modules/EndpointModule/EndpointModal"
import EndpointDuplicateOptions from "@src/components/modules/EndpointModule/EndpointDuplicateOptions";
import endpointStore from "@src/stores/EndpointStore";
-import migrationStore from "@src/stores/MigrationStore";
-import replicaStore from "@src/stores/ReplicaStore";
+import deploymentStore from "@src/stores/DeploymentStore";
+import transferStore from "@src/stores/TransferStore";
import userStore from "@src/stores/UserStore";
import projectStore from "@src/stores/ProjectStore";
@@ -37,7 +37,7 @@ import type { Endpoint as EndpointType } from "@src/@types/Endpoint";
import { ThemePalette } from "@src/components/Theme";
import regionStore from "@src/stores/RegionStore";
-import { MigrationItem, ReplicaItem } from "@src/@types/MainItem";
+import { DeploymentItem, TransferItem } from "@src/@types/MainItem";
import providerStore from "@src/stores/ProviderStore";
import endpointImage from "./images/endpoint.svg";
@@ -53,7 +53,7 @@ type State = {
showEndpointModal: boolean;
showEndpointInUseModal: boolean;
showEndpointInUseLoadingModal: boolean;
- endpointUsage: { replicas: ReplicaItem[]; migrations: MigrationItem[] };
+ endpointUsage: { transfers: TransferItem[]; deployments: DeploymentItem[] };
showDuplicateModal: boolean;
duplicating: boolean;
};
@@ -67,7 +67,7 @@ class EndpointDetailsPage extends React.Component {
showEndpointInUseLoadingModal: false,
showDuplicateModal: false,
duplicating: false,
- endpointUsage: { replicas: [], migrations: [] },
+ endpointUsage: { transfers: [], deployments: [] },
};
componentDidMount() {
@@ -87,20 +87,20 @@ class EndpointDetailsPage extends React.Component {
);
}
- getEndpointUsage(): { migrations: MigrationItem[]; replicas: ReplicaItem[] } {
+ getEndpointUsage(): { deployments: DeploymentItem[]; transfers: TransferItem[] } {
const endpointId = this.props.match.params.id;
- const replicas = replicaStore.replicas.filter(
+ const transfers = transferStore.transfers.filter(
r =>
r.origin_endpoint_id === endpointId ||
r.destination_endpoint_id === endpointId
);
- const migrations = migrationStore.migrations.filter(
+ const deployments = deploymentStore.deployments.filter(
r =>
r.origin_endpoint_id === endpointId ||
r.destination_endpoint_id === endpointId
);
- return { migrations, replicas };
+ return { deployments, transfers: transfers };
}
handleUserItemClick(item: { value: string }) {
@@ -116,14 +116,14 @@ class EndpointDetailsPage extends React.Component {
this.setState({ showEndpointInUseLoadingModal: true });
await Promise.all([
- replicaStore.getReplicas(),
- migrationStore.getMigrations(),
+ transferStore.getTransfers(),
+ deploymentStore.getDeployments(),
]);
const endpointUsage = this.getEndpointUsage();
if (
- endpointUsage.migrations.length === 0 &&
- endpointUsage.replicas.length === 0
+ endpointUsage.deployments.length === 0 &&
+ endpointUsage.transfers.length === 0
) {
this.setState({
showDeleteEndpointConfirmation: true,
@@ -219,8 +219,8 @@ class EndpointDetailsPage extends React.Component {
this.loadEndpoints();
await Promise.all([
- replicaStore.getReplicas(),
- migrationStore.getMigrations(),
+ transferStore.getTransfers(),
+ deploymentStore.getDeployments(),
regionStore.getRegions(),
]);
this.setState({ endpointUsage: this.getEndpointUsage() });
@@ -306,7 +306,7 @@ class EndpointDetailsPage extends React.Component {
{
type="error"
isOpen={this.state.showEndpointInUseModal}
title="Endpoint is in use"
- message="The endpoint can't be deleted because it is in use by replicas or migrations."
- extraMessage="You must first delete the replica or migration which uses this endpoint."
+ message="The endpoint can't be deleted because it is in use by transfers or deployments."
+ extraMessage="You must first delete the transfer or deployment which uses this endpoint."
onRequestClose={() => {
this.handleCloseEndpointInUseModal();
}}
diff --git a/src/components/smart/EndpointsPage/EndpointsPage.tsx b/src/components/smart/EndpointsPage/EndpointsPage.tsx
index 26776b65..aaf4e2e0 100644
--- a/src/components/smart/EndpointsPage/EndpointsPage.tsx
+++ b/src/components/smart/EndpointsPage/EndpointsPage.tsx
@@ -30,8 +30,8 @@ import type { Endpoint as EndpointType } from "@src/@types/Endpoint";
import projectStore from "@src/stores/ProjectStore";
import userStore from "@src/stores/UserStore";
import endpointStore from "@src/stores/EndpointStore";
-import migrationStore from "@src/stores/MigrationStore";
-import replicaStore from "@src/stores/ReplicaStore";
+import deploymentStore from "@src/stores/DeploymentStore";
+import transferStore from "@src/stores/TransferStore";
import providerStore from "@src/stores/ProviderStore";
import EndpointDuplicateOptions from "@src/components/modules/EndpointModule/EndpointDuplicateOptions";
@@ -106,15 +106,17 @@ class EndpointsPage extends React.Component<{ history: any }, State> {
}
getEndpointUsage(endpointId: string) {
- const replicasCount = replicaStore.replicas.filter(
+ const replicasCount = transferStore.transfers.filter(
r =>
- r.origin_endpoint_id === endpointId ||
- r.destination_endpoint_id === endpointId
+ (r.origin_endpoint_id === endpointId ||
+ r.destination_endpoint_id === endpointId) &&
+ r.scenario === "replica"
).length;
- const migrationsCount = migrationStore.migrations.filter(
+ const migrationsCount = transferStore.transfers.filter(
r =>
- r.origin_endpoint_id === endpointId ||
- r.destination_endpoint_id === endpointId
+ (r.origin_endpoint_id === endpointId ||
+ r.destination_endpoint_id === endpointId) &&
+ r.scenario === "live_migration"
).length;
return { migrationsCount, replicasCount };
@@ -122,15 +124,15 @@ class EndpointsPage extends React.Component<{ history: any }, State> {
handleProjectChange() {
endpointStore.getEndpoints({ showLoading: true });
- migrationStore.getMigrations();
- replicaStore.getReplicas();
+ deploymentStore.getDeployments();
+ transferStore.getTransfers();
}
handleReloadButtonClick() {
projectStore.getProjects();
endpointStore.getEndpoints({ showLoading: true });
- migrationStore.getMigrations();
- replicaStore.getReplicas();
+ deploymentStore.getDeployments();
+ transferStore.getTransfers();
}
handleItemClick(item: EndpointType) {
@@ -254,8 +256,8 @@ class EndpointsPage extends React.Component<{ history: any }, State> {
await Promise.all([
endpointStore.getEndpoints({ showLoading, skipLog: true }),
- migrationStore.getMigrations({ skipLog: true }),
- replicaStore.getReplicas({ skipLog: true }),
+ deploymentStore.getDeployments({ skipLog: true }),
+ transferStore.getTransfers({ skipLog: true }),
]);
this.pollTimeout = window.setTimeout(() => {
this.pollData();
diff --git a/src/components/smart/MetalHubServerDetailsPage/MetalHubServerDetailsPage.tsx b/src/components/smart/MetalHubServerDetailsPage/MetalHubServerDetailsPage.tsx
index f674ae5c..35fa0306 100644
--- a/src/components/smart/MetalHubServerDetailsPage/MetalHubServerDetailsPage.tsx
+++ b/src/components/smart/MetalHubServerDetailsPage/MetalHubServerDetailsPage.tsx
@@ -240,7 +240,7 @@ class MetalHubServerDetailsPage extends React.Component {
isOpen
title="Remove Bare Metal Server?"
message="Are you sure you want to remove this server?"
- extraMessage="By removing a server from the hub, Coriolis will not be able to migrate it or do any other replica executions of it."
+ extraMessage="By removing a server from the hub, Coriolis will not be able to migrate it or ensure disaster recovery of it."
onConfirmation={() => {
this.handleDeleteConfirmation();
}}
diff --git a/src/components/smart/MigrationDetailsPage/package.json b/src/components/smart/MigrationDetailsPage/package.json
deleted file mode 100644
index 32abaa74..00000000
--- a/src/components/smart/MigrationDetailsPage/package.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "name": "MigrationDetailsPage",
- "version": "0.0.0",
- "private": true,
- "main": "./MigrationDetailsPage.tsx"
-}
diff --git a/src/components/smart/MigrationsPage/package.json b/src/components/smart/MigrationsPage/package.json
deleted file mode 100644
index 1caf9e4a..00000000
--- a/src/components/smart/MigrationsPage/package.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "name": "MigrationsPage",
- "version": "0.0.0",
- "private": true,
- "main": "./MigrationsPage.tsx"
-}
diff --git a/src/components/smart/MinionPoolDetailsPage/MinionPoolDetailsPage.tsx b/src/components/smart/MinionPoolDetailsPage/MinionPoolDetailsPage.tsx
index 62ccf0cb..1f92edd2 100644
--- a/src/components/smart/MinionPoolDetailsPage/MinionPoolDetailsPage.tsx
+++ b/src/components/smart/MinionPoolDetailsPage/MinionPoolDetailsPage.tsx
@@ -34,11 +34,12 @@ import { ThemePalette } from "@src/components/Theme";
import minionPoolStore from "@src/stores/MinionPoolStore";
import MinionPoolModal from "@src/components/modules/MinionModule/MinionPoolModal";
import MinionPoolDetailsContent from "@src/components/modules/MinionModule/MinionPoolDetailsContent";
-import replicaStore from "@src/stores/ReplicaStore";
-import migrationStore from "@src/stores/MigrationStore";
+import transferStore from "@src/stores/TransferStore";
+import deploymentStore from "@src/stores/DeploymentStore";
import MinionPoolConfirmationModal from "@src/components/modules/MinionModule/MinionPoolConfirmationModal";
import providerStore from "@src/stores/ProviderStore";
import { Field } from "@src/@types/Field";
+import { ActionItem } from "@src/@types/MainItem";
import minionPoolImage from "./images/minion-pool.svg";
const Wrapper = styled.div``;
@@ -134,8 +135,8 @@ class MinionPoolDetailsPage extends React.Component {
minionPoolStore.loadMinionPoolDetails(this.minionPoolId, {
showLoading: true,
}),
- replicaStore.getReplicas(),
- migrationStore.getMigrations(),
+ transferStore.getTransfers(),
+ deploymentStore.getDeployments(),
]);
const minionPool = this.minionPool;
if (!minionPool) {
@@ -203,8 +204,8 @@ class MinionPoolDetailsPage extends React.Component {
showLoading,
skipLog: true,
}),
- replicaStore.getReplicas(),
- migrationStore.getMigrations(),
+ transferStore.getTransfers(),
+ deploymentStore.getDeployments(),
]);
setTimeout(() => {
@@ -353,6 +354,14 @@ class MinionPoolDetailsPage extends React.Component {
},
];
+ const checkPoolUsed = (i: ActionItem): Boolean|undefined => {
+ return i.origin_minion_pool_id === this.minionPool?.id
+ || i.destination_minion_pool_id === this.minionPool?.id
+ || (i.instance_osmorphing_minion_pool_mappings
+ && Object.values(i.instance_osmorphing_minion_pool_mappings).includes(
+ this.minionPool?.id));
+ }
+
return (
{
- r.origin_minion_pool_id === this.minionPool?.id ||
- r.destination_minion_pool_id === this.minionPool?.id
- )}
- migrations={migrationStore.migrations.filter(
- r =>
- r.origin_minion_pool_id === this.minionPool?.id ||
- r.destination_minion_pool_id === this.minionPool?.id
- )}
+ transfers={transferStore.transfers.filter(checkPoolUsed)}
+ deployments={deploymentStore.deployments.filter(checkPoolUsed)}
endpoints={endpointStore.endpoints}
schema={minionPoolStore.minionPoolCombinedSchema}
schemaLoading={
diff --git a/src/components/smart/ReplicaDetailsPage/package.json b/src/components/smart/ReplicaDetailsPage/package.json
deleted file mode 100644
index b885d1fd..00000000
--- a/src/components/smart/ReplicaDetailsPage/package.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "name": "ReplicaDetailsPage",
- "version": "0.0.0",
- "private": true,
- "main": "./ReplicaDetailsPage.tsx"
-}
diff --git a/src/components/smart/ReplicasPage/package.json b/src/components/smart/ReplicasPage/package.json
deleted file mode 100644
index 8f861982..00000000
--- a/src/components/smart/ReplicasPage/package.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "name": "ReplicasPage",
- "version": "0.0.0",
- "private": true,
- "main": "./ReplicasPage.tsx"
-}
diff --git a/src/components/smart/ReplicaDetailsPage/ReplicaDetailsPage.tsx b/src/components/smart/TransferDetailsPage/TransferDetailsPage.tsx
similarity index 66%
rename from src/components/smart/ReplicaDetailsPage/ReplicaDetailsPage.tsx
rename to src/components/smart/TransferDetailsPage/TransferDetailsPage.tsx
index 9e22eb6a..22fd6083 100644
--- a/src/components/smart/ReplicaDetailsPage/ReplicaDetailsPage.tsx
+++ b/src/components/smart/TransferDetailsPage/TransferDetailsPage.tsx
@@ -16,14 +16,14 @@ import { observer } from "mobx-react";
import React from "react";
import styled from "styled-components";
-import { getTransferItemTitle, ReplicaItemDetails } from "@src/@types/MainItem";
+import { getTransferItemTitle, TransferItemDetails } from "@src/@types/MainItem";
import DetailsContentHeader from "@src/components/modules/DetailsModule/DetailsContentHeader";
import DetailsPageHeader from "@src/components/modules/DetailsModule/DetailsPageHeader";
import DetailsTemplate from "@src/components/modules/TemplateModule/DetailsTemplate";
-import DeleteReplicaModal from "@src/components/modules/TransferModule/DeleteReplicaModal";
-import ReplicaDetailsContent from "@src/components/modules/TransferModule/ReplicaDetailsContent";
-import ReplicaExecutionOptions from "@src/components/modules/TransferModule/ReplicaExecutionOptions";
-import ReplicaMigrationOptions from "@src/components/modules/TransferModule/ReplicaMigrationOptions";
+import DeleteTransferModal from "@src/components/modules/TransferModule/DeleteTransferModal/DeleteTransferModal";
+import TransferDetailsContent from "@src/components/modules/TransferModule/TransferDetailsContent";
+import TransferExecutionOptions from "@src/components/modules/TransferModule/TransferExecutionOptions";
+import DeploymentOptions from "@src/components/modules/TransferModule/DeploymentOptions";
import TransferItemModal from "@src/components/modules/TransferModule/TransferItemModal";
import { ThemePalette } from "@src/components/Theme";
import AlertModal from "@src/components/ui/AlertModal";
@@ -31,17 +31,18 @@ import Modal from "@src/components/ui/Modal";
import { providerTypes } from "@src/constants";
import endpointStore from "@src/stores/EndpointStore";
import instanceStore from "@src/stores/InstanceStore";
-import migrationStore from "@src/stores/MigrationStore";
+import deploymentStore from "@src/stores/DeploymentStore";
import minionPoolStore from "@src/stores/MinionPoolStore";
import networkStore from "@src/stores/NetworkStore";
import providerStore from "@src/stores/ProviderStore";
-import replicaStore from "@src/stores/ReplicaStore";
+import transferStore from "@src/stores/TransferStore";
import scheduleStore from "@src/stores/ScheduleStore";
import userStore from "@src/stores/UserStore";
import configLoader from "@src/utils/Config";
import ObjectUtils from "@src/utils/ObjectUtils";
import replicaImage from "./images/replica.svg";
+import liveMigrationImage from "./images/live_migration.svg";
import type { InstanceScript } from "@src/@types/Instance";
import type { Execution } from "@src/@types/Execution";
@@ -57,29 +58,30 @@ type Props = {
};
type State = {
showOptionsModal: boolean;
- showMigrationModal: boolean;
+ showDeploymentModal: boolean;
showEditModal: boolean;
showDeleteExecutionConfirmation: boolean;
showForceCancelConfirmation: boolean;
- showDeleteReplicaConfirmation: boolean;
- showDeleteReplicaDisksConfirmation: boolean;
- confirmationItem?: ReplicaItemDetails | null | Execution | null;
+ showDeleteTransferConfirmation: boolean;
+ showDeleteTransferDisksConfirmation: boolean;
+ confirmationItem?: TransferItemDetails | null | Execution | null;
showCancelConfirmation: boolean;
isEditable: boolean;
isEditableLoading: boolean;
pausePolling: boolean;
initialLoading: boolean;
- migrating: boolean;
+ deploying: boolean;
+ executing: boolean;
};
@observer
-class ReplicaDetailsPage extends React.Component {
+class TransferDetailsPage extends React.Component {
state: State = {
showOptionsModal: false,
- showMigrationModal: false,
+ showDeploymentModal: false,
showEditModal: false,
showDeleteExecutionConfirmation: false,
- showDeleteReplicaConfirmation: false,
- showDeleteReplicaDisksConfirmation: false,
+ showDeleteTransferConfirmation: false,
+ showDeleteTransferDisksConfirmation: false,
confirmationItem: null,
showCancelConfirmation: false,
showForceCancelConfirmation: false,
@@ -87,29 +89,30 @@ class ReplicaDetailsPage extends React.Component {
isEditableLoading: true,
pausePolling: false,
initialLoading: true,
- migrating: false,
+ deploying: false,
+ executing: false,
};
stopPolling: boolean | null = null;
componentDidMount() {
- document.title = "Replica Details";
+ document.title = "Transfer Details";
- const loadReplica = async () => {
+ const loadTransfer = async () => {
await endpointStore.getEndpoints({ showLoading: true });
this.setState({ initialLoading: false });
- this.loadReplicaWithInstances({
+ this.loadTransferWithInstances({
cache: true,
showLoading: true,
onDetailsLoaded: async () => {
- if (!this.replica) {
+ if (!this.transfer) {
return;
}
const sourceEndpoint = endpointStore.endpoints.find(
- e => e.id === this.replica!.origin_endpoint_id
+ e => e.id === this.transfer!.origin_endpoint_id
);
const destinationEndpoint = endpointStore.endpoints.find(
- e => e.id === this.replica!.destination_endpoint_id
+ e => e.id === this.transfer!.destination_endpoint_id
);
if (!sourceEndpoint || !destinationEndpoint) {
return;
@@ -130,8 +133,8 @@ class ReplicaDetailsPage extends React.Component {
optionsType,
endpointId:
optionsType === "source"
- ? this.replica!.origin_endpoint_id
- : this.replica!.destination_endpoint_id,
+ ? this.transfer!.origin_endpoint_id
+ : this.transfer!.destination_endpoint_id,
providerName,
useCache: true,
quietError: true,
@@ -145,8 +148,8 @@ class ReplicaDetailsPage extends React.Component {
...getOptionsValuesConfig,
envData:
optionsType === "source"
- ? this.replica!.source_environment
- : this.replica!.destination_environment,
+ ? this.transfer!.source_environment
+ : this.transfer!.destination_environment,
});
};
@@ -158,45 +161,45 @@ class ReplicaDetailsPage extends React.Component {
});
};
- const loadReplicaAndPollData = async () => {
- await loadReplica();
+ const loadTransferAndPollData = async () => {
+ await loadTransfer();
this.pollData();
};
- loadReplicaAndPollData();
- scheduleStore.getSchedules(this.replicaId);
+ loadTransferAndPollData();
+ scheduleStore.getSchedules(this.transferId);
}
UNSAFE_componentWillReceiveProps(newProps: Props) {
if (newProps.match.params.id !== this.props.match.params.id) {
- this.loadReplicaWithInstances({
+ this.loadTransferWithInstances({
cache: true,
- replicaId: newProps.match.params.id,
+ transferId: newProps.match.params.id,
});
scheduleStore.getSchedules(newProps.match.params.id);
}
}
componentWillUnmount() {
- replicaStore.cancelReplicaDetails();
- replicaStore.clearDetails();
+ transferStore.cancelTransferDetails();
+ transferStore.clearDetails();
scheduleStore.clearUnsavedSchedules();
this.stopPolling = true;
}
- get replicaId() {
+ get transferId() {
if (!this.props.match?.params?.id) {
- throw new Error("Invalid replica id");
+ throw new Error("Invalid transfer id");
}
return this.props.match.params.id;
}
- get replica() {
- return replicaStore.replicaDetails;
+ get transfer() {
+ return transferStore.transferDetails;
}
getLastExecution() {
- if (this.replica?.executions?.length) {
- return this.replica.executions[this.replica.executions.length - 1];
+ if (this.transfer?.executions?.length) {
+ return this.transfer.executions[this.transfer.executions.length - 1];
}
return null;
}
@@ -205,9 +208,36 @@ class ReplicaDetailsPage extends React.Component {
return this.getLastExecution()?.status;
}
- async loadIsEditable(replicaDetails: ReplicaItemDetails) {
- const targetEndpointId = replicaDetails.destination_endpoint_id;
- const sourceEndpointId = replicaDetails.origin_endpoint_id;
+ getTransferItemType(): string {
+ let item_type = "replica";
+ let scenario = this.transfer?.scenario;
+ if (scenario && scenario === "live_migration") {
+ item_type = "migration";
+ }
+ return item_type;
+ }
+
+ getTransferTypePillShouldRed(): bool {
+ let should_red = true;
+ let scenario = this.transfer?.scenario;
+ if (scenario && scenario === "live_migration") {
+ should_red = false;
+ }
+ return should_red;
+ }
+
+ getTransferScenarioTypeImage(): string {
+ let image = replicaImage;
+ let scenario = this.transfer?.scenario;
+ if (scenario && scenario === "live_migration") {
+ image = liveMigrationImage;
+ }
+ return image;
+ }
+
+ async loadIsEditable(transferDetails: TransferItemDetails) {
+ const targetEndpointId = transferDetails.destination_endpoint_id;
+ const sourceEndpointId = transferDetails.origin_endpoint_id;
await ObjectUtils.waitFor(() => endpointStore.endpoints.length > 0);
const sourceEndpoint = endpointStore.endpoints.find(
e => e.id === sourceEndpointId
@@ -233,18 +263,18 @@ class ReplicaDetailsPage extends React.Component {
this.setState({ isEditable, isEditableLoading: false });
}
- async loadReplicaWithInstances(options: {
+ async loadTransferWithInstances(options: {
cache: boolean;
- replicaId?: string;
+ transferId?: string;
showLoading?: boolean;
onDetailsLoaded?: () => void;
}) {
- await replicaStore.getReplicaDetails({
- replicaId: options.replicaId || this.replicaId,
+ await transferStore.getTransferDetails({
+ transferId: options.transferId || this.transferId,
showLoading: options.showLoading,
});
- const replica = this.replica;
- if (!replica) {
+ const transfer = this.transfer;
+ if (!transfer) {
return null;
}
if (options.onDetailsLoaded) {
@@ -254,11 +284,11 @@ class ReplicaDetailsPage extends React.Component {
await providerStore.loadProviders();
- this.loadIsEditable(replica);
+ this.loadIsEditable(transfer);
networkStore.loadNetworks(
- replica.destination_endpoint_id,
- replica.destination_environment,
+ transfer.destination_endpoint_id,
+ transfer.destination_environment,
{
quietError: true,
cache: options.cache,
@@ -266,7 +296,7 @@ class ReplicaDetailsPage extends React.Component {
);
const targetEndpoint = endpointStore.endpoints.find(
- e => e.id === replica.destination_endpoint_id
+ e => e.id === transfer.destination_endpoint_id
);
const hasStorageMap = targetEndpoint
@@ -278,32 +308,32 @@ class ReplicaDetailsPage extends React.Component {
: false;
if (hasStorageMap) {
endpointStore.loadStorage(
- replica.destination_endpoint_id,
- replica.destination_environment
+ transfer.destination_endpoint_id,
+ transfer.destination_environment
);
}
instanceStore.loadInstancesDetails({
- endpointId: replica.origin_endpoint_id,
- instances: replica.instances.map(n => ({ id: n })),
+ endpointId: transfer.origin_endpoint_id,
+ instances: transfer.instances.map(n => ({ id: n })),
cache: options.cache,
quietError: false,
- env: replica.source_environment,
+ env: transfer.source_environment,
targetProvider: targetEndpoint?.type,
});
- return replica;
+ return transfer;
}
isExecuteDisabled() {
- const replica = this.replica;
- if (!replica) {
+ const transfer = this.transfer;
+ if (!transfer) {
return true;
}
const originEndpoint = endpointStore.endpoints.find(
- e => e.id === replica.origin_endpoint_id
+ e => e.id === transfer.origin_endpoint_id
);
const targetEndpoint = endpointStore.endpoints.find(
- e => e.id === replica.destination_endpoint_id
+ e => e.id === transfer.destination_endpoint_id
);
const status = this.getStatus();
@@ -334,11 +364,11 @@ class ReplicaDetailsPage extends React.Component {
}
handleDeleteExecutionConfirmation() {
- const replica = this.replica;
- if (!this.state.confirmationItem || !replica) {
+ const transfer = this.transfer;
+ if (!this.state.confirmationItem || !transfer) {
return;
}
- replicaStore.deleteExecution(replica.id, this.state.confirmationItem.id);
+ transferStore.deleteExecution(transfer.id, this.state.confirmationItem.id);
this.handleCloseExecutionConfirmation();
}
@@ -356,59 +386,59 @@ class ReplicaDetailsPage extends React.Component {
});
}
- handleDeleteReplicaClick() {
- this.setState({ showDeleteReplicaConfirmation: true });
+ handleDeleteTransferClick() {
+ this.setState({ showDeleteTransferConfirmation: true });
}
- handleDeleteReplicaDisksClick() {
- this.setState({ showDeleteReplicaDisksConfirmation: true });
+ handleDeleteTransferDisksClick() {
+ this.setState({ showDeleteTransferDisksConfirmation: true });
}
- handleDeleteReplicaConfirmation() {
- this.setState({ showDeleteReplicaConfirmation: false });
- const replica = this.replica;
- if (!replica) {
+ handleDeleteTransferConfirmation() {
+ this.setState({ showDeleteTransferConfirmation: false });
+ const transfer = this.transfer;
+ if (!transfer) {
return;
}
- this.props.history.push("/replicas");
- replicaStore.delete(replica.id);
+ this.props.history.push("/transfers");
+ transferStore.delete(transfer.id);
}
- handleCloseDeleteReplicaConfirmation() {
- this.setState({ showDeleteReplicaConfirmation: false });
+ handleCloseDeleteTransferConfirmation() {
+ this.setState({ showDeleteTransferConfirmation: false });
}
- handleDeleteReplicaDisksConfirmation() {
+ handleDeleteTransferDisksConfirmation() {
this.setState({
- showDeleteReplicaDisksConfirmation: false,
- showDeleteReplicaConfirmation: false,
+ showDeleteTransferDisksConfirmation: false,
+ showDeleteTransferConfirmation: false,
});
- const replica = this.replica;
- if (!replica) {
+ const transfer = this.transfer;
+ if (!transfer) {
return;
}
- replicaStore.deleteDisks(replica.id);
- this.props.history.push(`/replicas/${replica.id}/executions`);
+ transferStore.deleteDisks(transfer.id);
+ this.props.history.push(`/transfers/${transfer.id}/executions`);
}
- handleCloseDeleteReplicaDisksConfirmation() {
- this.setState({ showDeleteReplicaDisksConfirmation: false });
+ handleCloseDeleteTransferDisksConfirmation() {
+ this.setState({ showDeleteTransferDisksConfirmation: false });
}
- handleCloseMigrationModal() {
- this.setState({ showMigrationModal: false, pausePolling: false });
+ handleCloseDeploymentModal() {
+ this.setState({ showDeploymentModal: false, pausePolling: false });
}
- handleCreateMigrationClick() {
- this.setState({ showMigrationModal: true, pausePolling: true });
+ handleCreateDeploymentClick() {
+ this.setState({ showDeploymentModal: true, pausePolling: true });
}
- handleReplicaEditClick() {
+ handleTransferEditClick() {
this.setState({ showEditModal: true, pausePolling: true });
}
handleAddScheduleClick(schedule: Schedule) {
- scheduleStore.addSchedule(this.replicaId, schedule);
+ scheduleStore.addSchedule(this.transferId, schedule);
}
handleScheduleChange(
@@ -423,7 +453,7 @@ class ReplicaDetailsPage extends React.Component {
if (scheduleId) {
scheduleStore.updateSchedule({
- replicaId: this.replicaId,
+ transferId: this.transferId,
scheduleId,
data,
oldData,
@@ -436,7 +466,7 @@ class ReplicaDetailsPage extends React.Component {
handleScheduleSave(schedule: Schedule) {
if (schedule.id) {
scheduleStore.updateSchedule({
- replicaId: this.replicaId,
+ transferId: this.transferId,
scheduleId: schedule.id,
data: schedule,
oldData: schedule,
@@ -448,7 +478,7 @@ class ReplicaDetailsPage extends React.Component {
handleScheduleRemove(scheduleId: string | null) {
if (scheduleId) {
- scheduleStore.removeSchedule(this.replicaId, scheduleId);
+ scheduleStore.removeSchedule(this.transferId, scheduleId);
}
}
@@ -475,12 +505,12 @@ class ReplicaDetailsPage extends React.Component {
}
handleCancelConfirmation(force?: boolean) {
- const replica = this.replica;
- if (!this.state.confirmationItem || !replica) {
+ const transfer = this.transfer;
+ if (!this.state.confirmationItem || !transfer) {
return;
}
- replicaStore.cancelExecution({
- replicaId: replica.id,
+ transferStore.cancelExecution({
+ transferId: transfer.id,
executionId: this.state.confirmationItem.id,
force,
});
@@ -489,17 +519,17 @@ class ReplicaDetailsPage extends React.Component {
showCancelConfirmation: false,
});
}
- async migrate(opts: {
+ async deploy(opts: {
fields: Field[];
uploadedUserScripts: InstanceScript[];
removedUserScripts: InstanceScript[];
minionPoolMappings: { [instance: string]: string };
}) {
- const replica = this.replica;
- if (!replica) {
+ const transfer = this.transfer;
+ if (!transfer) {
return;
}
- this.setState({ migrating: true });
+ this.setState({ deploying: true });
const {
fields,
uploadedUserScripts,
@@ -507,28 +537,34 @@ class ReplicaDetailsPage extends React.Component {
minionPoolMappings,
} = opts;
try {
- const migration = await migrationStore.migrateReplica({
- replicaId: replica.id,
+ const deployment = await deploymentStore.deployTransfer({
+ transferId: transfer.id,
fields,
uploadedUserScripts,
removedUserScripts,
- userScriptData: replica.user_scripts,
+ userScriptData: transfer.user_scripts,
minionPoolMappings,
});
- this.props.history.push(`/migrations/${migration.id}/tasks/`);
+ this.props.history.push(`/deployments/${deployment.id}/tasks/`);
} finally {
- this.setState({ migrating: false });
+ this.setState({ deploying: false });
}
}
- executeReplica(fields: Field[]) {
- const replica = this.replica;
- if (!replica) {
+ async executeTransfer(fields: Field[]) {
+ const transfer = this.transfer;
+ if (!transfer) {
return;
}
- replicaStore.execute(replica.id, fields);
- this.handleCloseOptionsModal();
- this.props.history.push(`/replicas/${replica.id}/executions`);
+ this.setState({ executing: true });
+ try {
+ await transferStore.execute(transfer.id, fields);
+
+ this.handleCloseOptionsModal();
+ this.props.history.push(`/transfers/${transfer.id}/executions`);
+ } finally {
+ this.setState({ executing: false });
+ }
}
async pollData() {
@@ -542,14 +578,14 @@ class ReplicaDetailsPage extends React.Component {
}
await Promise.all([
- replicaStore.getReplicaDetails({
- replicaId: this.replicaId,
+ transferStore.getTransferDetails({
+ transferId: this.transferId,
polling: true,
}),
(async () => {
if (window.location.pathname.indexOf("executions") > -1) {
- await replicaStore.getExecutionTasks({
- replicaId: this.replicaId,
+ await transferStore.getExecutionTasks({
+ transferId: this.transferId,
polling: true,
});
}
@@ -567,8 +603,8 @@ class ReplicaDetailsPage extends React.Component {
});
}
- handleEditReplicaReload() {
- this.loadReplicaWithInstances({ cache: false });
+ handleEditTransferReload() {
+ this.loadTransferWithInstances({ cache: false });
}
handleUpdateComplete(redirectTo: string) {
@@ -577,26 +613,26 @@ class ReplicaDetailsPage extends React.Component {
}
async handleExecutionChange(executionId: string) {
- await ObjectUtils.waitFor(() => Boolean(replicaStore.replicaDetails));
- if (!replicaStore.replicaDetails?.id) {
+ await ObjectUtils.waitFor(() => Boolean(transferStore.transferDetails));
+ if (!transferStore.transferDetails?.id) {
return;
}
- replicaStore.getExecutionTasks({
- replicaId: replicaStore.replicaDetails.id,
+ transferStore.getExecutionTasks({
+ transferId: transferStore.transferDetails.id,
executionId,
});
}
- renderEditReplica() {
- const replica = this.replica;
- if (!replica) {
+ renderEditTransfer() {
+ const transfer = this.transfer;
+ if (!transfer) {
return null;
}
const sourceEndpoint = endpointStore.endpoints.find(
- e => e.id === replica.origin_endpoint_id
+ e => e.id === transfer.origin_endpoint_id
);
const destinationEndpoint = endpointStore.endpoints.find(
- e => e.id === replica.destination_endpoint_id
+ e => e.id === transfer.destination_endpoint_id
);
if (!this.state.showEditModal || !destinationEndpoint || !sourceEndpoint) {
@@ -606,7 +642,7 @@ class ReplicaDetailsPage extends React.Component {
return (
{
this.handleUpdateComplete(url);
@@ -614,14 +650,14 @@ class ReplicaDetailsPage extends React.Component {
onRequestClose={() => {
this.closeEditModal();
}}
- replica={replica}
+ transfer={transfer}
destinationEndpoint={destinationEndpoint}
instancesDetails={instanceStore.instancesDetails}
instancesDetailsLoading={instanceStore.loadingInstancesDetails}
networks={networkStore.networks}
networksLoading={networkStore.loading}
onReloadClick={() => {
- this.handleEditReplicaReload();
+ this.handleEditTransferReload();
}}
/>
);
@@ -631,7 +667,7 @@ class ReplicaDetailsPage extends React.Component {
const editTitle = providerStore.providersLoading
? "Loading providers data"
: !this.state.isEditable
- ? "One of the platform plugins doesn't support editing replica option."
+ ? "One of the platform plugins doesn't support editing transfer option."
: null;
const dropdownActions: DropdownAction[] = [
{
@@ -658,17 +694,17 @@ class ReplicaDetailsPage extends React.Component {
},
},
{
- label: "Create Migration",
+ label: "Create Deployment",
color: ThemePalette.primary,
action: () => {
- this.handleCreateMigrationClick();
+ this.handleCreateDeploymentClick();
},
},
{
label: "Edit",
title: editTitle,
action: () => {
- this.handleReplicaEditClick();
+ this.handleTransferEditClick();
},
disabled: !this.state.isEditable,
loading: this.state.isEditableLoading,
@@ -676,18 +712,18 @@ class ReplicaDetailsPage extends React.Component {
{
label: "Delete Disks",
action: () => {
- this.handleDeleteReplicaDisksClick();
+ this.handleDeleteTransferDisksClick();
},
},
{
- label: "Delete Replica",
+ label: "Delete",
color: ThemePalette.alert,
action: () => {
- this.handleDeleteReplicaClick();
+ this.handleDeleteTransferClick();
},
},
];
- const replica = this.replica;
+ const transfer = this.transfer;
return (
@@ -702,20 +738,21 @@ class ReplicaDetailsPage extends React.Component {
}
contentHeaderComponent={
}
contentComponent={
- {
networks={networkStore.networks}
minionPools={minionPoolStore.minionPools}
detailsLoading={
- replicaStore.replicaDetailsLoading ||
+ transferStore.transferDetailsLoading ||
endpointStore.loading ||
minionPoolStore.loadingMinionPools ||
this.state.initialLoading
@@ -746,19 +783,19 @@ class ReplicaDetailsPage extends React.Component {
providerStore.destinationOptionsSecondaryLoading
}
executionsLoading={
- replicaStore.startingExecution ||
- replicaStore.replicaDetailsLoading
+ transferStore.startingExecution ||
+ transferStore.transferDetailsLoading
}
onExecutionChange={id => {
this.handleExecutionChange(id);
}}
- executions={replicaStore.replicaDetails?.executions || []}
+ executions={transferStore.transferDetails?.executions || []}
executionsTasksLoading={
- replicaStore.executionsTasksLoading ||
- replicaStore.replicaDetailsLoading ||
- replicaStore.startingExecution
+ transferStore.executionsTasksLoading ||
+ transferStore.transferDetailsLoading ||
+ transferStore.startingExecution
}
- executionsTasks={replicaStore.executionsTasks}
+ executionsTasks={transferStore.executionsTasks}
page={this.props.match.params.page || ""}
onCancelExecutionClick={(e, f) => {
this.handleCancelExecution(e, f);
@@ -769,11 +806,11 @@ class ReplicaDetailsPage extends React.Component {
onExecuteClick={() => {
this.handleExecuteClick();
}}
- onCreateMigrationClick={() => {
- this.handleCreateMigrationClick();
+ onCreateDeploymentClick={() => {
+ this.handleCreateDeploymentClick();
}}
- onDeleteReplicaClick={() => {
- this.handleDeleteReplicaClick();
+ onDeleteTransferClick={() => {
+ this.handleDeleteTransferClick();
}}
onAddScheduleClick={schedule => {
this.handleAddScheduleClick(schedule);
@@ -797,45 +834,46 @@ class ReplicaDetailsPage extends React.Component {
this.handleCloseOptionsModal();
}}
>
-
p ===
endpointStore.endpoints.find(
- e => e.id === replicaStore.replicaDetails?.origin_endpoint_id
+ e => e.id === transferStore.transferDetails?.origin_endpoint_id
)?.type
)}
onCancelClick={() => {
this.handleCloseOptionsModal();
}}
onExecuteClick={fields => {
- this.executeReplica(fields);
+ this.executeTransfer(fields);
}}
+ executing={this.state.executing}
/>
- {this.state.showMigrationModal ? (
+ {this.state.showDeploymentModal ? (
{
- this.handleCloseMigrationModal();
+ this.handleCloseDeploymentModal();
}}
>
-
- m.endpoint_id === this.replica?.destination_endpoint_id &&
+ m.endpoint_id === this.transfer?.destination_endpoint_id &&
m.platform === "destination"
)}
loadingInstances={instanceStore.loadingInstancesDetails}
instances={instanceStore.instancesDetails}
onCancelClick={() => {
- this.handleCloseMigrationModal();
+ this.handleCloseDeploymentModal();
}}
- migrating={this.state.migrating}
- onMigrateClick={opts => {
- this.migrate(opts);
+ deploying={this.state.deploying}
+ onDeployClick={opts => {
+ this.deploy(opts);
}}
/>
@@ -852,28 +890,28 @@ class ReplicaDetailsPage extends React.Component {
this.handleCloseExecutionConfirmation();
}}
/>
- {this.state.showDeleteReplicaConfirmation ? (
- this.handleCloseDeleteReplicaConfirmation()}
- onDeleteReplica={() => {
- this.handleDeleteReplicaConfirmation();
+ {this.state.showDeleteTransferConfirmation ? (
+ this.handleCloseDeleteTransferConfirmation()}
+ onDeleteTransfer={() => {
+ this.handleDeleteTransferConfirmation();
}}
onDeleteDisks={() => {
- this.handleDeleteReplicaDisksConfirmation();
+ this.handleDeleteTransferDisksConfirmation();
}}
/>
) : null}
{
- this.handleDeleteReplicaDisksConfirmation();
+ this.handleDeleteTransferDisksConfirmation();
}}
onRequestClose={() => {
- this.handleCloseDeleteReplicaDisksConfirmation();
+ this.handleCloseDeleteTransferDisksConfirmation();
}}
/>
- {this.renderEditReplica()}
+ {this.renderEditTransfer()}
);
}
}
-export default ReplicaDetailsPage;
+export default TransferDetailsPage;
diff --git a/src/components/smart/TransferDetailsPage/images/live_migration.svg b/src/components/smart/TransferDetailsPage/images/live_migration.svg
new file mode 100644
index 00000000..de30f36a
--- /dev/null
+++ b/src/components/smart/TransferDetailsPage/images/live_migration.svg
@@ -0,0 +1,15 @@
+
+
+
+
+ Created with Sketch.
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/smart/TransferDetailsPage/images/replica.svg b/src/components/smart/TransferDetailsPage/images/replica.svg
new file mode 100644
index 00000000..b3261a3f
--- /dev/null
+++ b/src/components/smart/TransferDetailsPage/images/replica.svg
@@ -0,0 +1,15 @@
+
+
+
+
+ Created with Sketch.
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/smart/TransferDetailsPage/package.json b/src/components/smart/TransferDetailsPage/package.json
new file mode 100644
index 00000000..7a50a394
--- /dev/null
+++ b/src/components/smart/TransferDetailsPage/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "TransferDetailsPage",
+ "version": "0.0.0",
+ "private": true,
+ "main": "./TransferDetailsPage.tsx"
+}
diff --git a/src/components/smart/ReplicasPage/ReplicasPage.tsx b/src/components/smart/TransfersPage/TransfersPage.tsx
similarity index 62%
rename from src/components/smart/ReplicasPage/ReplicasPage.tsx
rename to src/components/smart/TransfersPage/TransfersPage.tsx
index 36911217..b1a82c21 100644
--- a/src/components/smart/ReplicasPage/ReplicasPage.tsx
+++ b/src/components/smart/TransfersPage/TransfersPage.tsx
@@ -22,17 +22,17 @@ import FilterList from "@src/components/ui/Lists/FilterList";
import PageHeader from "@src/components/smart/PageHeader";
import AlertModal from "@src/components/ui/AlertModal";
import Modal from "@src/components/ui/Modal";
-import ReplicaExecutionOptions from "@src/components/modules/TransferModule/ReplicaExecutionOptions";
-import ReplicaMigrationOptions from "@src/components/modules/TransferModule/ReplicaMigrationOptions";
-import DeleteReplicaModal from "@src/components/modules/TransferModule/DeleteReplicaModal";
+import TransferExecutionOptions from "@src/components/modules/TransferModule/TransferExecutionOptions";
+import DeploymentOptions from "@src/components/modules/TransferModule/DeploymentOptions";
+import DeleteTransferModal from "@src/components/modules/TransferModule/DeleteTransferModal/DeleteTransferModal";
import type { DropdownAction } from "@src/components/ui/Dropdowns/ActionDropdown";
import type { Field } from "@src/@types/Field";
import type { InstanceScript } from "@src/@types/Instance";
import projectStore from "@src/stores/ProjectStore";
-import replicaStore from "@src/stores/ReplicaStore";
-import migrationStore from "@src/stores/MigrationStore";
+import transferStore from "@src/stores/TransferStore";
+import deploymentStore from "@src/stores/DeploymentStore";
import scheduleStore from "@src/stores/ScheduleStore";
import instanceStore from "@src/stores/InstanceStore";
import endpointStore from "@src/stores/EndpointStore";
@@ -40,11 +40,12 @@ import notificationStore from "@src/stores/NotificationStore";
import { ThemePalette } from "@src/components/Theme";
import configLoader from "@src/utils/Config";
-import { ReplicaItem } from "@src/@types/MainItem";
+import { TransferItem } from "@src/@types/MainItem";
import userStore from "@src/stores/UserStore";
import TransferListItem from "@src/components/modules/TransferModule/TransferListItem";
import replicaLargeImage from "./images/replica-large.svg";
import replicaItemImage from "./images/replica.svg";
+import liveMigrationItemImage from "./images/live-migration.svg";
const Wrapper = styled.div``;
@@ -52,23 +53,23 @@ const SCHEDULE_POLL_TIMEOUT = 10000;
type State = {
modalIsOpen: boolean;
- selectedReplicas: ReplicaItem[];
+ selectedTransfers: TransferItem[];
showCancelExecutionModal: boolean;
showExecutionOptionsModal: boolean;
- showCreateMigrationsModal: boolean;
+ showCreateDeploymentsModal: boolean;
showDeleteDisksModal: boolean;
- showDeleteReplicasModal: boolean;
+ showDeleteTransfersModal: boolean;
};
@observer
-class ReplicasPage extends React.Component<{ history: any }, State> {
+class TransfersPage extends React.Component<{ history: any }, State> {
state: State = {
modalIsOpen: false,
- selectedReplicas: [],
+ selectedTransfers: [],
showCancelExecutionModal: false,
- showCreateMigrationsModal: false,
+ showCreateDeploymentsModal: false,
showExecutionOptionsModal: false,
showDeleteDisksModal: false,
- showDeleteReplicasModal: false,
+ showDeleteTransfersModal: false,
};
pollTimeout = 0;
@@ -79,10 +80,10 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
schedulePollTimeout = 0;
- paginatedReplicaIds: string[] = [];
+ paginatedTransferIds: string[] = [];
componentDidMount() {
- document.title = "Coriolis Replicas";
+ document.title = "Coriolis Transfers";
projectStore.getProjects();
endpointStore.getEndpoints({ showLoading: true });
@@ -114,120 +115,128 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
];
}
- getStatus(replica?: ReplicaItem | null): string {
- return replica?.last_execution_status || "";
+ getStatus(transfer?: TransferItem | null): string {
+ return transfer?.last_execution_status || "";
}
+ getTransferItemImage(item: TransferItem): string {
+ let image = replicaItemImage;
+ if (item.scenario === "live_migration") {
+ image = liveMigrationItemImage;
+ }
+ return image;
+ }
+
handleProjectChange() {
- replicaStore.getReplicas();
+ transferStore.getTransfers();
endpointStore.getEndpoints({ showLoading: true });
}
handleReloadButtonClick() {
projectStore.getProjects();
- replicaStore.getReplicas({ showLoading: true });
+ transferStore.getTransfers({ showLoading: true });
endpointStore.getEndpoints({ showLoading: true });
userStore.getAllUsers({ showLoading: true, quietError: true });
}
- handleItemClick(item: ReplicaItem) {
+ handleItemClick(item: TransferItem) {
if (item.last_execution_status === "RUNNING") {
- this.props.history.push(`/replicas/${item.id}/executions`);
+ this.props.history.push(`/transfers/${item.id}/executions`);
} else {
- this.props.history.push(`/replicas/${item.id}`);
+ this.props.history.push(`/transfers/${item.id}`);
}
}
- handlePaginatedItemsChange(paginatedReplicas: ReplicaItem[]) {
- this.paginatedReplicaIds = paginatedReplicas.map(r => r.id);
+ handlePaginatedItemsChange(paginatedTransfers: TransferItem[]) {
+ this.paginatedTransferIds = paginatedTransfers.map(r => r.id);
}
- executeSelectedReplicas(fields: Field[]) {
- this.state.selectedReplicas.forEach(replica => {
- const actualReplica = replicaStore.replicas.find(
- r => r.id === replica.id
+ executeSelectedTransfers(fields: Field[]) {
+ this.state.selectedTransfers.forEach(transfer => {
+ const actualTransfer = transferStore.transfers.find(
+ r => r.id === transfer.id
);
- if (actualReplica && this.isExecuteEnabled(actualReplica)) {
- replicaStore.execute(replica.id, fields);
+ if (actualTransfer && this.isExecuteEnabled(actualTransfer)) {
+ transferStore.execute(transfer.id, fields);
}
});
- notificationStore.alert("Executing selected replicas");
+ notificationStore.alert("Executing selected transfers");
this.setState({ showExecutionOptionsModal: false });
}
- migrateSelectedReplicas(fields: Field[], uploadedScripts: InstanceScript[]) {
- notificationStore.alert("Creating migrations from selected replicas");
- this.migrate(fields, uploadedScripts);
- this.setState({ showCreateMigrationsModal: false, modalIsOpen: false });
+ deploySelectedTransfers(fields: Field[], uploadedScripts: InstanceScript[]) {
+ notificationStore.alert("Creating deployments from selected transfers");
+ this.deploy(fields, uploadedScripts);
+ this.setState({ showCreateDeploymentsModal: false, modalIsOpen: false });
}
- async migrate(fields: Field[], uploadedScripts: InstanceScript[]) {
+ async deploy(fields: Field[], uploadedScripts: InstanceScript[]) {
await Promise.all(
- this.state.selectedReplicas.map(replica =>
- migrationStore.migrateReplica({
- replicaId: replica.id,
+ this.state.selectedTransfers.map(transfer =>
+ deploymentStore.deployTransfer({
+ transferId: transfer.id,
fields,
uploadedUserScripts: uploadedScripts.filter(
s =>
- !s.instanceId || replica.instances.find(i => i === s.instanceId)
+ !s.instanceId || transfer.instances.find(i => i === s.instanceId)
),
removedUserScripts: [],
- userScriptData: replica.user_scripts,
+ userScriptData: transfer.user_scripts,
minionPoolMappings:
- replica.instance_osmorphing_minion_pool_mappings || {},
+ transfer.instance_osmorphing_minion_pool_mappings || {},
})
)
);
notificationStore.alert(
- "Migrations successfully created from replicas.",
+ "Deployments successfully created from transfers.",
"success"
);
- this.props.history.push("/migrations");
+ this.props.history.push("/deployments");
}
- handleShowDeleteReplicas() {
- replicaStore.loadHaveReplicasDisks(this.state.selectedReplicas);
- this.setState({ showDeleteReplicasModal: true });
+ handleShowDeleteTransfers() {
+ transferStore.loadHaveTransfersDisks(this.state.selectedTransfers);
+ this.setState({ showDeleteTransfersModal: true });
}
- deleteReplicasDisks(replicas: ReplicaItem[]) {
- replicas.forEach(replica => {
- replicaStore.deleteDisks(replica.id);
+ deleteTransfersDisks(transfers: TransferItem[]) {
+ transfers.forEach(transfer => {
+ transferStore.deleteDisks(transfer.id);
});
this.setState({
showDeleteDisksModal: false,
- showDeleteReplicasModal: false,
+ showDeleteTransfersModal: false,
});
- notificationStore.alert("Deleting selected replicas' disks");
+ notificationStore.alert("Deleting selected transfers' disks");
}
cancelExecutions() {
- this.state.selectedReplicas.forEach(replica => {
- const actualReplica = replicaStore.replicas.find(
- r => r.id === replica.id
+ this.state.selectedTransfers.forEach(transfer => {
+ const actualTransfer = transferStore.transfers.find(
+ r => r.id === transfer.id
);
if (
- actualReplica?.last_execution_status === "RUNNING" ||
- actualReplica?.last_execution_status === "AWAITING_MINION_ALLOCATIONS"
+ actualTransfer?.last_execution_status === "RUNNING" ||
+ actualTransfer?.last_execution_status === "AWAITING_MINION_ALLOCATIONS"
) {
- replicaStore.cancelExecution({ replicaId: replica.id });
+ transferStore.cancelExecution({ transferId: transfer.id });
}
});
this.setState({ showCancelExecutionModal: false });
}
- isExecuteEnabled(replica?: ReplicaItem | null): boolean {
- if (!replica) {
+ isExecuteEnabled(transfer?: TransferItem | null): boolean {
+ if (!transfer) {
return false;
}
- const usableReplica = replica;
+ const usableTransfer = transfer;
const originEndpoint = endpointStore.endpoints.find(
- e => e.id === usableReplica.origin_endpoint_id
+ e => e.id === usableTransfer.origin_endpoint_id
);
const targetEndpoint = endpointStore.endpoints.find(
- e => e.id === usableReplica.destination_endpoint_id
+ e => e.id === usableTransfer.destination_endpoint_id
);
- const status = this.getStatus(usableReplica);
+ const status = this.getStatus(usableTransfer);
return Boolean(
originEndpoint &&
targetEndpoint &&
@@ -236,11 +245,11 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
);
}
- deleteSelectedReplicas() {
- this.state.selectedReplicas.forEach(replica => {
- replicaStore.delete(replica.id);
+ deleteSelectedTransfers() {
+ this.state.selectedTransfers.forEach(transfer => {
+ transferStore.delete(transfer.id);
});
- this.setState({ showDeleteReplicasModal: false });
+ this.setState({ showDeleteTransfersModal: false });
}
handleEmptyListButtonClick() {
@@ -257,16 +266,16 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
});
}
- handleShowCreateMigrationsModal() {
+ handleShowCreateDeploymentsModal() {
instanceStore.loadInstancesDetailsBulk(
- replicaStore.replicas.map(r => ({
+ transferStore.transfers.map(r => ({
endpointId: r.origin_endpoint_id,
instanceIds: r.instances,
env: r.source_environment,
}))
);
- this.setState({ showCreateMigrationsModal: true, modalIsOpen: true });
+ this.setState({ showCreateDeploymentsModal: true, modalIsOpen: true });
}
async pollData() {
@@ -275,7 +284,7 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
}
await Promise.all([
- replicaStore.getReplicas({ skipLog: true }),
+ transferStore.getTransfers({ skipLog: true }),
endpointStore.getEndpoints({ skipLog: true }),
userStore.getAllUsers({ skipLog: true, quietError: true }),
]);
@@ -291,18 +300,18 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
if (
this.state.modalIsOpen ||
this.stopPolling ||
- replicaStore.replicas.length === 0
+ transferStore.transfers.length === 0
) {
return;
}
this.schedulePolling = true;
- await scheduleStore.getSchedulesBulk(this.paginatedReplicaIds);
+ await scheduleStore.getSchedulesBulk(this.paginatedTransferIds);
this.schedulePollTimeout = window.setTimeout(() => {
this.pollSchedule();
}, SCHEDULE_POLL_TIMEOUT);
}
- searchText(item: ReplicaItem, text: string) {
+ searchText(item: TransferItem, text: string) {
let result = false;
if (item.instances[0].toLowerCase().indexOf(text) > -1) {
return true;
@@ -324,7 +333,7 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
}
itemFilterFunction(
- item: ReplicaItem,
+ item: TransferItem,
filterStatus?: string | null,
filterText?: string
) {
@@ -341,9 +350,9 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
return true;
}
- isReplicaScheduled(replicaId: string): boolean {
+ isTransferScheduled(transferId: string): boolean {
const bulkScheduleItem = scheduleStore.bulkSchedules.find(
- b => b.replicaId === replicaId
+ b => b.transferId === transferId
);
if (!bulkScheduleItem) {
return false;
@@ -355,24 +364,24 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
render() {
let atLeastOneHasExecuteEnabled = false;
let atLeaseOneIsRunning = false;
- this.state.selectedReplicas.forEach(replica => {
- const storeReplica = replicaStore.replicas.find(r => r.id === replica.id);
+ this.state.selectedTransfers.forEach(transfer => {
+ const storeTransfer = transferStore.transfers.find(r => r.id === transfer.id);
atLeastOneHasExecuteEnabled =
- atLeastOneHasExecuteEnabled || this.isExecuteEnabled(storeReplica);
- const status = this.getStatus(storeReplica);
+ atLeastOneHasExecuteEnabled || this.isExecuteEnabled(storeTransfer);
+ const status = this.getStatus(storeTransfer);
atLeaseOneIsRunning =
atLeaseOneIsRunning ||
status === "RUNNING" ||
status === "AWAITING_MINION_ALLOCATIONS";
});
- const replicasWithDisabledExecutionOptions =
- this.state.selectedReplicas.filter(replica =>
+ const transfersWithDisabledExecutionOptions =
+ this.state.selectedTransfers.filter(transfer =>
configLoader.config.providersDisabledExecuteOptions.find(
p =>
p ===
endpointStore.endpoints.find(
- e => e.id === replica.origin_endpoint_id
+ e => e.id === transfer.origin_endpoint_id
)?.type
)
);
@@ -393,10 +402,10 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
},
},
{
- label: "Create Migrations",
+ label: "Deploy Transfers",
color: ThemePalette.primary,
action: () => {
- this.handleShowCreateMigrationsModal();
+ this.handleShowCreateDeploymentsModal();
},
},
{
@@ -406,10 +415,10 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
},
},
{
- label: "Delete Replicas",
+ label: "Delete Transfers",
color: ThemePalette.alert,
action: () => {
- this.handleShowDeleteReplicas();
+ this.handleShowDeleteTransfers();
},
},
];
@@ -417,13 +426,13 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
return (
}
+ navigationComponent={ }
listComponent={
{
this.handleItemClick(item);
@@ -432,17 +441,19 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
this.handleReloadButtonClick();
}}
itemFilterFunction={(...args) => this.itemFilterFunction(...args)}
- onSelectedItemsChange={selectedReplicas => {
- this.setState({ selectedReplicas });
+ onSelectedItemsChange={selectedTransfers => {
+ this.setState({ selectedTransfers: selectedTransfers });
}}
- onPaginatedItemsChange={paginatedReplicas => {
- this.handlePaginatedItemsChange(paginatedReplicas);
+ onPaginatedItemsChange={paginatedTransfers => {
+ this.handlePaginatedItemsChange(paginatedTransfers);
}}
renderItemComponent={options => (
{
+ return this.getTransferItemImage(item);
+ }}
+ showScheduleIcon={this.isTransferScheduled(options.item.id)}
endpointType={id => {
const endpoint = this.getEndpoint(id);
if (endpoint) {
@@ -460,9 +471,9 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
/>
)}
emptyListImage={replicaLargeImage}
- emptyListMessage="It seems like you don't have any Replicas in this project."
- emptyListExtraMessage="The Coriolis Replica is obtained by replicating incrementally the virtual machines data from the source cloud endpoint to the target."
- emptyListButtonLabel="Create a Replica"
+ emptyListMessage="It seems like you don't have any Transfers in this project."
+ emptyListExtraMessage="A Coriolis Transfer is performed by replicating incrementally the virtual machines data from the source cloud endpoint to the target."
+ emptyListButtonLabel="Create a Transfer"
onEmptyListButtonClick={() => {
this.handleEmptyListButtonClick();
}}
@@ -470,7 +481,7 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
}
headerComponent={
{
this.handleProjectChange();
}}
@@ -483,19 +494,19 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
/>
}
/>
- {this.state.showDeleteReplicasModal ? (
- 0}
- loading={replicaStore.replicasWithDisksLoading}
+ {this.state.showDeleteTransfersModal ? (
+ 0}
+ loading={transferStore.transfersWithDisksLoading}
onRequestClose={() => {
- this.setState({ showDeleteReplicasModal: false });
+ this.setState({ showDeleteTransfersModal: false });
}}
- onDeleteReplica={() => {
- this.deleteSelectedReplicas();
+ onDeleteTransfer={() => {
+ this.deleteSelectedTransfers();
}}
onDeleteDisks={() => {
- this.deleteReplicasDisks(replicaStore.replicasWithDisks);
+ this.deleteTransfersDisks(transferStore.transfersWithDisks);
}}
/>
) : null}
@@ -503,7 +514,7 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
{
this.cancelExecutions();
@@ -516,49 +527,49 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
{this.state.showExecutionOptionsModal ? (
{
this.setState({ showExecutionOptionsModal: false });
}}
>
- {
this.setState({ showExecutionOptionsModal: false });
}}
onExecuteClick={fields => {
- this.executeSelectedReplicas(fields);
+ this.executeSelectedTransfers(fields);
}}
/>
) : null}
- {this.state.showCreateMigrationsModal ? (
+ {this.state.showCreateDeploymentsModal ? (
{
this.setState({
- showCreateMigrationsModal: false,
+ showCreateDeploymentsModal: false,
modalIsOpen: false,
});
}}
>
- {
this.setState({
- showCreateMigrationsModal: false,
+ showCreateDeploymentsModal: false,
modalIsOpen: false,
});
}}
- onMigrateClick={options => {
- this.migrateSelectedReplicas(
+ onDeployClick={options => {
+ this.deploySelectedTransfers(
options.fields,
options.uploadedUserScripts
);
@@ -569,11 +580,11 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
{this.state.showDeleteDisksModal ? (
{
- this.deleteReplicasDisks(this.state.selectedReplicas);
+ this.deleteTransfersDisks(this.state.selectedTransfers);
}}
onRequestClose={() => {
this.setState({ showDeleteDisksModal: false });
@@ -585,4 +596,4 @@ class ReplicasPage extends React.Component<{ history: any }, State> {
}
}
-export default ReplicasPage;
+export default TransfersPage;
diff --git a/src/components/smart/MigrationsPage/images/migration.svg b/src/components/smart/TransfersPage/images/live-migration.svg
similarity index 100%
rename from src/components/smart/MigrationsPage/images/migration.svg
rename to src/components/smart/TransfersPage/images/live-migration.svg
diff --git a/src/components/smart/ReplicasPage/images/replica-large.svg b/src/components/smart/TransfersPage/images/replica-large.svg
similarity index 100%
rename from src/components/smart/ReplicasPage/images/replica-large.svg
rename to src/components/smart/TransfersPage/images/replica-large.svg
diff --git a/src/components/smart/TransfersPage/images/replica.svg b/src/components/smart/TransfersPage/images/replica.svg
new file mode 100644
index 00000000..bba0576f
--- /dev/null
+++ b/src/components/smart/TransfersPage/images/replica.svg
@@ -0,0 +1,14 @@
+
+
+
+
+ Created with Sketch.
+
+
+
+
+
+
+
+
+
diff --git a/src/components/smart/TransfersPage/package.json b/src/components/smart/TransfersPage/package.json
new file mode 100644
index 00000000..4408c981
--- /dev/null
+++ b/src/components/smart/TransfersPage/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "TransfersPage",
+ "version": "0.0.0",
+ "private": true,
+ "main": "./TransfersPage.tsx"
+}
diff --git a/src/components/smart/WizardPage/WizardPage.tsx b/src/components/smart/WizardPage/WizardPage.tsx
index 6f045c66..3d87d1c1 100644
--- a/src/components/smart/WizardPage/WizardPage.tsx
+++ b/src/components/smart/WizardPage/WizardPage.tsx
@@ -17,7 +17,7 @@ import { observer } from "mobx-react";
import React from "react";
import styled from "styled-components";
-import { ReplicaItem, TransferItem } from "@src/@types/MainItem";
+import { TransferItem, ActionItem } from "@src/@types/MainItem";
import { ProviderTypes } from "@src/@types/Providers";
import DetailsPageHeader from "@src/components/modules/DetailsModule/DetailsPageHeader";
import EndpointModal from "@src/components/modules/EndpointModule/EndpointModal";
@@ -34,7 +34,7 @@ import notificationStore from "@src/stores/NotificationStore";
import providerStore, {
getFieldChangeOptions,
} from "@src/stores/ProviderStore";
-import replicaStore from "@src/stores/ReplicaStore";
+import transferStore from "@src/stores/TransferStore";
import scheduleStore from "@src/stores/ScheduleStore";
import userStore from "@src/stores/UserStore";
import wizardStore from "@src/stores/WizardStore";
@@ -188,7 +188,7 @@ class WizardPage extends React.Component {
this.handleBackClick();
}
- async handleCreationSuccess(items: TransferItem[]) {
+ async handleCreationSuccess(items: ActionItem[]) {
const typeLabel =
this.state.type.charAt(0).toUpperCase() + this.state.type.substr(1);
notificationStore.alert(
@@ -197,27 +197,20 @@ class WizardPage extends React.Component {
);
let schedulePromise = Promise.resolve();
- if (this.state.type === "replica") {
- items.forEach(replica => {
- if (replica.type !== "replica") {
- return;
- }
- this.executeCreatedReplica(replica);
- schedulePromise = this.scheduleReplica(replica);
- });
- }
+ items.forEach(transfer => {
+ if (transfer.type !== "transfer") {
+ return;
+ }
+ this.executeCreatedTransfer(transfer);
+ schedulePromise = this.scheduleTransfer(transfer);
+ });
if (items.length === 1) {
- let location = `/${this.state.type}s/${items[0].id}/`;
- if (this.state.type === "replica") {
- location += "executions";
- } else {
- location += "tasks";
- }
+ let location = `/transfers/${items[0].id}/executions`;
await schedulePromise;
this.props.history.push(location);
} else {
- this.props.history.push(`/${this.state.type}s`);
+ this.props.history.push(`/transfers`);
}
}
@@ -773,15 +766,15 @@ class WizardPage extends React.Component {
);
}
- scheduleReplica(replica: ReplicaItem): Promise {
+ scheduleTransfer(transfer: TransferItem): Promise {
if (wizardStore.schedules.length === 0) {
return Promise.resolve();
}
- return scheduleStore.scheduleMultiple(replica.id, wizardStore.schedules);
+ return scheduleStore.scheduleMultiple(transfer.id, wizardStore.schedules);
}
- executeCreatedReplica(replica: ReplicaItem) {
+ executeCreatedTransfer(transfer: TransferItem) {
const options = wizardStore.data.destOptions;
let executeNow = true;
if (options && options.execute_now != null) {
@@ -799,7 +792,7 @@ class WizardPage extends React.Component {
return field;
});
- replicaStore.execute(replica.id, executeNowOptions);
+ transferStore.execute(transfer.id, executeNowOptions);
}
handleCancelUploadedScript(
diff --git a/src/components/ui/Dropdowns/NewItemDropdown/NewItemDropdown.tsx b/src/components/ui/Dropdowns/NewItemDropdown/NewItemDropdown.tsx
index 10467e56..6ed80beb 100644
--- a/src/components/ui/Dropdowns/NewItemDropdown/NewItemDropdown.tsx
+++ b/src/components/ui/Dropdowns/NewItemDropdown/NewItemDropdown.tsx
@@ -175,15 +175,9 @@ class NewItemDropdown extends React.Component {
: [];
const items: ItemType[] = [
{
- title: "Migration",
- href: "/wizard/migration",
- description: "Migrate VMs between two clouds",
- iconName: "migration",
- },
- {
- title: "Replica",
+ title: "Transfer",
href: "/wizard/replica",
- description: "Incrementally replicate VMs between two clouds",
+ description: "Incrementally transfer VMs between two clouds",
iconName: "replica",
},
{
diff --git a/src/components/ui/Dropdowns/NotificationDropdown/NotificationDropdown.tsx b/src/components/ui/Dropdowns/NotificationDropdown/NotificationDropdown.tsx
index 4833a605..679c6bbf 100644
--- a/src/components/ui/Dropdowns/NotificationDropdown/NotificationDropdown.tsx
+++ b/src/components/ui/Dropdowns/NotificationDropdown/NotificationDropdown.tsx
@@ -144,7 +144,7 @@ export const MainItemInfo = styled.div`
margin-right: 8px;
}
`;
-export const ItemReplicaBadge = styled.div`
+export const ItemTransferBadge = styled.div`
background: "white";
color: #7f8795;
font-size: 9px;
@@ -274,11 +274,16 @@ class NotificationDropdown extends React.Component {
const list = (