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:
@@ -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'
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user