Hide/show the GPUs list depending on whether auto is selected

This commit is contained in:
cmdr2 2022-11-14 13:14:33 +05:30
parent f904945d40
commit 1d2b3a4ed8
2 changed files with 6 additions and 4 deletions

View File

@ -338,7 +338,7 @@
<script src="media/js/inpainting-editor.js?v=1"></script> <script src="media/js/inpainting-editor.js?v=1"></script>
<script src="media/js/image-modifiers.js?v=6"></script> <script src="media/js/image-modifiers.js?v=6"></script>
<script src="media/js/auto-save.js?v=7"></script> <script src="media/js/auto-save.js?v=7"></script>
<script src="media/js/main.js?v=15"></script> <script src="media/js/main.js?v=16"></script>
<script src="media/js/themes.js?v=4"></script> <script src="media/js/themes.js?v=4"></script>
<script src="media/js/dnd.js?v=8"></script> <script src="media/js/dnd.js?v=8"></script>
<script> <script>

View File

@ -1153,7 +1153,7 @@ useCPUField.addEventListener('click', function() {
} else { } else {
autoPickGPUsField.checked = (oldVal === 'true') autoPickGPUsField.checked = (oldVal === 'true')
} }
useGPUsField.disabled = autoPickGPUsField.checked gpuSettingEntry.style.display = (autoPickGPUsField.checked ? 'none' : '')
} }
}) })
@ -1167,7 +1167,8 @@ autoPickGPUsField.addEventListener('click', function() {
$('#use_gpus').val([]) $('#use_gpus').val([])
} }
useGPUsField.disabled = this.checked let gpuSettingEntry = getParameterSettingsEntry('use_gpus')
gpuSettingEntry.style.display = (this.checked ? 'none' : '')
}) })
async function changeAppConfig(configDelta) { async function changeAppConfig(configDelta) {
@ -1406,7 +1407,8 @@ async function getDevices() {
}) })
if (autoPickGPUsField.checked) { if (autoPickGPUsField.checked) {
useGPUsField.disabled = true let gpuSettingEntry = getParameterSettingsEntry('use_gpus')
gpuSettingEntry.style.display = 'none'
} else { } else {
$('#use_gpus').val(activeDeviceIds) $('#use_gpus').val(activeDeviceIds)
} }