WebUI: Fix wrong log levels

Fixes bug where the first time visiting Execution Log view all log levels are deselected but log items with all levels are still displayed.
This requires you to select a log level and then deselect it to hide that log level.

PR #21812.
This commit is contained in:
Patrik Elfström 2024-11-16 08:22:26 +01:00 committed by GitHub
parent 1cd3c586c1
commit c9a55fce95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -188,12 +188,8 @@
let selectedLogLevels = JSON.parse(LocalPreferences.get("qbt_selected_log_levels")) || ["1", "2", "4", "8"];
const init = () => {
$("logLevelSelect").getElements("option").each((x) => {
if (selectedLogLevels.indexOf(x.value.toString()) !== -1)
x.selected = true;
else
x.selected = false;
});
for (const option of $("logLevelSelect").options)
option.setAttribute("selected", selectedLogLevels.includes(option.value));
selectBox = new vanillaSelectBox("#logLevelSelect", {
maxHeight: 200,