Skip to content

Commit

Permalink
B #6380: Fix multiple issues with image pool view (#2884)
Browse files Browse the repository at this point in the history
(cherry picked from commit 53b0d99)
  • Loading branch information
dcarracedo authored and tinova committed Jan 4, 2024
1 parent 534a348 commit b6f16cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 32 deletions.
9 changes: 0 additions & 9 deletions src/fireedge/src/client/components/Tables/Images/columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down Expand Up @@ -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']
Expand Down
27 changes: 4 additions & 23 deletions src/fireedge/src/client/components/Tables/Images/row.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit b6f16cf

Please sign in to comment.