mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-22 13:33:52 +03:00
B OpenNebula/one#6380: Fix multiple issues with image pool view (#2884)
This commit is contained in:
parent
9177157e2a
commit
53b0d9970c
@ -18,9 +18,6 @@ import { CategoryFilter } from 'client/components/Tables/Enhanced/Utils'
|
||||
import * as ImageModel from 'client/models/Image'
|
||||
import { T } from 'client/constants'
|
||||
|
||||
const getTotalOfResources = (resources) =>
|
||||
[resources?.ID ?? []].flat().length || 0
|
||||
|
||||
const COLUMNS = [
|
||||
{ Header: 'ID', id: 'id', accessor: 'ID', sortType: 'number' },
|
||||
{ Header: 'Name', id: 'name', accessor: 'NAME' },
|
||||
@ -64,12 +61,6 @@ const COLUMNS = [
|
||||
accessor: 'RUNNING_VMS',
|
||||
sortType: 'number',
|
||||
},
|
||||
{
|
||||
Header: 'Total VMs',
|
||||
id: 'TOTAL_VMS',
|
||||
accessor: (row) => getTotalOfResources(row?.VMS),
|
||||
sortType: 'number',
|
||||
},
|
||||
]
|
||||
|
||||
COLUMNS.noFilterIds = ['id', 'name', 'type', 'label']
|
||||
|
@ -24,7 +24,6 @@ import {
|
||||
Db as DatastoreIcon,
|
||||
ModernTv,
|
||||
Pin as PersistentIcon,
|
||||
Archive as DiskTypeIcon,
|
||||
} from 'iconoir-react'
|
||||
import { Typography } from '@mui/material'
|
||||
import MultipleTags from 'client/components/MultipleTags'
|
||||
@ -53,11 +52,9 @@ const Row = ({ original, value, onClickLabel, ...props }) => {
|
||||
GNAME,
|
||||
REGTIME,
|
||||
TYPE,
|
||||
DISK_TYPE,
|
||||
PERSISTENT,
|
||||
locked,
|
||||
DATASTORE,
|
||||
TOTAL_VMS,
|
||||
RUNNING_VMS,
|
||||
label: LABELS = [],
|
||||
} = value
|
||||
@ -133,29 +130,13 @@ const Row = ({ original, value, onClickLabel, ...props }) => {
|
||||
<DatastoreIcon />
|
||||
<span>{` ${DATASTORE}`}</span>
|
||||
</span>
|
||||
<span
|
||||
title={
|
||||
PERSISTENT
|
||||
? T.Persistent.toLowerCase()
|
||||
: T.NonPersistent.toLowerCase()
|
||||
}
|
||||
>
|
||||
<span title={+PERSISTENT ? T.Persistent : T.NonPersistent}>
|
||||
<PersistentIcon />
|
||||
<span>
|
||||
{PERSISTENT
|
||||
? T.Persistent.toLowerCase()
|
||||
: T.NonPersistent.toLowerCase()}
|
||||
</span>
|
||||
<span>{+PERSISTENT ? T.Persistent : T.NonPersistent}</span>
|
||||
</span>
|
||||
<span title={`${T.DiskType}: ${DISK_TYPE.toLowerCase()}`}>
|
||||
<DiskTypeIcon />
|
||||
<span>{` ${DISK_TYPE.toLowerCase()}`}</span>
|
||||
</span>
|
||||
<span
|
||||
title={`${T.Running} / ${T.Used} ${T.VMs}: ${RUNNING_VMS} / ${TOTAL_VMS}`}
|
||||
>
|
||||
<span title={`${T.VMs}: ${RUNNING_VMS}`}>
|
||||
<ModernTv />
|
||||
<span>{` ${RUNNING_VMS} / ${TOTAL_VMS}`}</span>
|
||||
<span>{`${RUNNING_VMS}`}</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user