Merge pull request #125 from a110605/issue_7003_ext

fix: vGPU number not correct
This commit is contained in:
Andy Lee 2025-02-11 13:13:02 +08:00 committed by GitHub
commit f3d2d2f6a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -46,10 +46,13 @@ export default {
this[key] = res[key];
}
uniq([
const vGpus = this.vm.isOff ? [
...(this.value?.domain?.devices?.gpus || []).map(({ name }) => name),
] : [
...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)) {
this.selectedDevices.push(name);
}