|
|
@@ -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 ReplicaDeploymentOptions from "@src/components/modules/TransferModule/ReplicaDeploymentOptions";
|
|
|
+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";
|
|
|
@@ -35,7 +35,7 @@ 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";
|
|
|
@@ -62,9 +62,9 @@ type State = {
|
|
|
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;
|
|
|
@@ -74,14 +74,14 @@ type State = {
|
|
|
executing: boolean;
|
|
|
};
|
|
|
@observer
|
|
|
-class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
+class TransferDetailsPage extends React.Component<Props, State> {
|
|
|
state: State = {
|
|
|
showOptionsModal: false,
|
|
|
showDeploymentModal: false,
|
|
|
showEditModal: false,
|
|
|
showDeleteExecutionConfirmation: false,
|
|
|
- showDeleteReplicaConfirmation: false,
|
|
|
- showDeleteReplicaDisksConfirmation: false,
|
|
|
+ showDeleteTransferConfirmation: false,
|
|
|
+ showDeleteTransferDisksConfirmation: false,
|
|
|
confirmationItem: null,
|
|
|
showCancelConfirmation: false,
|
|
|
showForceCancelConfirmation: false,
|
|
|
@@ -98,21 +98,21 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
componentDidMount() {
|
|
|
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;
|
|
|
@@ -133,8 +133,8 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
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,
|
|
|
@@ -148,8 +148,8 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
...getOptionsValuesConfig,
|
|
|
envData:
|
|
|
optionsType === "source"
|
|
|
- ? this.replica!.source_environment
|
|
|
- : this.replica!.destination_environment,
|
|
|
+ ? this.transfer!.source_environment
|
|
|
+ : this.transfer!.destination_environment,
|
|
|
});
|
|
|
};
|
|
|
|
|
|
@@ -161,45 +161,45 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- 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 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;
|
|
|
}
|
|
|
@@ -208,36 +208,36 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
return this.getLastExecution()?.status;
|
|
|
}
|
|
|
|
|
|
- getReplicaItemType(): string {
|
|
|
+ getTransferItemType(): string {
|
|
|
let item_type = "replica";
|
|
|
- let scenario = this.replica?.scenario;
|
|
|
+ let scenario = this.transfer?.scenario;
|
|
|
if (scenario && scenario === "live_migration") {
|
|
|
item_type = "migration";
|
|
|
}
|
|
|
return item_type;
|
|
|
}
|
|
|
|
|
|
- getReplicaTypePillShouldRed(): bool {
|
|
|
+ getTransferTypePillShouldRed(): bool {
|
|
|
let should_red = true;
|
|
|
- let scenario = this.replica?.scenario;
|
|
|
+ let scenario = this.transfer?.scenario;
|
|
|
if (scenario && scenario === "live_migration") {
|
|
|
should_red = false;
|
|
|
}
|
|
|
return should_red;
|
|
|
}
|
|
|
|
|
|
- getReplicaScenarioTypeImage(): string {
|
|
|
+ getTransferScenarioTypeImage(): string {
|
|
|
let image = replicaImage;
|
|
|
- let scenario = this.replica?.scenario;
|
|
|
+ let scenario = this.transfer?.scenario;
|
|
|
if (scenario && scenario === "live_migration") {
|
|
|
image = liveMigrationImage;
|
|
|
}
|
|
|
return image;
|
|
|
}
|
|
|
|
|
|
- async loadIsEditable(replicaDetails: ReplicaItemDetails) {
|
|
|
- const targetEndpointId = replicaDetails.destination_endpoint_id;
|
|
|
- const sourceEndpointId = replicaDetails.origin_endpoint_id;
|
|
|
+ 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
|
|
|
@@ -263,18 +263,18 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
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) {
|
|
|
@@ -284,11 +284,11 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
|
|
|
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,
|
|
|
@@ -296,7 +296,7 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
);
|
|
|
|
|
|
const targetEndpoint = endpointStore.endpoints.find(
|
|
|
- e => e.id === replica.destination_endpoint_id
|
|
|
+ e => e.id === transfer.destination_endpoint_id
|
|
|
);
|
|
|
|
|
|
const hasStorageMap = targetEndpoint
|
|
|
@@ -308,32 +308,32 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
: 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();
|
|
|
|
|
|
@@ -364,11 +364,11 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
}
|
|
|
|
|
|
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();
|
|
|
}
|
|
|
|
|
|
@@ -386,43 +386,43 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- 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("/transfers");
|
|
|
- replicaStore.delete(replica.id);
|
|
|
+ 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(`/transfers/${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 });
|
|
|
}
|
|
|
|
|
|
handleCloseDeploymentModal() {
|
|
|
@@ -433,12 +433,12 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
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(
|
|
|
@@ -453,7 +453,7 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
|
|
|
if (scheduleId) {
|
|
|
scheduleStore.updateSchedule({
|
|
|
- replicaId: this.replicaId,
|
|
|
+ transferId: this.transferId,
|
|
|
scheduleId,
|
|
|
data,
|
|
|
oldData,
|
|
|
@@ -466,7 +466,7 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
handleScheduleSave(schedule: Schedule) {
|
|
|
if (schedule.id) {
|
|
|
scheduleStore.updateSchedule({
|
|
|
- replicaId: this.replicaId,
|
|
|
+ transferId: this.transferId,
|
|
|
scheduleId: schedule.id,
|
|
|
data: schedule,
|
|
|
oldData: schedule,
|
|
|
@@ -478,7 +478,7 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
|
|
|
handleScheduleRemove(scheduleId: string | null) {
|
|
|
if (scheduleId) {
|
|
|
- scheduleStore.removeSchedule(this.replicaId, scheduleId);
|
|
|
+ scheduleStore.removeSchedule(this.transferId, scheduleId);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -505,12 +505,12 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
}
|
|
|
|
|
|
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,
|
|
|
});
|
|
|
@@ -525,8 +525,8 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
removedUserScripts: InstanceScript[];
|
|
|
minionPoolMappings: { [instance: string]: string };
|
|
|
}) {
|
|
|
- const replica = this.replica;
|
|
|
- if (!replica) {
|
|
|
+ const transfer = this.transfer;
|
|
|
+ if (!transfer) {
|
|
|
return;
|
|
|
}
|
|
|
this.setState({ deploying: true });
|
|
|
@@ -537,12 +537,12 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
minionPoolMappings,
|
|
|
} = opts;
|
|
|
try {
|
|
|
- const deployment = await deploymentStore.deployReplica({
|
|
|
- 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(`/deployments/${deployment.id}/tasks/`);
|
|
|
@@ -551,17 +551,17 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- async executeReplica(fields: Field[]) {
|
|
|
- const replica = this.replica;
|
|
|
- if (!replica) {
|
|
|
+ async executeTransfer(fields: Field[]) {
|
|
|
+ const transfer = this.transfer;
|
|
|
+ if (!transfer) {
|
|
|
return;
|
|
|
}
|
|
|
this.setState({ executing: true });
|
|
|
try {
|
|
|
- await replicaStore.execute(replica.id, fields);
|
|
|
+ await transferStore.execute(transfer.id, fields);
|
|
|
|
|
|
this.handleCloseOptionsModal();
|
|
|
- this.props.history.push(`/transfers/${replica.id}/executions`);
|
|
|
+ this.props.history.push(`/transfers/${transfer.id}/executions`);
|
|
|
} finally {
|
|
|
this.setState({ executing: false });
|
|
|
}
|
|
|
@@ -578,14 +578,14 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
}
|
|
|
|
|
|
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,
|
|
|
});
|
|
|
}
|
|
|
@@ -603,8 +603,8 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- handleEditReplicaReload() {
|
|
|
- this.loadReplicaWithInstances({ cache: false });
|
|
|
+ handleEditTransferReload() {
|
|
|
+ this.loadTransferWithInstances({ cache: false });
|
|
|
}
|
|
|
|
|
|
handleUpdateComplete(redirectTo: string) {
|
|
|
@@ -613,26 +613,26 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
}
|
|
|
|
|
|
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) {
|
|
|
@@ -642,7 +642,7 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
return (
|
|
|
<TransferItemModal
|
|
|
isOpen
|
|
|
- type="replica"
|
|
|
+ type="transfer"
|
|
|
sourceEndpoint={sourceEndpoint}
|
|
|
onUpdateComplete={url => {
|
|
|
this.handleUpdateComplete(url);
|
|
|
@@ -650,14 +650,14 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
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();
|
|
|
}}
|
|
|
/>
|
|
|
);
|
|
|
@@ -704,7 +704,7 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
label: "Edit",
|
|
|
title: editTitle,
|
|
|
action: () => {
|
|
|
- this.handleReplicaEditClick();
|
|
|
+ this.handleTransferEditClick();
|
|
|
},
|
|
|
disabled: !this.state.isEditable,
|
|
|
loading: this.state.isEditableLoading,
|
|
|
@@ -712,18 +712,18 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
{
|
|
|
label: "Delete Disks",
|
|
|
action: () => {
|
|
|
- this.handleDeleteReplicaDisksClick();
|
|
|
+ this.handleDeleteTransferDisksClick();
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
label: "Delete",
|
|
|
color: ThemePalette.alert,
|
|
|
action: () => {
|
|
|
- this.handleDeleteReplicaClick();
|
|
|
+ this.handleDeleteTransferClick();
|
|
|
},
|
|
|
},
|
|
|
];
|
|
|
- const replica = this.replica;
|
|
|
+ const transfer = this.transfer;
|
|
|
|
|
|
return (
|
|
|
<Wrapper>
|
|
|
@@ -738,21 +738,21 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
}
|
|
|
contentHeaderComponent={
|
|
|
<DetailsContentHeader
|
|
|
- statusPill={replica?.last_execution_status}
|
|
|
- itemTitle={getTransferItemTitle(this.replica)}
|
|
|
- itemType={this.getReplicaItemType()}
|
|
|
- itemDescription={replica?.description}
|
|
|
+ statusPill={transfer?.last_execution_status}
|
|
|
+ itemTitle={getTransferItemTitle(this.transfer)}
|
|
|
+ itemType={this.getTransferItemType()}
|
|
|
+ itemDescription={transfer?.description}
|
|
|
dropdownActions={dropdownActions}
|
|
|
backLink="/transfers"
|
|
|
- typeImage={this.getReplicaScenarioTypeImage()}
|
|
|
- alertInfoPill={this.getReplicaTypePillShouldRed()}
|
|
|
- primaryInfoPill={!this.getReplicaTypePillShouldRed()}
|
|
|
+ typeImage={this.getTransferScenarioTypeImage()}
|
|
|
+ alertInfoPill={this.getTransferTypePillShouldRed()}
|
|
|
+ primaryInfoPill={!this.getTransferTypePillShouldRed()}
|
|
|
/>
|
|
|
}
|
|
|
contentComponent={
|
|
|
- <ReplicaDetailsContent
|
|
|
- item={replica}
|
|
|
- itemId={this.replicaId}
|
|
|
+ <TransferDetailsContent
|
|
|
+ item={transfer}
|
|
|
+ itemId={this.transferId}
|
|
|
instancesDetails={instanceStore.instancesDetails}
|
|
|
instancesDetailsLoading={
|
|
|
instanceStore.loadingInstancesDetails ||
|
|
|
@@ -765,7 +765,7 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
networks={networkStore.networks}
|
|
|
minionPools={minionPoolStore.minionPools}
|
|
|
detailsLoading={
|
|
|
- replicaStore.replicaDetailsLoading ||
|
|
|
+ transferStore.transferDetailsLoading ||
|
|
|
endpointStore.loading ||
|
|
|
minionPoolStore.loadingMinionPools ||
|
|
|
this.state.initialLoading
|
|
|
@@ -783,19 +783,19 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
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);
|
|
|
@@ -809,8 +809,8 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
onCreateDeploymentClick={() => {
|
|
|
this.handleCreateDeploymentClick();
|
|
|
}}
|
|
|
- onDeleteReplicaClick={() => {
|
|
|
- this.handleDeleteReplicaClick();
|
|
|
+ onDeleteTransferClick={() => {
|
|
|
+ this.handleDeleteTransferClick();
|
|
|
}}
|
|
|
onAddScheduleClick={schedule => {
|
|
|
this.handleAddScheduleClick(schedule);
|
|
|
@@ -834,19 +834,19 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
this.handleCloseOptionsModal();
|
|
|
}}
|
|
|
>
|
|
|
- <ReplicaExecutionOptions
|
|
|
+ <TransferExecutionOptions
|
|
|
disableExecutionOptions={configLoader.config.providersDisabledExecuteOptions.some(
|
|
|
p =>
|
|
|
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}
|
|
|
/>
|
|
|
@@ -859,11 +859,11 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
this.handleCloseDeploymentModal();
|
|
|
}}
|
|
|
>
|
|
|
- <ReplicaDeploymentOptions
|
|
|
- transferItem={this.replica}
|
|
|
+ <DeploymentOptions
|
|
|
+ transferItem={this.transfer}
|
|
|
minionPools={minionPoolStore.minionPools.filter(
|
|
|
m =>
|
|
|
- m.endpoint_id === this.replica?.destination_endpoint_id &&
|
|
|
+ m.endpoint_id === this.transfer?.destination_endpoint_id &&
|
|
|
m.platform === "destination"
|
|
|
)}
|
|
|
loadingInstances={instanceStore.loadingInstancesDetails}
|
|
|
@@ -890,28 +890,28 @@ class ReplicaDetailsPage extends React.Component<Props, State> {
|
|
|
this.handleCloseExecutionConfirmation();
|
|
|
}}
|
|
|
/>
|
|
|
- {this.state.showDeleteReplicaConfirmation ? (
|
|
|
- <DeleteReplicaModal
|
|
|
- hasDisks={replicaStore.testReplicaHasDisks(this.replica)}
|
|
|
- onRequestClose={() => this.handleCloseDeleteReplicaConfirmation()}
|
|
|
- onDeleteReplica={() => {
|
|
|
- this.handleDeleteReplicaConfirmation();
|
|
|
+ {this.state.showDeleteTransferConfirmation ? (
|
|
|
+ <DeleteTransferModal
|
|
|
+ hasDisks={transferStore.testTransferHasDisks(this.transfer)}
|
|
|
+ onRequestClose={() => this.handleCloseDeleteTransferConfirmation()}
|
|
|
+ onDeleteTransfer={() => {
|
|
|
+ this.handleDeleteTransferConfirmation();
|
|
|
}}
|
|
|
onDeleteDisks={() => {
|
|
|
- this.handleDeleteReplicaDisksConfirmation();
|
|
|
+ this.handleDeleteTransferDisksConfirmation();
|
|
|
}}
|
|
|
/>
|
|
|
) : null}
|
|
|
<AlertModal
|
|
|
- isOpen={this.state.showDeleteReplicaDisksConfirmation}
|
|
|
+ isOpen={this.state.showDeleteTransferDisksConfirmation}
|
|
|
title="Delete Transferred Disks?"
|
|
|
message="Are you sure you want to delete this tranfer's disks?"
|
|
|
extraMessage="Deleting Coriolis Transfer Disks is permanent!"
|
|
|
onConfirmation={() => {
|
|
|
- this.handleDeleteReplicaDisksConfirmation();
|
|
|
+ this.handleDeleteTransferDisksConfirmation();
|
|
|
}}
|
|
|
onRequestClose={() => {
|
|
|
- this.handleCloseDeleteReplicaDisksConfirmation();
|
|
|
+ this.handleCloseDeleteTransferDisksConfirmation();
|
|
|
}}
|
|
|
/>
|
|
|
<AlertModal
|
|
|
@@ -941,10 +941,10 @@ Note that this may lead to scheduled cleanup tasks being forcibly skipped, and t
|
|
|
this.handleCloseCancelConfirmation();
|
|
|
}}
|
|
|
/>
|
|
|
- {this.renderEditReplica()}
|
|
|
+ {this.renderEditTransfer()}
|
|
|
</Wrapper>
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-export default ReplicaDetailsPage;
|
|
|
+export default TransferDetailsPage;
|