WizardSummary.tsx 22 KB

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