mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-21 21:33:18 +01:00
fix: fixes toggle all when fields have not been set for JSON (#3349)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user