chore(xo-web/health): remove irrelevant actions on VDIs (#2882)

This commit is contained in:
Pierre Donias 2018-04-26 17:37:28 +02:00 committed by Julien Fontanet
parent 7a5229741f
commit 3d869d9fa1
2 changed files with 1 additions and 24 deletions

View File

@ -817,7 +817,6 @@ const messages = {
vdiMigrateAll: 'Migrate all VDIs',
vdiMigrateNoSr: 'No SR',
vdiMigrateNoSrMessage: 'A target SR is required to migrate a VDI',
vdiDelete: 'Delete VDI',
vdiForget: 'Forget',
vdiRemove: 'Remove VDI',
noControlDomainVdis: 'No VDIs attached to Control Domain',
@ -828,7 +827,6 @@ const messages = {
vbdNoVbd: 'No disks',
vbdConnect: 'Connect VBD',
vbdDisconnect: 'Disconnect VBD',
vbdsDisconnect: 'Disconnect VBDs',
vbdBootable: 'Bootable',
vbdReadonly: 'Readonly',
vbdAction: 'Action',

View File

@ -14,7 +14,7 @@ import { Card, CardHeader, CardBlock } from 'card'
import { confirm } from 'modal'
import { connectStore, formatSize, noop, resolveIds } from 'utils'
import { Container, Row, Col } from 'grid'
import { flatten, get, includes, isEmpty, map, mapValues, some } from 'lodash'
import { flatten, get, includes, isEmpty, map, mapValues } from 'lodash'
import { FormattedRelative, FormattedTime } from 'react-intl'
import { fromCallback } from 'promise-toolbox'
import { SelectPool } from 'select-objects'
@ -24,10 +24,7 @@ import {
deleteVbd,
deleteVbds,
deleteVdi,
deleteVdis,
deleteVm,
disconnectVbd,
disconnectVbds,
isSrWritable,
} from 'xo'
import {
@ -179,16 +176,6 @@ const ORPHANED_VDI_COLUMNS = [
]
const CONTROL_DOMAIN_VDIS_ACTIONS = [
{
disabled: selectedItems => some(selectedItems, ({ vbd }) => !vbd.attached),
handler: disconnectVbds,
icon: 'disconnect',
individualDisabled: ({ vbd }) => !vbd.attached,
individualHandler: disconnectVbd,
individualLabel: _('vbdDisconnect'),
label: _('vbdsDisconnect'),
level: 'danger',
},
{
handler: deleteVbds,
individualHandler: deleteVbd,
@ -196,14 +183,6 @@ const CONTROL_DOMAIN_VDIS_ACTIONS = [
label: _('vdiForget'),
level: 'danger',
},
{
handler: selectedItems => deleteVdis(map(selectedItems, 'vdi')),
icon: 'delete',
individualHandler: ({ vdi }) => deleteVdi(vdi),
individualLabel: _('vdiDelete'),
label: _('deleteSelectedVdis'),
level: 'danger',
},
]
const AttachedVdisTable = [