|
363 | 363 | color: #666; |
364 | 364 | } |
365 | 365 | </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> |
366 | 392 | <style> |
367 | 393 | .vm-details { |
368 | 394 | font-size: 14px; |
@@ -654,9 +680,7 @@ <h2>Deploy a new instance</h2> |
654 | 680 |
|
655 | 681 | <div class="form-group" v-if="availableGpus.length > 0"> |
656 | 682 | <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" |
660 | 684 | v-model:attach-all="vmForm.attachAllGpus"> |
661 | 685 | </gpu-config-editor> |
662 | 686 | </div> |
@@ -685,7 +709,8 @@ <h2>Deploy a new instance</h2> |
685 | 709 |
|
686 | 710 | <div class="form-group full-width"> |
687 | 711 | <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;"> |
689 | 714 | <label style="display: grid; grid-template-columns: 20px 1fr; align-items: center;"> |
690 | 715 | <input type="checkbox" v-model="vmForm.kms_enabled"> |
691 | 716 | <span style="margin-left: 5px;">KMS</span> |
@@ -1042,26 +1067,25 @@ <h3>Update VM Config</h3> |
1042 | 1067 |
|
1043 | 1068 | <!-- GPU Configuration --> |
1044 | 1069 | <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"> |
1048 | 1072 | <input type="checkbox" v-model="upgradeDialog.updateGpuConfig"> |
1049 | | - <span>Update GPU configuration</span> |
| 1073 | + <span class="checkbox-label">Update GPU configuration</span> |
1050 | 1074 | </label> |
1051 | 1075 | </div> |
1052 | 1076 |
|
1053 | 1077 | <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" |
1057 | 1079 | v-model:attach-all="upgradeDialog.attachAllGpus"> |
1058 | 1080 | </gpu-config-editor> |
1059 | 1081 | </div> |
1060 | 1082 | </div> |
1061 | 1083 |
|
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> |
1065 | 1089 | </div> |
1066 | 1090 | <div v-if="upgradeDialog.updateCompose"> |
1067 | 1091 | <div class="form-group"> |
@@ -1094,9 +1118,11 @@ <h3>Update VM Config</h3> |
1094 | 1118 | Compose Hash: 0x{{ upgradeComposeHashPreview }} |
1095 | 1119 | </div> |
1096 | 1120 | </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> |
1100 | 1126 | </div> |
1101 | 1127 | <div v-if="kmsEnabled(upgradeDialog.vm) && upgradeDialog.resetSecrets" style="margin-top: 16px;"> |
1102 | 1128 | <encrypted-env-editor :env-vars="upgradeDialog.encryptedEnvs"></encrypted-env-editor> |
@@ -1223,11 +1249,13 @@ <h3>Derive VM</h3> |
1223 | 1249 | <div style="margin-bottom: 5px; font-size: 0.9em; color: #666;"> |
1224 | 1250 | Select GPUs to attach: |
1225 | 1251 | </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;"> |
1227 | 1254 | <div v-for="gpu in availableGpus" :key="gpu.slot" style="margin-bottom: 8px;"> |
1228 | 1255 | <label style="display: grid; grid-template-columns: 20px 1fr; align-items: center;"> |
1229 | 1256 | <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> |
1231 | 1259 | </label> |
1232 | 1260 | </div> |
1233 | 1261 | </div> |
@@ -1871,7 +1899,7 @@ <h3>Derive VM</h3> |
1871 | 1899 | } |
1872 | 1900 | }; |
1873 | 1901 |
|
1874 | | - function autoMemoryDisply(mb) { |
| 1902 | + function autoMemoryDisplay(mb) { |
1875 | 1903 | if (mb >= 1024) { |
1876 | 1904 | return { |
1877 | 1905 | memoryValue: (mb / 1024).toFixed(1), |
@@ -1913,8 +1941,7 @@ <h3>Derive VM</h3> |
1913 | 1941 | user_config: updatedVM.configuration?.user_config || '', |
1914 | 1942 | vcpu: updatedVM.configuration?.vcpu || 1, |
1915 | 1943 | memory: updatedVM.configuration?.memory || 1024, |
1916 | | - memoryValue: convertMemoryToValue(updatedVM.configuration?.memory || 1024), |
1917 | | - memoryUnit: convertMemoryToUnit(updatedVM.configuration?.memory || 1024), |
| 1944 | + ...autoMemoryDisplay(updatedVM.configuration?.memory), |
1918 | 1945 | disk_size: updatedVM.configuration?.disk_size || 10, |
1919 | 1946 | image: updatedVM.configuration?.image || '', |
1920 | 1947 | ports: updatedVM.configuration?.ports?.map(port => ({ ...port })) || [], |
|
0 commit comments