mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-21 13:23:07 +01:00
fix: unfound fields are shown by default instead of hidden (#3342)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Component, ComputedRef, Ref } from "vue";
|
||||
import { flattenJSON, getDeep } from "@/utils";
|
||||
import { flattenJSON } from "@/utils";
|
||||
import ComplexLogItem from "@/components/LogViewer/ComplexLogItem.vue";
|
||||
import SimpleLogItem from "@/components/LogViewer/SimpleLogItem.vue";
|
||||
import ContainerEventLogItem from "@/components/LogViewer/ContainerEventLogItem.vue";
|
||||
@@ -85,10 +85,14 @@ export class ComplexLogEntry extends LogEntry<JSONObject> {
|
||||
if (visibleKeys.value.size === 0) {
|
||||
return flattenJSON(message);
|
||||
} else {
|
||||
const keys = Array.from(visibleKeys.value.entries())
|
||||
.filter(([, value]) => value)
|
||||
.map(([key]) => key);
|
||||
return keys.reduce((acc, attr) => ({ ...acc, [attr.join(".")]: getDeep(message, attr) }), {});
|
||||
const flatJSON = flattenJSON(message);
|
||||
for (const [keys, enabled] of visibleKeys.value.entries()) {
|
||||
const key = keys.join(".");
|
||||
if (!enabled) {
|
||||
delete flatJSON[key];
|
||||
}
|
||||
}
|
||||
return flatJSON;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user