|
@@ -74,6 +74,8 @@ class WizardPage extends React.Component<Props, State> {
|
|
|
|
|
|
|
|
contentRef!: WizardPageContent
|
|
contentRef!: WizardPageContent
|
|
|
|
|
|
|
|
|
|
+ title: string | undefined
|
|
|
|
|
+
|
|
|
UNSAFE_componentWillMount() {
|
|
UNSAFE_componentWillMount() {
|
|
|
this.initializeState(this.props.match)
|
|
this.initializeState(this.props.match)
|
|
|
this.handleResize()
|
|
this.handleResize()
|
|
@@ -127,6 +129,16 @@ class WizardPage extends React.Component<Props, State> {
|
|
|
.filter(p => p.id !== 'storage' || hasStorageMapping())
|
|
.filter(p => p.id !== 'storage' || hasStorageMapping())
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ setTransferItemTitle() {
|
|
|
|
|
+ const selectedInstance = wizardStore.data?.selectedInstances?.[0]
|
|
|
|
|
+ let title = selectedInstance?.name || selectedInstance?.instance_name || selectedInstance?.id
|
|
|
|
|
+ if (wizardStore.data?.selectedInstances && wizardStore.data.selectedInstances.length > 1) {
|
|
|
|
|
+ title += ` (+${wizardStore.data.selectedInstances.length - 1} more)`
|
|
|
|
|
+ }
|
|
|
|
|
+ this.title = title
|
|
|
|
|
+ wizardStore.updateData({ destOptions: { title } })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@autobind
|
|
@autobind
|
|
|
handleResize() {
|
|
handleResize() {
|
|
|
instanceStore.updateInstancesPerPage(this.instancesPerPage)
|
|
instanceStore.updateInstancesPerPage(this.instancesPerPage)
|
|
@@ -311,6 +323,7 @@ class WizardPage extends React.Component<Props, State> {
|
|
|
wizardStore.clearStorageMap()
|
|
wizardStore.clearStorageMap()
|
|
|
wizardStore.toggleInstanceSelection(instance)
|
|
wizardStore.toggleInstanceSelection(instance)
|
|
|
wizardStore.updateUrlState()
|
|
wizardStore.updateUrlState()
|
|
|
|
|
+ this.setTransferItemTitle()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
handleInstancePageClick(page: number) {
|
|
handleInstancePageClick(page: number) {
|
|
@@ -400,6 +413,7 @@ class WizardPage extends React.Component<Props, State> {
|
|
|
|
|
|
|
|
initializeState(match: any) {
|
|
initializeState(match: any) {
|
|
|
wizardStore.getUrlState()
|
|
wizardStore.getUrlState()
|
|
|
|
|
+ this.setTransferItemTitle()
|
|
|
const type = match && match.params && match.params.type
|
|
const type = match && match.params && match.params.type
|
|
|
if (type === 'migration' || type === 'replica') {
|
|
if (type === 'migration' || type === 'replica') {
|
|
|
this.setState({ type })
|
|
this.setState({ type })
|
|
@@ -492,6 +506,12 @@ class WizardPage extends React.Component<Props, State> {
|
|
|
loadOptions(target, 'destination')
|
|
loadOptions(target, 'destination')
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
|
|
|
+ case 'dest-options': {
|
|
|
|
|
+ if (!wizardStore.data?.destOptions?.title) {
|
|
|
|
|
+ wizardStore.updateData({ destOptions: { title: this.title } })
|
|
|
|
|
+ }
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
case 'networks':
|
|
case 'networks':
|
|
|
this.loadNetworks(true)
|
|
this.loadNetworks(true)
|
|
|
break
|
|
break
|