mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-01 03:36:04 +08:00
fix: vGPU number not correct
Signed-off-by: andy.lee <andy.lee@suse.com>
This commit is contained in:
@@ -46,10 +46,13 @@ export default {
|
|||||||
this[key] = res[key];
|
this[key] = res[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
uniq([
|
const vGpus = this.vm.isOff ? [
|
||||||
...(this.value?.domain?.devices?.gpus || []).map(({ name }) => name),
|
...(this.value?.domain?.devices?.gpus || []).map(({ name }) => name),
|
||||||
|
] : [
|
||||||
...Object.values(this.vm?.provisionedVGpus).reduce((acc, gpus) => [...acc, ...gpus], [])
|
...Object.values(this.vm?.provisionedVGpus).reduce((acc, gpus) => [...acc, ...gpus], [])
|
||||||
]).forEach((name) => {
|
];
|
||||||
|
|
||||||
|
uniq(vGpus).forEach((name) => {
|
||||||
if (this.enabledDevices.find((device) => device?.metadata?.name === name)) {
|
if (this.enabledDevices.find((device) => device?.metadata?.name === name)) {
|
||||||
this.selectedDevices.push(name);
|
this.selectedDevices.push(name);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user