mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-30 22:50:10 +03:00
M #-: Filter out duplicate PCI devices (#2688)
(cherry picked from commit b32418df0ae7b551193e9d32974af19bc3081946)
This commit is contained in:
parent
be38316f03
commit
73a9b7931a
@ -438,7 +438,16 @@ const HARDWARE_FIELDS = (defaultData = {}) => [
|
||||
type: INPUT_TYPES.SELECT,
|
||||
values: () => {
|
||||
const { data: hosts = [] } = useGetHostsQuery()
|
||||
const pciDevices = hosts.map(getPciDevices).flat()
|
||||
const pciDevices = hosts
|
||||
.map(getPciDevices)
|
||||
.flat()
|
||||
.reduce(
|
||||
(currentPCIS, newDevice) =>
|
||||
currentPCIS.some((pci) => pci.ADDRESS === newDevice.ADDRESS) // Filter out devices with the same address
|
||||
? currentPCIS
|
||||
: [...currentPCIS, newDevice],
|
||||
[]
|
||||
)
|
||||
|
||||
return arrayToOptions(pciDevices, {
|
||||
getText: ({ DEVICE_NAME } = {}) => DEVICE_NAME,
|
||||
|
Loading…
x
Reference in New Issue
Block a user