WizardSummary.tsx 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773
  1. /*
  2. Copyright (C) 2017 Cloudbase Solutions SRL
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. import { Info } from "luxon";
  15. import { observer } from "mobx-react";
  16. import React from "react";
  17. import styled from "styled-components";
  18. import fieldHelper from "@src/@types/Field";
  19. import { MinionPool } from "@src/@types/MinionPool";
  20. import { ProviderTypes } from "@src/@types/Providers";
  21. import { INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS } from "@src/components/modules/WizardModule/WizardOptions";
  22. import { getDisks } from "@src/components/modules/WizardModule/WizardStorage";
  23. import { ThemePalette, ThemeProps } from "@src/components/Theme";
  24. import StatusPill from "@src/components/ui/StatusComponents/StatusPill";
  25. import configLoader from "@src/utils/Config";
  26. import DateUtils from "@src/utils/DateUtils";
  27. import LabelDictionary from "@src/utils/LabelDictionary";
  28. import networkArrowImage from "./images/network-arrow.svg";
  29. import type { Schedule } from "@src/@types/Schedule";
  30. import type { WizardData } from "@src/@types/WizardData";
  31. import type { StorageMap, StorageBackend } from "@src/@types/Endpoint";
  32. import type { Instance, Disk, InstanceScript } from "@src/@types/Instance";
  33. import type { Field } from "@src/@types/Field";
  34. const Wrapper = styled.div`
  35. width: 100%;
  36. display: flex;
  37. justify-content: space-between;
  38. `;
  39. const Column = styled.div`
  40. ${ThemeProps.exactWidth("calc(50% - 80px)")}
  41. `;
  42. const Section = styled.div<any>`
  43. margin-bottom: 42px;
  44. &:last-child {
  45. margin-bottom: 0;
  46. }
  47. `;
  48. const SectionTitle = styled.div<any>`
  49. font-size: 24px;
  50. font-weight: ${ThemeProps.fontWeights.light};
  51. margin-bottom: 16px;
  52. `;
  53. const Overview = styled.div<any>``;
  54. const OverviewLabel = styled.div<any>`
  55. font-size: 10px;
  56. font-weight: ${ThemeProps.fontWeights.medium};
  57. text-transform: uppercase;
  58. color: ${ThemePalette.grayscale[5]};
  59. margin-bottom: 4px;
  60. `;
  61. const OverviewRow = styled.div<any>`
  62. margin-bottom: 32px;
  63. &:last-child {
  64. margin-bottom: 0;
  65. }
  66. `;
  67. const OverviewRowData = styled.div<any>`
  68. display: flex;
  69. `;
  70. const OverviewRowLabel = styled.div<any>`
  71. margin-left: 16px;
  72. white-space: nowrap;
  73. overflow: hidden;
  74. text-overflow: ellipsis;
  75. `;
  76. const Table = styled.div<any>``;
  77. const Row = styled.div<any>`
  78. display: flex;
  79. flex-direction: ${props => props.direction || "column"};
  80. padding: 8px 0;
  81. border-top: 1px solid ${ThemePalette.grayscale[1]};
  82. color: ${ThemePalette.grayscale[4]};
  83. &:last-child {
  84. border-bottom: 1px solid ${ThemePalette.grayscale[1]};
  85. }
  86. `;
  87. const ScriptFileName = styled.div<any>`
  88. max-width: 124px;
  89. text-overflow: ellipsis;
  90. overflow: hidden;
  91. margin-left: 16px;
  92. white-space: nowrap;
  93. flex-shrink: 0;
  94. `;
  95. const InstanceRowTitle = styled.div<any>`
  96. margin-bottom: 4px;
  97. `;
  98. const InstanceRowSubtitle = styled.div<any>`
  99. font-size: 10px;
  100. color: ${ThemePalette.grayscale[5]};
  101. margin-bottom: 4px;
  102. &:last-child {
  103. margin-bottom: 0;
  104. }
  105. `;
  106. const SourceNetwork = styled.div<any>`
  107. width: 50%;
  108. margin-right: 16px;
  109. overflow-wrap: break-word;
  110. `;
  111. const NetworkArrow = styled.div<any>`
  112. width: 32px;
  113. height: 16px;
  114. background: url("${networkArrowImage}") center no-repeat;
  115. `;
  116. const TargetNetwork = styled.div<any>`
  117. width: 50%;
  118. text-align: right;
  119. margin-left: 20px;
  120. display: flex;
  121. flex-direction: column;
  122. margin-top: -16px;
  123. `;
  124. const TargetNetworkName = styled.div<any>`
  125. width: 100%;
  126. text-overflow: ellipsis;
  127. overflow: hidden;
  128. margin-top: 8px;
  129. &:first-child {
  130. margin-top: 16px;
  131. }
  132. `;
  133. const OptionsList = styled.div<any>``;
  134. const Option = styled.div<any>`
  135. display: flex;
  136. margin-bottom: 8px;
  137. `;
  138. const OptionLabel = styled.div<any>`
  139. color: ${ThemePalette.grayscale[4]};
  140. ${ThemeProps.exactWidth("50%")}
  141. overflow: hidden;
  142. text-overflow: ellipsis;
  143. white-space: nowrap;
  144. `;
  145. const OptionValue = styled.div<any>`
  146. text-align: right;
  147. ${ThemeProps.exactWidth("50%")}
  148. text-overflow: ellipsis;
  149. overflow: hidden;
  150. `;
  151. const ObjectTable = styled.div`
  152. margin-top: 24px;
  153. `;
  154. const ObjectTableTitle = styled.div`
  155. margin-bottom: 8px;
  156. `;
  157. type Props = {
  158. data: WizardData;
  159. wizardType: "replica" | "migration";
  160. schedules: Schedule[];
  161. minionPools: MinionPool[];
  162. defaultStorage: { value: string | null; busType?: string | null } | undefined;
  163. storageMap: StorageMap[];
  164. instancesDetails: Instance[];
  165. sourceSchema: Field[];
  166. destinationSchema: Field[];
  167. uploadedUserScripts: InstanceScript[];
  168. };
  169. @observer
  170. class WizardSummary extends React.Component<Props> {
  171. getDefaultBooleanOption(fieldName: string, defaultValue: boolean): boolean {
  172. if (!this.props.data.destOptions) {
  173. return defaultValue;
  174. }
  175. if (this.props.data.destOptions[fieldName] != null) {
  176. return this.props.data.destOptions[fieldName];
  177. }
  178. return defaultValue;
  179. }
  180. renderScheduleLabel(schedule: Schedule) {
  181. const scheduleInfo = schedule.schedule;
  182. let monthLabel;
  183. if (!scheduleInfo) {
  184. return null;
  185. }
  186. if (scheduleInfo.month == null) {
  187. monthLabel = "Every month";
  188. } else {
  189. monthLabel = `Every ${
  190. Info.months()[scheduleInfo.month ? scheduleInfo.month - 1 : 0]
  191. }`;
  192. }
  193. let dayOfMonthLabel;
  194. if (scheduleInfo.dom == null) {
  195. dayOfMonthLabel = "every day";
  196. } else {
  197. dayOfMonthLabel = `every ${DateUtils.getOrdinalDay(scheduleInfo.dom)}`;
  198. }
  199. let dayOfWeekLabel;
  200. if (scheduleInfo.dow == null) {
  201. dayOfWeekLabel = "every weekday";
  202. } else {
  203. dayOfWeekLabel = `every ${Info.weekdays()[scheduleInfo.dow]}`;
  204. }
  205. const padNumber = (number: number) =>
  206. (number || 0) < 10 ? `0${number || 0}` : (number || 0).toString();
  207. let timeLabel;
  208. if (scheduleInfo.minute == null) {
  209. if (scheduleInfo.hour == null) {
  210. timeLabel = "every hour, every minute";
  211. } else {
  212. timeLabel = `at ${padNumber(
  213. scheduleInfo.hour
  214. )} o'clock, every minute UTC`;
  215. }
  216. } else if (scheduleInfo.hour == null) {
  217. timeLabel = `every hour, at minute ${padNumber(scheduleInfo.minute)} UTC`;
  218. } else {
  219. timeLabel = `at ${padNumber(scheduleInfo.hour)}:${padNumber(
  220. scheduleInfo.minute
  221. )} UTC`;
  222. }
  223. return `${monthLabel}, ${dayOfMonthLabel}, ${dayOfWeekLabel}, ${timeLabel}`;
  224. }
  225. renderScheduleSection() {
  226. const schedules = this.props.schedules;
  227. if (
  228. this.props.wizardType !== "replica" ||
  229. !schedules ||
  230. schedules.length === 0
  231. ) {
  232. return null;
  233. }
  234. return (
  235. <Section>
  236. <SectionTitle>Schedule</SectionTitle>
  237. <Table>
  238. {schedules.map(schedule => (
  239. <Row key={schedule.id} schedule>
  240. {this.renderScheduleLabel(schedule)}
  241. </Row>
  242. ))}
  243. </Table>
  244. </Section>
  245. );
  246. }
  247. renderSourceOptionsSection() {
  248. const data = this.props.data;
  249. const type =
  250. this.props.wizardType.charAt(0).toUpperCase() +
  251. this.props.wizardType.substr(1);
  252. const provider =
  253. this.props.data && this.props.data.source && this.props.data.source.type;
  254. if (!data.sourceOptions) {
  255. return null;
  256. }
  257. return (
  258. <Section>
  259. <SectionTitle>{type} Source Options</SectionTitle>
  260. <OptionsList>
  261. {data.sourceOptions
  262. ? Object.keys(data.sourceOptions).map(optionName => {
  263. if (
  264. !data.sourceOptions ||
  265. data.sourceOptions[optionName] == null ||
  266. data.sourceOptions[optionName] === "" ||
  267. typeof data.sourceOptions[optionName] === "object"
  268. ) {
  269. return null;
  270. }
  271. const optionLabel = optionName
  272. .split("/")
  273. .map(n =>
  274. LabelDictionary.get(
  275. n,
  276. `${data.source ? data.source.type : ""}-source`
  277. )
  278. )
  279. .join(" - ");
  280. const optionValue = fieldHelper.getValueAlias({
  281. name: optionName,
  282. value: data.sourceOptions?.[optionName],
  283. fields: this.props.sourceSchema,
  284. targetProvider: provider,
  285. });
  286. return (
  287. <Option key={optionName}>
  288. <OptionLabel title={optionLabel}>{optionLabel}</OptionLabel>
  289. <OptionValue title={optionValue}>{optionValue}</OptionValue>
  290. </Option>
  291. );
  292. })
  293. : null}
  294. {this.renderObjectTable(
  295. data.sourceOptions,
  296. this.props.sourceSchema,
  297. provider
  298. )}
  299. </OptionsList>
  300. </Section>
  301. );
  302. }
  303. renderObjectTable(
  304. options: any,
  305. schema: Field[],
  306. provider?: ProviderTypes | null
  307. ) {
  308. if (!options) {
  309. return null;
  310. }
  311. const objectKeys: string[] = Object.keys(options).filter(
  312. key =>
  313. typeof options[key] === "object" &&
  314. key !== INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS
  315. );
  316. return objectKeys.map(key =>
  317. options[key] != null ? (
  318. <ObjectTable key={key}>
  319. <ObjectTableTitle>{LabelDictionary.get(key)}</ObjectTableTitle>
  320. {Object.keys(options[key]).map(propertyName => {
  321. const value = options[key][propertyName];
  322. if (value == null || value === "") {
  323. return null;
  324. }
  325. let optionValue;
  326. if (
  327. key.indexOf("password") > -1 ||
  328. propertyName.indexOf("password") > -1
  329. ) {
  330. optionValue = "•••••••••";
  331. } else {
  332. optionValue = fieldHelper.getValueAlias({
  333. name: propertyName,
  334. value,
  335. fields: schema,
  336. targetProvider: provider,
  337. });
  338. }
  339. return (
  340. <Option key={propertyName}>
  341. <OptionLabel title={propertyName}>
  342. {LabelDictionary.get(propertyName)}
  343. </OptionLabel>
  344. <OptionValue title={options[key][propertyName]}>
  345. {optionValue}
  346. </OptionValue>
  347. </Option>
  348. );
  349. })}
  350. </ObjectTable>
  351. ) : null
  352. );
  353. }
  354. renderMinionPoolMapping() {
  355. const allMappings =
  356. this.props.data.destOptions?.[INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS];
  357. if (!allMappings) {
  358. return null;
  359. }
  360. const mappings: any = {};
  361. Object.keys(allMappings).forEach(map => {
  362. if (allMappings[map]) {
  363. mappings[map] = allMappings[map];
  364. }
  365. });
  366. if (!Object.keys(mappings).length) {
  367. return null;
  368. }
  369. const getMinionPoolName = (id: string) => {
  370. const minionPool = this.props.minionPools.find(m => m.id === id);
  371. return minionPool?.name || id;
  372. };
  373. return (
  374. <ObjectTable>
  375. <ObjectTableTitle>
  376. Instance OSMorphing Minion Pool Mappings
  377. </ObjectTableTitle>
  378. {Object.keys(mappings).map(instanceId => {
  379. const instanceName =
  380. this.props.instancesDetails.find(
  381. i => i.instance_name === instanceId || i.id === instanceId
  382. )?.name || instanceId;
  383. return (
  384. <Option key={instanceId}>
  385. <OptionLabel title={instanceName}>{instanceName}</OptionLabel>
  386. <OptionValue title={mappings[instanceId]}>
  387. {getMinionPoolName(mappings[instanceId])}
  388. </OptionValue>
  389. </Option>
  390. );
  391. })}
  392. </ObjectTable>
  393. );
  394. }
  395. renderTargetOptionsSection() {
  396. const data = this.props.data;
  397. const provider = data?.target?.type;
  398. const type =
  399. this.props.wizardType.charAt(0).toUpperCase() +
  400. this.props.wizardType.substr(1);
  401. const executeNowOption = (
  402. <Option>
  403. <OptionLabel>Execute now?</OptionLabel>
  404. <OptionValue>
  405. {this.getDefaultBooleanOption("execute_now", true) ? "Yes" : "No"}
  406. </OptionValue>
  407. </Option>
  408. );
  409. const separateVmOption = (
  410. <Option>
  411. <OptionLabel>Separate {type}/VM?</OptionLabel>
  412. <OptionValue>
  413. {this.getDefaultBooleanOption("separate_vm", true) ? "Yes" : "No"}
  414. </OptionValue>
  415. </Option>
  416. );
  417. const renderDefaultStorageOption = () => (
  418. <Option>
  419. <OptionLabel>Default Storage</OptionLabel>
  420. <OptionValue>
  421. {this.props.defaultStorage!.value}
  422. {this.props.defaultStorage!.busType ? (
  423. <>
  424. <br />
  425. Bus Type: {this.props.defaultStorage!.busType}
  426. </>
  427. ) : null}
  428. </OptionValue>
  429. </Option>
  430. );
  431. return (
  432. <Section>
  433. <SectionTitle>{type} Target Options</SectionTitle>
  434. <OptionsList>
  435. {this.props.wizardType === "replica" ? executeNowOption : null}
  436. {this.props.wizardType === "migration" ? executeNowOption : null}
  437. {this.props.data.selectedInstances &&
  438. this.props.data.selectedInstances.length > 1
  439. ? separateVmOption
  440. : null}
  441. {this.props.defaultStorage ? renderDefaultStorageOption() : null}
  442. {data.destOptions
  443. ? Object.keys(data.destOptions).map(optionName => {
  444. if (
  445. optionName === "execute_now" ||
  446. optionName === "separate_vm" ||
  447. !data.destOptions ||
  448. data.destOptions[optionName] == null ||
  449. data.destOptions[optionName] === "" ||
  450. typeof data.destOptions[optionName] === "object"
  451. ) {
  452. return null;
  453. }
  454. const optionLabel = optionName
  455. .split("/")
  456. .map(n =>
  457. LabelDictionary.get(
  458. n,
  459. `${data.target ? data.target.type : ""}-destination`
  460. )
  461. )
  462. .join(" - ");
  463. const optionValue = fieldHelper.getValueAlias({
  464. name: optionName,
  465. value: data.destOptions?.[optionName],
  466. fields: this.props.destinationSchema,
  467. targetProvider: provider,
  468. });
  469. return (
  470. <Option key={optionName}>
  471. <OptionLabel title={optionLabel}>{optionLabel}</OptionLabel>
  472. <OptionValue title={optionValue}>{optionValue}</OptionValue>
  473. </Option>
  474. );
  475. })
  476. : null}
  477. {this.renderMinionPoolMapping()}
  478. {this.renderObjectTable(
  479. data.destOptions,
  480. this.props.destinationSchema,
  481. provider
  482. )}
  483. </OptionsList>
  484. </Section>
  485. );
  486. }
  487. renderStorageSection(type: "backend" | "disk") {
  488. const storageMap = this.props.storageMap.filter(
  489. mapping => mapping.type === type
  490. );
  491. const disks = getDisks(this.props.instancesDetails, type);
  492. if (disks.length === 0 || storageMap.length === 0) {
  493. return null;
  494. }
  495. const fieldName = type === "backend" ? "storage_backend_identifier" : "id";
  496. let fullStorageMap: {
  497. source: Disk;
  498. target: StorageBackend | null;
  499. busType?: string | null;
  500. }[] = disks
  501. .filter(d => d[fieldName])
  502. .map(disk => {
  503. const diskMapped = storageMap.find(
  504. s => s.source[fieldName] === disk[fieldName]
  505. );
  506. if (diskMapped) {
  507. return {
  508. source: diskMapped.source,
  509. target: diskMapped.target,
  510. busType: diskMapped.targetBusType,
  511. };
  512. }
  513. return { source: disk, target: null };
  514. });
  515. fullStorageMap.sort((m1, m2) =>
  516. String(m1.source[fieldName]).localeCompare(String(m2.source[fieldName]))
  517. );
  518. fullStorageMap = fullStorageMap.filter(fsm => fsm.target && fsm.target.id);
  519. const title =
  520. type === "backend" ? "Storage Backend Mapping" : "Disk Mapping";
  521. if (fullStorageMap.length === 0) {
  522. return null;
  523. }
  524. return (
  525. <Section>
  526. <SectionTitle>{title}</SectionTitle>
  527. <Table>
  528. {fullStorageMap
  529. .filter(m => m.target)
  530. .map(mapping => (
  531. <Row
  532. key={`${type}-${mapping.source[fieldName] || ""}-${
  533. mapping.target ? mapping.target.name : ""
  534. }`}
  535. direction="row"
  536. >
  537. <SourceNetwork>{mapping.source[fieldName]}</SourceNetwork>
  538. <NetworkArrow />
  539. <TargetNetwork>
  540. <TargetNetworkName>
  541. {mapping.target ? mapping.target.name : "Default"}
  542. </TargetNetworkName>
  543. {mapping.busType ? (
  544. <TargetNetworkName>
  545. Bus Type: {mapping.busType}
  546. </TargetNetworkName>
  547. ) : null}
  548. </TargetNetwork>
  549. </Row>
  550. ))}
  551. </Table>
  552. </Section>
  553. );
  554. }
  555. renderNetworksSection() {
  556. const data = this.props.data;
  557. if (data.networks == null) {
  558. return null;
  559. }
  560. return (
  561. <Section>
  562. <SectionTitle>Networks</SectionTitle>
  563. <Table>
  564. {data.networks.map(mapping => (
  565. <Row key={mapping.sourceNic.network_name} direction="row">
  566. <SourceNetwork>{mapping.sourceNic.network_name}</SourceNetwork>
  567. <NetworkArrow />
  568. <TargetNetwork>
  569. <TargetNetworkName>
  570. {mapping.targetNetwork!.name}
  571. </TargetNetworkName>
  572. {mapping.targetSecurityGroups?.length ? (
  573. <TargetNetworkName>
  574. Security Groups:{" "}
  575. {mapping.targetSecurityGroups
  576. .map(s => (typeof s === "string" ? s : s.name))
  577. .join(", ")}
  578. </TargetNetworkName>
  579. ) : null}
  580. {mapping.targetPortKey ? (
  581. <TargetNetworkName>
  582. Port Key: {mapping.targetPortKey}
  583. </TargetNetworkName>
  584. ) : null}
  585. </TargetNetwork>
  586. </Row>
  587. ))}
  588. </Table>
  589. </Section>
  590. );
  591. }
  592. renderInstancesSection() {
  593. const data = this.props.data;
  594. return (
  595. <Section>
  596. <SectionTitle>Instances</SectionTitle>
  597. <Table>
  598. {data.selectedInstances
  599. ? data.selectedInstances.map(instance => {
  600. const flavorName = instance.flavor_name
  601. ? `/${instance.flavor_name}`
  602. : "";
  603. return (
  604. <Row key={instance.id}>
  605. <InstanceRowTitle>{instance.name}</InstanceRowTitle>
  606. <InstanceRowSubtitle>
  607. {instance.instance_name || instance.id}
  608. </InstanceRowSubtitle>
  609. <InstanceRowSubtitle>{`${instance.num_cpu}vCPU/${instance.memory_mb}MB${flavorName}`}</InstanceRowSubtitle>
  610. </Row>
  611. );
  612. })
  613. : null}
  614. </Table>
  615. </Section>
  616. );
  617. }
  618. renderUserScripts() {
  619. if (this.props.uploadedUserScripts.length === 0) {
  620. return null;
  621. }
  622. return (
  623. <Section>
  624. <SectionTitle>Uploaded User Scripts</SectionTitle>
  625. <Table>
  626. {this.props.uploadedUserScripts.map(s => (
  627. <Row
  628. key={s.instanceId || s.global || undefined}
  629. style={{
  630. flexDirection: "row",
  631. justifyContent: "space-between",
  632. flexShrink: 0,
  633. alignItems: "center",
  634. }}
  635. >
  636. <InstanceRowTitle>
  637. {s.global
  638. ? s.global === "windows"
  639. ? "Global Windows Script"
  640. : "Global Linux Script"
  641. : s.instanceId}
  642. </InstanceRowTitle>
  643. <ScriptFileName title={s.fileName}>{s.fileName}</ScriptFileName>
  644. </Row>
  645. ))}
  646. </Table>
  647. </Section>
  648. );
  649. }
  650. renderOverviewSection() {
  651. const data = this.props.data;
  652. const type =
  653. this.props.wizardType.charAt(0).toUpperCase() +
  654. this.props.wizardType.substr(1);
  655. return (
  656. <Section>
  657. <SectionTitle>Overview</SectionTitle>
  658. <Overview>
  659. <OverviewRow>
  660. <OverviewLabel>Source</OverviewLabel>
  661. <OverviewRowData>
  662. <StatusPill
  663. secondary
  664. small
  665. label={configLoader.config.providerNames[data.source!.type]}
  666. />
  667. <OverviewRowLabel>
  668. {data.source ? data.source.name : ""}
  669. </OverviewRowLabel>
  670. </OverviewRowData>
  671. </OverviewRow>
  672. <OverviewRow>
  673. <OverviewLabel>Target</OverviewLabel>
  674. <OverviewRowData>
  675. <StatusPill
  676. secondary
  677. small
  678. label={configLoader.config.providerNames[data.target!.type]}
  679. />
  680. <OverviewRowLabel>
  681. {data.target && data.target.name}
  682. </OverviewRowLabel>
  683. </OverviewRowData>
  684. </OverviewRow>
  685. <OverviewRow>
  686. <OverviewLabel>Type</OverviewLabel>
  687. <OverviewRowData>
  688. <StatusPill
  689. alert={type === "Replica"}
  690. small
  691. label={this.props.wizardType.toUpperCase()}
  692. />
  693. <OverviewRowLabel>Coriolis {type}</OverviewRowLabel>
  694. </OverviewRowData>
  695. </OverviewRow>
  696. </Overview>
  697. </Section>
  698. );
  699. }
  700. render() {
  701. return (
  702. <Wrapper>
  703. <Column>
  704. {this.renderOverviewSection()}
  705. {this.renderInstancesSection()}
  706. {this.renderNetworksSection()}
  707. {this.renderUserScripts()}
  708. </Column>
  709. <Column>
  710. {this.renderSourceOptionsSection()}
  711. {this.renderTargetOptionsSection()}
  712. {this.renderStorageSection("backend")}
  713. {this.renderStorageSection("disk")}
  714. {this.renderScheduleSection()}
  715. </Column>
  716. </Wrapper>
  717. );
  718. }
  719. }
  720. export default WizardSummary;