This commit is contained in:
Mohamedox
2019-09-11 10:13:17 +02:00
parent 5077de953d
commit 01e15ae4ec
2 changed files with 23 additions and 7 deletions

View File

@@ -2155,6 +2155,7 @@ const messages = {
hubXvaOs: 'OS', hubXvaOs: 'OS',
hubXvaVersion: 'VERSION', hubXvaVersion: 'VERSION',
hubXvaSize: 'SIZE', hubXvaSize: 'SIZE',
hubTotalDiskSize: 'TOTAL DISK SIZE',
hubXvaProgressMessage: 'Click here to see progress', hubXvaProgressMessage: 'Click here to see progress',
hubHideInstalledPoolMsg: hubHideInstalledPoolMsg:
'We are hiding pools with already installed template', 'We are hiding pools with already installed template',

View File

@@ -65,9 +65,7 @@ export default decorate([
sr: pool.default_SR, sr: pool.default_SR,
}) })
success('XVA import', 'XVA installed successfuly') success('XVA import', 'XVA installed successfuly')
return { this.state.selectedInstallPools = []
selectedInstallPools: [],
}
} catch (_error) { } catch (_error) {
error('Error', _error.message) error('Error', _error.message)
} }
@@ -83,6 +81,7 @@ export default decorate([
this.props.router.push( this.props.router.push(
`/vms/new?pool=${selectedCreatePool.$pool}&template=${template.id}` `/vms/new?pool=${selectedCreatePool.$pool}&template=${template.id}`
) )
this.state.selectedCreatePool = undefined
} }
}, },
updateSelectedInstallPools(_, selectedInstallPools) { updateSelectedInstallPools(_, selectedInstallPools) {
@@ -135,7 +134,18 @@ export default decorate([
}, },
}), }),
injectState, injectState,
({ effects, id, name, namespace, os, popularity, size, state, version }) => ( ({
totalDiskSize,
effects,
id,
name,
namespace,
os,
popularity,
size,
state,
version,
}) => (
<Card shadow> <Card shadow>
<CardHeader>{name}</CardHeader> <CardHeader>{name}</CardHeader>
<CardBlock className='text-center'> <CardBlock className='text-center'>
@@ -156,9 +166,14 @@ export default decorate([
{' '} {' '}
<strong>{formatSize(size)}</strong> <strong>{formatSize(size)}</strong>
</div> </div>
<div>
<span className='text-muted'>{_('hubTotalDiskSize')}</span>
{' '}
<strong>{formatSize(totalDiskSize)}</strong>
</div>
<hr /> <hr />
{state.loading ? ( {state.loading ? (
<div> <div className='mb-3'>
<a href='/#/tasks' target='_blank'> <a href='/#/tasks' target='_blank'>
{_('hubXvaProgressMessage')} {_('hubXvaProgressMessage')}
</a> </a>
@@ -168,7 +183,6 @@ export default decorate([
<form id={state.idInstallForm}> <form id={state.idInstallForm}>
<Tooltip content={_('hubHideInstalledPoolMsg')}> <Tooltip content={_('hubHideInstalledPoolMsg')}>
<SelectPool <SelectPool
autoFocus
className='mb-1' className='mb-1'
disabled={state.isTemplateInstalledOnAllPools} disabled={state.isTemplateInstalledOnAllPools}
multi multi
@@ -184,6 +198,7 @@ export default decorate([
data-name={name} data-name={name}
data-namespace={namespace} data-namespace={namespace}
data-version={version} data-version={version}
disabled={state.isTemplateInstalledOnAllPools}
form={state.idInstallForm} form={state.idInstallForm}
handler={effects.install} handler={effects.install}
icon={'add'} icon={'add'}
@@ -196,7 +211,6 @@ export default decorate([
<hr /> <hr />
<form id={state.idCreateForm}> <form id={state.idCreateForm}>
<SelectPool <SelectPool
autoFocus
className='mb-1' className='mb-1'
disabled={state.template === undefined} disabled={state.template === undefined}
onChange={effects.updateSelectedCreatePool} onChange={effects.updateSelectedCreatePool}
@@ -206,6 +220,7 @@ export default decorate([
/> />
<ActionButton <ActionButton
block block
disabled={state.template === undefined}
form={state.idCreateForm} form={state.idCreateForm}
handler={effects.create} handler={effects.create}
icon={'add'} icon={'add'}