Skip to content

Commit c122dd6

Browse files
committed
vmm-ui: Sync generated console_v1.html
1 parent 09d10bc commit c122dd6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

vmm/src/console_v1.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2473,10 +2473,19 @@ <h3>Derive VM</h3>
24732473
errorMessage.value = String(err);
24742474
}
24752475
}
2476-
function configGpu(form) {
2476+
function configGpu(form, isUpdate = false) {
24772477
if (form.attachAllGpus) {
24782478
return { attach_mode: 'all' };
24792479
}
2480+
// For updates, always return a config when GPUs are being explicitly updated
2481+
// Empty array means no GPUs should be attached
2482+
if (isUpdate) {
2483+
return {
2484+
attach_mode: 'listed',
2485+
gpus: (form.selectedGpus || []).map((slot) => ({ slot })),
2486+
};
2487+
}
2488+
// For creation, return undefined if no GPUs are selected
24802489
if (form.selectedGpus && form.selectedGpus.length > 0) {
24812490
return {
24822491
attach_mode: 'listed',
@@ -3040,7 +3049,7 @@ <h3>Derive VM</h3>
30403049
body.user_config = updated.user_config;
30413050
body.update_ports = true;
30423051
body.ports = normalizePorts(updated.ports);
3043-
body.gpus = updateDialog.value.updateGpuConfig ? configGpu(updated) : undefined;
3052+
body.gpus = updateDialog.value.updateGpuConfig ? configGpu(updated, true) : undefined;
30443053
await vmmRpc.updateVm(body);
30453054
updateDialog.value.encryptedEnvs = [];
30463055
updateDialog.value.show = false;

0 commit comments

Comments
 (0)