mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-01 03:36:04 +08:00
Update selected vGpus devices adding the provisioned devices
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import remove from 'lodash/remove';
|
||||
import { set } from '@shell/utils/object';
|
||||
import { HCI } from '../../../types';
|
||||
import VGpuDeviceList from './VGpuDeviceList';
|
||||
import { uniq } from '@shell/utils/array';
|
||||
|
||||
export default {
|
||||
name: 'VirtualMachineVGpuDevices',
|
||||
@@ -45,7 +46,10 @@ export default {
|
||||
this[key] = res[key];
|
||||
}
|
||||
|
||||
(this.value?.domain?.devices?.gpus || []).forEach(({ name }) => {
|
||||
uniq([
|
||||
...(this.value?.domain?.devices?.gpus || []).map(({ name }) => name),
|
||||
...Object.values(this.vm?.provisionedVGpus).reduce((acc, gpus) => [...acc, ...gpus], [])
|
||||
]).forEach((name) => {
|
||||
if (this.enabledDevices.find(device => device?.metadata?.name === name)) {
|
||||
this.selectedDevices.push(name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user