WizardSummary.tsx 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  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 '@src/components/ui/StatusComponents/StatusPill'
  19. import { ThemePalette, ThemeProps } from '@src/components/Theme'
  20. import LabelDictionary from '@src/utils/LabelDictionary'
  21. import DateUtils from '@src/utils/DateUtils'
  22. import { migrationFields } from '@src/constants'
  23. import type { Schedule } from '@src/@types/Schedule'
  24. import type { WizardData } from '@src/@types/WizardData'
  25. import type { StorageMap, StorageBackend } from '@src/@types/Endpoint'
  26. import type { Instance, Disk, InstanceScript } from '@src/@types/Instance'
  27. import type { Field } from '@src/@types/Field'
  28. import fieldHelper from '@src/@types/Field'
  29. import { getDisks } from '@src/components/modules/WizardModule/WizardStorage'
  30. import { INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS } from '@src/components/modules/WizardModule/WizardOptions'
  31. import { MinionPool } from '@src/@types/MinionPool'
  32. import { ProviderTypes } from '@src/@types/Providers'
  33. import configLoader from '@src/utils/Config'
  34. import networkArrowImage from './images/network-arrow.svg'
  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(
  304. propertyName,
  305. value,
  306. schema,
  307. provider,
  308. )
  309. }
  310. return (
  311. <Option key={propertyName}>
  312. <OptionLabel title={propertyName}>
  313. {LabelDictionary.get(propertyName)}
  314. </OptionLabel>
  315. <OptionValue title={options[key][propertyName]}>
  316. {optionValue}
  317. </OptionValue>
  318. </Option>
  319. )
  320. })}
  321. </ObjectTable>
  322. ) : null))
  323. }
  324. renderMinionPoolMapping() {
  325. const allMappings = this.props.data.destOptions?.[INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS]
  326. if (!allMappings) {
  327. return null
  328. }
  329. const mappings: any = {}
  330. Object.keys(allMappings).forEach(map => {
  331. if (allMappings[map]) {
  332. mappings[map] = allMappings[map]
  333. }
  334. })
  335. if (!Object.keys(mappings).length) {
  336. return null
  337. }
  338. const getMinionPoolName = (id: string) => {
  339. const minionPool = this.props.minionPools.find(m => m.id === id)
  340. return minionPool?.name || id
  341. }
  342. return (
  343. <ObjectTable>
  344. <ObjectTableTitle>
  345. Instance OSMorphing Minion Pool Mappings
  346. </ObjectTableTitle>
  347. {Object.keys(mappings).map(instanceId => {
  348. const instanceName = this.props.instancesDetails
  349. .find(i => i.instance_name === instanceId || i.id === instanceId)?.name || instanceId
  350. return (
  351. <Option key={instanceId}>
  352. <OptionLabel title={instanceName}>
  353. {instanceName}
  354. </OptionLabel>
  355. <OptionValue title={mappings[instanceId]}>
  356. {getMinionPoolName(mappings[instanceId])}
  357. </OptionValue>
  358. </Option>
  359. )
  360. })}
  361. </ObjectTable>
  362. )
  363. }
  364. renderTargetOptionsSection() {
  365. const data = this.props.data
  366. const provider = data?.target?.type
  367. const type = this.props.wizardType.charAt(0).toUpperCase() + this.props.wizardType.substr(1)
  368. const executeNowOption = (
  369. <Option>
  370. <OptionLabel>Execute now?</OptionLabel>
  371. <OptionValue>{this.getDefaultBooleanOption('execute_now', true) ? 'Yes' : 'No'}</OptionValue>
  372. </Option>
  373. )
  374. const separateVmOption = (
  375. <Option>
  376. <OptionLabel>Separate {type}/VM?</OptionLabel>
  377. <OptionValue>{this.getDefaultBooleanOption('separate_vm', true) ? 'Yes' : 'No'}</OptionValue>
  378. </Option>
  379. )
  380. const migrationOptions = [
  381. (
  382. <Option>
  383. <OptionLabel>Shutdown Instances</OptionLabel>
  384. <OptionValue>{this.getDefaultBooleanOption('shutdown_instances', false) ? 'Yes' : 'No'}</OptionValue>
  385. </Option>
  386. ),
  387. (
  388. <Option>
  389. <OptionLabel>Replication Count</OptionLabel>
  390. <OptionValue>
  391. {(this.props.data.destOptions && this.props.data.destOptions.replication_count) || 2}
  392. </OptionValue>
  393. </Option>
  394. ),
  395. ]
  396. const renderDefaultStorageOption = () => (
  397. <Option>
  398. <OptionLabel>Default Storage</OptionLabel>
  399. <OptionValue>{this.props.defaultStorage!.value}{this.props.defaultStorage!.busType ? (
  400. <>
  401. <br />
  402. Bus Type: {this.props.defaultStorage!.busType}
  403. </>
  404. ) : null}
  405. </OptionValue>
  406. </Option>
  407. )
  408. return (
  409. <Section>
  410. <SectionTitle>{type} Target Options</SectionTitle>
  411. <OptionsList>
  412. {this.props.wizardType === 'replica' ? executeNowOption : null}
  413. {this.props.wizardType === 'migration' ? migrationOptions : null}
  414. {this.props.data.selectedInstances
  415. && this.props.data.selectedInstances.length > 1 ? separateVmOption : null}
  416. {this.props.defaultStorage ? renderDefaultStorageOption() : null}
  417. {data.destOptions ? Object.keys(data.destOptions).map(optionName => {
  418. if (
  419. optionName === 'execute_now'
  420. || optionName === 'separate_vm'
  421. || migrationFields.find(f => f.name === optionName)
  422. || !data.destOptions || data.destOptions[optionName] == null || data.destOptions[optionName] === ''
  423. || typeof data.destOptions[optionName] === 'object'
  424. ) {
  425. return null
  426. }
  427. const optionLabel = optionName.split('/')
  428. .map(n => LabelDictionary.get(n, `${data.target ? data.target.type : ''}-destination`)).join(' - ')
  429. const optionValue = fieldHelper.getValueAlias(
  430. optionName,
  431. data.destOptions && data.destOptions[optionName],
  432. this.props.destinationSchema,
  433. provider,
  434. )
  435. return (
  436. <Option key={optionName}>
  437. <OptionLabel data-test-id={`wSummary-optionLabel-${optionName}`} title={optionLabel}>
  438. {optionLabel}
  439. </OptionLabel>
  440. <OptionValue data-test-id={`wSummary-optionValue-${optionName}`} title={optionValue}>
  441. {optionValue}
  442. </OptionValue>
  443. </Option>
  444. )
  445. }) : null}
  446. {this.renderMinionPoolMapping()}
  447. {this.renderObjectTable(data.destOptions, this.props.destinationSchema, provider)}
  448. </OptionsList>
  449. </Section>
  450. )
  451. }
  452. renderStorageSection(type: 'backend' | 'disk') {
  453. const storageMap = this.props.storageMap.filter(mapping => mapping.type === type)
  454. const disks = getDisks(this.props.instancesDetails, type)
  455. if (disks.length === 0 || storageMap.length === 0) {
  456. return null
  457. }
  458. const fieldName = type === 'backend' ? 'storage_backend_identifier' : 'id'
  459. let fullStorageMap: { source: Disk, target: StorageBackend | null, busType?: string | null }[] = disks
  460. .filter(d => d[fieldName]).map(disk => {
  461. const diskMapped = storageMap.find(s => s.source[fieldName] === disk[fieldName])
  462. if (diskMapped) {
  463. return { source: diskMapped.source, target: diskMapped.target, busType: diskMapped.targetBusType }
  464. }
  465. return { source: disk, target: null }
  466. })
  467. fullStorageMap.sort((m1, m2) => String(m1.source[fieldName])
  468. .localeCompare(String(m2.source[fieldName])))
  469. fullStorageMap = fullStorageMap.filter(fsm => fsm.target && fsm.target.id)
  470. const title = type === 'backend' ? 'Storage Backend Mapping' : 'Disk Mapping'
  471. if (fullStorageMap.length === 0) {
  472. return null
  473. }
  474. return (
  475. <Section>
  476. <SectionTitle>{title}</SectionTitle>
  477. <Table>
  478. {fullStorageMap.filter(m => m.target).map(mapping => (
  479. <Row
  480. key={`${type}-${mapping.source[fieldName] || ''}-${mapping.target ? mapping.target.name : ''}`}
  481. direction="row"
  482. >
  483. <SourceNetwork>{mapping.source[fieldName]}</SourceNetwork>
  484. <NetworkArrow />
  485. <TargetNetwork>
  486. <TargetNetworkName>{mapping.target ? mapping.target.name : 'Default'}</TargetNetworkName>
  487. {mapping.busType ? (
  488. <TargetNetworkName>Bus Type: {mapping.busType}</TargetNetworkName>
  489. ) : null}
  490. </TargetNetwork>
  491. </Row>
  492. ))}
  493. </Table>
  494. </Section>
  495. )
  496. }
  497. renderNetworksSection() {
  498. const data = this.props.data
  499. if (data.networks == null) {
  500. return null
  501. }
  502. return (
  503. <Section>
  504. <SectionTitle>Networks</SectionTitle>
  505. <Table>
  506. {data.networks.map(mapping => (
  507. <Row key={mapping.sourceNic.network_name} direction="row">
  508. <SourceNetwork data-test-id="wSummary-networkSource">{mapping.sourceNic.network_name}</SourceNetwork>
  509. <NetworkArrow />
  510. <TargetNetwork>
  511. <TargetNetworkName data-test-id="wSummary-networkTarget">{mapping.targetNetwork!.name}</TargetNetworkName>
  512. {mapping.targetSecurityGroups?.length ? (
  513. <TargetNetworkName>Security Groups: {mapping.targetSecurityGroups.map(s => (typeof s === 'string' ? s : s.name)).join(', ')}</TargetNetworkName>
  514. ) : null}
  515. {mapping.targetPortKey ? (
  516. <TargetNetworkName>Port Key: {mapping.targetPortKey}</TargetNetworkName>
  517. ) : null}
  518. </TargetNetwork>
  519. </Row>
  520. ))}
  521. </Table>
  522. </Section>
  523. )
  524. }
  525. renderInstancesSection() {
  526. const data = this.props.data
  527. return (
  528. <Section>
  529. <SectionTitle>Instances</SectionTitle>
  530. <Table>
  531. {data.selectedInstances ? data.selectedInstances.map(instance => {
  532. const flavorName = instance.flavor_name ? `/${instance.flavor_name}` : ''
  533. return (
  534. <Row key={instance.id}>
  535. <InstanceRowTitle>{instance.name}</InstanceRowTitle>
  536. <InstanceRowSubtitle>{instance.instance_name || instance.id}</InstanceRowSubtitle>
  537. <InstanceRowSubtitle>{`${instance.num_cpu}vCPU/${instance.memory_mb}MB${flavorName}`}</InstanceRowSubtitle>
  538. </Row>
  539. )
  540. }) : null}
  541. </Table>
  542. </Section>
  543. )
  544. }
  545. renderUserScripts() {
  546. if (this.props.uploadedUserScripts.length === 0) {
  547. return null
  548. }
  549. return (
  550. <Section>
  551. <SectionTitle>Uploaded User Scripts</SectionTitle>
  552. <Table>
  553. {this.props.uploadedUserScripts.map(s => (
  554. <Row
  555. key={s.instanceId || s.global || undefined}
  556. style={{
  557. flexDirection: 'row',
  558. justifyContent: 'space-between',
  559. flexShrink: 0,
  560. alignItems: 'center',
  561. }}
  562. >
  563. <InstanceRowTitle>{
  564. s.global ? s.global === 'windows' ? 'Global Windows Script' : 'Global Linux Script' : s.instanceId
  565. }
  566. </InstanceRowTitle>
  567. <ScriptFileName title={s.fileName}>{s.fileName}</ScriptFileName>
  568. </Row>
  569. ))}
  570. </Table>
  571. </Section>
  572. )
  573. }
  574. renderOverviewSection() {
  575. const data = this.props.data
  576. const type = this.props.wizardType.charAt(0).toUpperCase() + this.props.wizardType.substr(1)
  577. return (
  578. <Section>
  579. <SectionTitle>Overview</SectionTitle>
  580. <Overview>
  581. <OverviewRow>
  582. <OverviewLabel>Source</OverviewLabel>
  583. <OverviewRowData>
  584. <StatusPill
  585. secondary
  586. small
  587. label={configLoader.config.providerNames[data.source!.type]}
  588. data-test-id="wSummary-sourcePill"
  589. />
  590. <OverviewRowLabel data-test-id="wSummary-source">{data.source ? data.source.name : ''}</OverviewRowLabel>
  591. </OverviewRowData>
  592. </OverviewRow>
  593. <OverviewRow>
  594. <OverviewLabel>Target</OverviewLabel>
  595. <OverviewRowData>
  596. <StatusPill
  597. secondary
  598. small
  599. label={configLoader.config.providerNames[data.target!.type]}
  600. data-test-id="wSummary-targetPill"
  601. />
  602. <OverviewRowLabel data-test-id="wSummary-target">{data.target && data.target.name}</OverviewRowLabel>
  603. </OverviewRowData>
  604. </OverviewRow>
  605. <OverviewRow>
  606. <OverviewLabel>Type</OverviewLabel>
  607. <OverviewRowData>
  608. <StatusPill
  609. alert={type === 'Replica'}
  610. small
  611. label={this.props.wizardType.toUpperCase()}
  612. data-test-id="wSummary-typePill"
  613. />
  614. <OverviewRowLabel>Coriolis {type}</OverviewRowLabel>
  615. </OverviewRowData>
  616. </OverviewRow>
  617. </Overview>
  618. </Section>
  619. )
  620. }
  621. render() {
  622. return (
  623. <Wrapper>
  624. <Column>
  625. {this.renderOverviewSection()}
  626. {this.renderInstancesSection()}
  627. {this.renderNetworksSection()}
  628. {this.renderUserScripts()}
  629. </Column>
  630. <Column>
  631. {this.renderSourceOptionsSection()}
  632. {this.renderTargetOptionsSection()}
  633. {this.renderStorageSection('backend')}
  634. {this.renderStorageSection('disk')}
  635. {this.renderScheduleSection()}
  636. </Column>
  637. </Wrapper>
  638. )
  639. }
  640. }
  641. export default WizardSummary