1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-13 12:58:17 +03:00

M #-: Add size to image card (#3031)

* Image cards in FireEdge now display the size attribute

Signed-off-by: Victor Hansson <vhansson@opennebula.io>
This commit is contained in:
vichansson 2024-04-11 19:13:47 +03:00 committed by GitHub
parent 4eb464cfdd
commit f75ab3784e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -61,6 +61,11 @@ const COLUMNS = [
accessor: 'RUNNING_VMS',
sortType: 'number',
},
{
Header: 'Size',
accessor: 'SIZE',
sortType: 'number',
},
]
COLUMNS.noFilterIds = ['id', 'name', 'type', 'label']

View File

@ -38,6 +38,7 @@ import {
getUniqueLabels,
getColorFromString,
} from 'client/models/Helper'
import { prettyBytes } from 'client/utils'
import * as ImageModel from 'client/models/Image'
import * as Helper from 'client/models/Helper'
@ -55,6 +56,7 @@ const Row = ({ original, value, onClickLabel, ...props }) => {
PERSISTENT,
locked,
DATASTORE,
SIZE,
RUNNING_VMS,
label: LABELS = [],
} = value
@ -138,6 +140,9 @@ const Row = ({ original, value, onClickLabel, ...props }) => {
<ModernTv />
<span>{`${RUNNING_VMS}`}</span>
</span>
<span title={`${T.Size}: ${SIZE}`}>
<span>{`${prettyBytes(+SIZE ?? 0)}`}</span>
</span>
</div>
</div>
<div className={classes.secondary}></div>