From 370e7b238ec5da34541ad18c4d2d7d7de7a00cff Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Fri, 5 May 2023 14:54:37 -0700 Subject: [PATCH] fix: shows a message when all keys in json logs are hidden. see #2122 (#2174) --- assets/auto-imports.d.ts | 4 ++-- assets/components/LogViewer/ComplexLogItem.vue | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/assets/auto-imports.d.ts b/assets/auto-imports.d.ts index bca945cb..6c83d6de 100644 --- a/assets/auto-imports.d.ts +++ b/assets/auto-imports.d.ts @@ -51,6 +51,7 @@ declare global { const getCurrentInstance: typeof import('vue')['getCurrentInstance'] const getCurrentScope: typeof import('vue')['getCurrentScope'] const getDeep: typeof import('./utils/index')['getDeep'] + const globalShowPopup: typeof import('./composables/popup')['globalShowPopup'] const h: typeof import('vue')['h'] const hourStyle: typeof import('./composables/settings')['hourStyle'] const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch'] @@ -120,7 +121,6 @@ declare global { const shallowReadonly: typeof import('vue')['shallowReadonly'] const shallowRef: typeof import('vue')['shallowRef'] const showAllContainers: typeof import('./composables/settings')['showAllContainers'] - const showPopup: typeof import('./composables/popup')['showPopup'] const showTimestamp: typeof import('./composables/settings')['showTimestamp'] const size: typeof import('./composables/settings')['size'] const smallerScrollbars: typeof import('./composables/settings')['smallerScrollbars'] @@ -385,6 +385,7 @@ declare module 'vue' { readonly getCurrentInstance: UnwrapRef readonly getCurrentScope: UnwrapRef readonly getDeep: UnwrapRef + readonly globalShowPopup: UnwrapRef readonly h: UnwrapRef readonly hourStyle: UnwrapRef readonly ignorableWatch: UnwrapRef @@ -454,7 +455,6 @@ declare module 'vue' { readonly shallowReadonly: UnwrapRef readonly shallowRef: UnwrapRef readonly showAllContainers: UnwrapRef - readonly showPopup: UnwrapRef readonly showTimestamp: UnwrapRef readonly size: UnwrapRef readonly smallerScrollbars: UnwrapRef diff --git a/assets/components/LogViewer/ComplexLogItem.vue b/assets/components/LogViewer/ComplexLogItem.vue index 3e37504f..01b74593 100644 --- a/assets/components/LogViewer/ComplexLogItem.vue +++ b/assets/components/LogViewer/ComplexLogItem.vue @@ -7,11 +7,12 @@
-
    -
  • - {{ name }}= - +
      +
    • + {{ name }}=
    • +
    • all values are hidden
@@ -27,11 +28,11 @@ const { logEntry } = defineProps<{ visibleKeys: string[][]; }>(); -let expanded = $ref(false); +const [expanded, expandToggle] = useToggle(); -function validValues(obj: Record) { - return Object.fromEntries(Object.entries(obj).filter(([_, value]) => value !== undefined)); -} +const validValues = computed(() => { + return Object.fromEntries(Object.entries(logEntry.message).filter(([_, value]) => value !== undefined)); +});