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

View File

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