Skip to content

Commit 59f66b9

Browse files
committed
vmm: Better layout for upgrade pannel
1 parent 30b093b commit 59f66b9

File tree

1 file changed

+49
-22
lines changed

1 file changed

+49
-22
lines changed

vmm/src/console.html

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,32 @@
363363
color: #666;
364364
}
365365
</style>
366+
<style>
367+
/* Checkbox styling */
368+
.form-check {
369+
margin-bottom: 12px;
370+
}
371+
372+
.checkbox-container {
373+
display: flex;
374+
align-items: center;
375+
gap: 8px;
376+
cursor: pointer;
377+
user-select: none;
378+
}
379+
380+
.checkbox-label {
381+
font-size: 14px;
382+
color: #333;
383+
}
384+
385+
input[type="checkbox"] {
386+
width: 16px;
387+
height: 16px;
388+
cursor: pointer;
389+
accent-color: #4285F4;
390+
}
391+
</style>
366392
<style>
367393
.vm-details {
368394
font-size: 14px;
@@ -654,9 +680,7 @@ <h2>Deploy a new instance</h2>
654680

655681
<div class="form-group" v-if="availableGpus.length > 0">
656682
<label for="gpuSelection">GPU</label>
657-
<gpu-config-editor
658-
:available-gpus="availableGpus"
659-
v-model:gpus="vmForm.selectedGpus"
683+
<gpu-config-editor :available-gpus="availableGpus" v-model:gpus="vmForm.selectedGpus"
660684
v-model:attach-all="vmForm.attachAllGpus">
661685
</gpu-config-editor>
662686
</div>
@@ -685,7 +709,8 @@ <h2>Deploy a new instance</h2>
685709

686710
<div class="form-group full-width">
687711
<label>Features</label>
688-
<div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px;">
712+
<div
713+
style="display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px;">
689714
<label style="display: grid; grid-template-columns: 20px 1fr; align-items: center;">
690715
<input type="checkbox" v-model="vmForm.kms_enabled">
691716
<span style="margin-left: 5px;">KMS</span>
@@ -1042,26 +1067,25 @@ <h3>Update VM Config</h3>
10421067

10431068
<!-- GPU Configuration -->
10441069
<div class="form-group" v-if="availableGpus.length > 0">
1045-
<div style="display: flex; align-items: center; gap: 10px; margin-bottom: 10px;">
1046-
<label style="margin-bottom: 0;">GPU Configuration</label>
1047-
<label style="display: flex; align-items: center; gap: 5px; margin-bottom: 0;">
1070+
<div class="form-check">
1071+
<label class="checkbox-container">
10481072
<input type="checkbox" v-model="upgradeDialog.updateGpuConfig">
1049-
<span>Update GPU configuration</span>
1073+
<span class="checkbox-label">Update GPU configuration</span>
10501074
</label>
10511075
</div>
10521076

10531077
<div v-if="upgradeDialog.updateGpuConfig">
1054-
<gpu-config-editor
1055-
:available-gpus="availableGpus"
1056-
v-model:gpus="upgradeDialog.selectedGpus"
1078+
<gpu-config-editor :available-gpus="availableGpus" v-model:gpus="upgradeDialog.selectedGpus"
10571079
v-model:attach-all="upgradeDialog.attachAllGpus">
10581080
</gpu-config-editor>
10591081
</div>
10601082
</div>
10611083

1062-
<div style="display: flex; align-items: center; margin-top: 16px;">
1063-
<input type="checkbox" v-model="upgradeDialog.updateCompose" style="width: 16px; height: 16px;">
1064-
<span style="margin-left: 8px;">Update App Compose</span>
1084+
<div class="form-check" style="margin-top: 16px;">
1085+
<label class="checkbox-container">
1086+
<input type="checkbox" v-model="upgradeDialog.updateCompose">
1087+
<span class="checkbox-label">Update App Compose</span>
1088+
</label>
10651089
</div>
10661090
<div v-if="upgradeDialog.updateCompose">
10671091
<div class="form-group">
@@ -1094,9 +1118,11 @@ <h3>Update VM Config</h3>
10941118
Compose Hash: 0x{{ upgradeComposeHashPreview }}
10951119
</div>
10961120
</div>
1097-
<div style="display: flex; align-items: center; margin-top: 16px;">
1098-
<input type="checkbox" v-model="upgradeDialog.resetSecrets" style="width: 16px; height: 16px;">
1099-
<span style="margin-left: 8px;">Reset secrets</span>
1121+
<div class="form-check" style="margin-top: 16px;">
1122+
<label class="checkbox-container">
1123+
<input type="checkbox" v-model="upgradeDialog.resetSecrets">
1124+
<span class="checkbox-label">Reset secrets</span>
1125+
</label>
11001126
</div>
11011127
<div v-if="kmsEnabled(upgradeDialog.vm) && upgradeDialog.resetSecrets" style="margin-top: 16px;">
11021128
<encrypted-env-editor :env-vars="upgradeDialog.encryptedEnvs"></encrypted-env-editor>
@@ -1223,11 +1249,13 @@ <h3>Derive VM</h3>
12231249
<div style="margin-bottom: 5px; font-size: 0.9em; color: #666;">
12241250
Select GPUs to attach:
12251251
</div>
1226-
<div style="max-height: 200px; overflow-y: auto; border: 1px solid #ddd; padding: 10px; border-radius: 4px;">
1252+
<div
1253+
style="max-height: 200px; overflow-y: auto; border: 1px solid #ddd; padding: 10px; border-radius: 4px;">
12271254
<div v-for="gpu in availableGpus" :key="gpu.slot" style="margin-bottom: 8px;">
12281255
<label style="display: grid; grid-template-columns: 20px 1fr; align-items: center;">
12291256
<input type="checkbox" :value="gpu.slot" v-model="gpus">
1230-
<span style="margin-left: 5px;">{{ gpu.slot }}: {{ gpu.description }} {{ gpu.is_free ? '' : '(in use)' }}</span>
1257+
<span style="margin-left: 5px;">{{ gpu.slot }}: {{ gpu.description }} {{ gpu.is_free ? '' :
1258+
'(in use)' }}</span>
12311259
</label>
12321260
</div>
12331261
</div>
@@ -1871,7 +1899,7 @@ <h3>Derive VM</h3>
18711899
}
18721900
};
18731901

1874-
function autoMemoryDisply(mb) {
1902+
function autoMemoryDisplay(mb) {
18751903
if (mb >= 1024) {
18761904
return {
18771905
memoryValue: (mb / 1024).toFixed(1),
@@ -1913,8 +1941,7 @@ <h3>Derive VM</h3>
19131941
user_config: updatedVM.configuration?.user_config || '',
19141942
vcpu: updatedVM.configuration?.vcpu || 1,
19151943
memory: updatedVM.configuration?.memory || 1024,
1916-
memoryValue: convertMemoryToValue(updatedVM.configuration?.memory || 1024),
1917-
memoryUnit: convertMemoryToUnit(updatedVM.configuration?.memory || 1024),
1944+
...autoMemoryDisplay(updatedVM.configuration?.memory),
19181945
disk_size: updatedVM.configuration?.disk_size || 10,
19191946
image: updatedVM.configuration?.image || '',
19201947
ports: updatedVM.configuration?.ports?.map(port => ({ ...port })) || [],

0 commit comments

Comments
 (0)