fix(vm): do not display VDI or VIF disconnect but when VM is not running. Fixes #1470 and fixes #1468

This commit is contained in:
Olivier Lambert
2016-09-05 16:59:21 +02:00
parent aaf4c5dff7
commit 06a40180a1
2 changed files with 11 additions and 7 deletions

View File

@@ -30,6 +30,7 @@ import {
disconnectVbd, disconnectVbd,
editVdi, editVdi,
isSrWritable, isSrWritable,
isVmRunning,
migrateVdi, migrateVdi,
setBootableVbd, setBootableVbd,
setVmBootOrder setVmBootOrder
@@ -445,7 +446,7 @@ export default class TabDisks extends Component {
{_('vbdStatusDisconnected')} {_('vbdStatusDisconnected')}
</span> </span>
<ButtonGroup className='pull-xs-right'> <ButtonGroup className='pull-xs-right'>
{vm.power_state === 'Running' && {isVmRunning(vm) &&
<ActionRowButton <ActionRowButton
btnStyle='default' btnStyle='default'
icon='connect' icon='connect'

View File

@@ -22,7 +22,8 @@ import {
connectVif, connectVif,
createVmInterface, createVmInterface,
deleteVif, deleteVif,
disconnectVif disconnectVif,
isVmRunning
} from 'xo' } from 'xo'
@propTypes({ @propTypes({
@@ -191,11 +192,13 @@ export default class TabNetwork extends Component {
{_('vifStatusDisconnected')} {_('vifStatusDisconnected')}
</span> </span>
<ButtonGroup className='pull-xs-right'> <ButtonGroup className='pull-xs-right'>
{isVmRunning(vm) &&
<ActionRowButton <ActionRowButton
icon='connect' icon='connect'
handler={connectVif} handler={connectVif}
handlerParam={vif} handlerParam={vif}
/> />
}
<ActionRowButton <ActionRowButton
icon='remove' icon='remove'
handler={deleteVif} handler={deleteVif}