Skip to content

Commit

Permalink
group pool by id
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuRA committed Sep 12, 2023
1 parent 8623020 commit 08ee4ca
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/xo-web/src/xo-app/xostor/xostor-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Tooltip from 'tooltip'
import { connectStore, formatSize } from 'utils'
import { createGetObjectsOfType, createSelector } from 'selectors'
import { deleteSr } from 'xo'
import { find, map } from 'lodash'
import { map } from 'lodash'
import { Pool } from 'render-xo-item'

const COLUMNS = [
Expand Down Expand Up @@ -62,12 +62,13 @@ const XostorList = decorate([
connectStore(() => ({
xostorSrs: createSelector(
createGetObjectsOfType('SR').filter([sr => sr.SR_type === 'linstor']),
createGetObjectsOfType('pool'),
(srs, pools) =>
map(srs, sr => ({
createGetObjectsOfType('pool').groupBy('id'),
(srs, poolByIds) => {
return map(srs, sr => ({
...sr,
pool: find(pools, { id: sr.$pool }),
pool: poolByIds[sr.$pool][0],
}))
}
),
})),
({ xostorSrs }) => (
Expand Down

0 comments on commit 08ee4ca

Please sign in to comment.