mirror of
https://github.com/amir20/dozzle.git
synced 2026-01-04 03:54:58 +01:00
* WIP for using json all the time * Updates to render * adds a new component for json * Updates styles * Adds nesting * Adds field list * Adds expanding * Adds new composable for event source * Creates an add button * Removes unused code * Adds and removes fields with defaults * Fixes jumping when adding new fields * Returns JSON correctly * Fixes little bugs * Fixes js tests * Adds vscode * Fixes json buffer error * Fixes extra line * Fixes tests * Fixes tests and adds support for search * Refactors visible payload keys to a composable * Fixes typescript errors and refactors * Fixes visible keys by ComputedRef<Ref> * Fixes search bugs * Updates tests * Fixes go tests * Fixes scroll view * Fixes vue tsc errors * Fixes EOF error * Fixes build error * Uses application/ld+json * Fixes arrays and records * Marks for json too
14 lines
445 B
TypeScript
14 lines
445 B
TypeScript
import { LogEntry } from "@/types/LogEntry";
|
|
import { VisibleLogEntry } from "@/types/VisibleLogEntry";
|
|
import { computed, ComputedRef, Ref } from "vue";
|
|
|
|
export function useVisibleFilter(visibleKeys: ComputedRef<Ref<string[][]>>) {
|
|
function filteredPayload(messages: Ref<LogEntry[]>) {
|
|
return computed(() => {
|
|
return messages.value.map((d) => new VisibleLogEntry(d, visibleKeys.value));
|
|
});
|
|
}
|
|
|
|
return { filteredPayload };
|
|
}
|