1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-21 13:23:07 +01:00

fix: fixes toggle all when fields have not been set for JSON (#3349)

This commit is contained in:
Amir Raminfar
2024-10-27 07:16:20 -07:00
committed by GitHub
parent 8513824fb4
commit cce2e8a8b5
2 changed files with 9 additions and 1 deletions

View File

@@ -133,6 +133,10 @@ const toggleAllFields = computed({
for (const key of visibleKeys.value.keys()) {
visibleKeys.value.set(key, value);
}
for (const field of fields.value) {
visibleKeys.value.set(field.key, value);
}
},
});

View File

@@ -86,13 +86,17 @@ export class ComplexLogEntry extends LogEntry<JSONObject> {
return flattenJSON(message);
} else {
const flatJSON = flattenJSON(message);
const filteredJSON: Record<string, any> = {};
for (const [keys, enabled] of visibleKeys.value.entries()) {
const key = keys.join(".");
if (!enabled) {
delete flatJSON[key];
continue;
}
filteredJSON[key] = flatJSON[key];
delete flatJSON[key];
}
return flatJSON;
return { ...filteredJSON, ...flatJSON };
}
});
} else {