mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-25 14:59:26 +01:00
* Trims top events depending on scroll status * Cleans up models and adds better OOP around logging events * Adds log entries being skipped component * Fixes type errors * Fixes tets * Styles skipping logs
19 lines
570 B
TypeScript
19 lines
570 B
TypeScript
import { ComplexLogEntry, type JSONObject, type LogEntry } from "@/models/LogEntry";
|
|
import type { ComputedRef, Ref } from "vue";
|
|
|
|
export function useVisibleFilter(visibleKeys: ComputedRef<Ref<string[][]>>) {
|
|
function filteredPayload(messages: Ref<LogEntry<string | JSONObject>[]>) {
|
|
return computed(() => {
|
|
return messages.value.map((d) => {
|
|
if (d instanceof ComplexLogEntry) {
|
|
return ComplexLogEntry.fromLogEvent(d, visibleKeys.value);
|
|
} else {
|
|
return d;
|
|
}
|
|
});
|
|
});
|
|
}
|
|
|
|
return { filteredPayload };
|
|
}
|