From 85271a595ade08b4a0a76622e76b1b8ce3a1534c Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Wed, 28 Aug 2024 17:37:04 -0700 Subject: [PATCH] feat: adds a side panel for complex logs that enables reordering and enabling fields (#3237) --- assets/auto-imports.d.ts | 11 ++ assets/components.d.ts | 3 + assets/components/FuzzySearchModal.vue | 7 +- .../components/GroupedViewer/GroupedLog.vue | 3 +- .../components/LogViewer/ComplexLogItem.vue | 15 +-- assets/components/LogViewer/FieldList.vue | 74 ----------- assets/components/LogViewer/LogDetails.vue | 119 ++++++++++++++++++ assets/components/LogViewer/LogLevel.vue | 11 +- assets/components/LogViewer/LogList.vue | 8 +- .../LogViewer/LogMessageActions.vue | 4 +- assets/components/LogViewer/LogViewer.vue | 20 +-- .../components/LogViewer/ViewerWithSource.vue | 2 +- .../__snapshots__/EventSource.spec.ts.snap | 20 ++- .../MultiContainerLog.vue | 5 +- assets/components/ScrollableView.vue | 4 +- .../components/ServiceViewer/ServiceLog.vue | 3 +- assets/components/StackViewer/StackLog.vue | 3 +- assets/components/common/SideDrawer.vue | 34 +++++ assets/composable/profileStorage.ts | 36 +++++- assets/composable/showLogDetails.ts | 22 ++++ assets/composable/storage.ts | 26 ++-- assets/composable/visible.ts | 2 +- assets/models/LogEntry.ts | 17 +-- assets/pages/settings.vue | 3 - assets/stores/config.ts | 2 +- assets/utils/index.ts | 22 +++- internal/profile/disk.go | 12 +- internal/web/auth_test.go | 1 + locales/en.yml | 6 +- package.json | 3 +- pnpm-lock.yaml | 21 +++- 31 files changed, 345 insertions(+), 174 deletions(-) delete mode 100644 assets/components/LogViewer/FieldList.vue create mode 100644 assets/components/LogViewer/LogDetails.vue create mode 100644 assets/components/common/SideDrawer.vue create mode 100644 assets/composable/showLogDetails.ts diff --git a/assets/auto-imports.d.ts b/assets/auto-imports.d.ts index 247ab533..a81ea7b3 100644 --- a/assets/auto-imports.d.ts +++ b/assets/auto-imports.d.ts @@ -50,6 +50,7 @@ declare global { const effectScope: typeof import('vue')['effectScope'] const extendRef: typeof import('@vueuse/core')['extendRef'] const flattenJSON: typeof import('./utils/index')['flattenJSON'] + const flattenJSONToMap: typeof import('./utils/index')['flattenJSONToMap'] const formatBytes: typeof import('./utils/index')['formatBytes'] const getActivePinia: typeof import('pinia')['getActivePinia'] const getCurrentInstance: typeof import('vue')['getCurrentInstance'] @@ -104,6 +105,7 @@ declare global { const persistentVisibleKeysForContainer: typeof import('./composable/storage')['persistentVisibleKeysForContainer'] const pinnedContainers: typeof import('./composable/storage')['pinnedContainers'] const provide: typeof import('vue')['provide'] + const provideDetails: typeof import('./composable/showDetails')['provideDetails'] const provideLocal: typeof import('@vueuse/core')['provideLocal'] const provideLogDetails: typeof import('./composable/showLogDetails')['provideLogDetails'] const provideLoggingContext: typeof import('./composable/logContext')['provideLoggingContext'] @@ -205,6 +207,7 @@ declare global { const useDebounce: typeof import('@vueuse/core')['useDebounce'] const useDebounceFn: typeof import('@vueuse/core')['useDebounceFn'] const useDebouncedRefHistory: typeof import('@vueuse/core')['useDebouncedRefHistory'] + const useDetails: typeof import('./composable/showDetails')['useDetails'] const useDeviceMotion: typeof import('@vueuse/core')['useDeviceMotion'] const useDeviceOrientation: typeof import('@vueuse/core')['useDeviceOrientation'] const useDevicePixelRatio: typeof import('@vueuse/core')['useDevicePixelRatio'] @@ -413,6 +416,7 @@ declare module 'vue' { readonly effectScope: UnwrapRef readonly extendRef: UnwrapRef readonly flattenJSON: UnwrapRef + readonly flattenJSONToMap: UnwrapRef readonly formatBytes: UnwrapRef readonly getActivePinia: UnwrapRef readonly getCurrentInstance: UnwrapRef @@ -468,6 +472,7 @@ declare module 'vue' { readonly pinnedContainers: UnwrapRef readonly provide: UnwrapRef readonly provideLocal: UnwrapRef + readonly provideLogDetails: UnwrapRef readonly provideLoggingContext: UnwrapRef readonly provideScrollContext: UnwrapRef readonly reactify: UnwrapRef @@ -497,6 +502,7 @@ declare module 'vue' { readonly shallowReadonly: UnwrapRef readonly shallowRef: UnwrapRef readonly showAllContainers: UnwrapRef + readonly showLogDetails: UnwrapRef readonly showStd: UnwrapRef readonly showTimestamp: UnwrapRef readonly size: UnwrapRef @@ -607,6 +613,7 @@ declare module 'vue' { readonly useKeyModifier: UnwrapRef readonly useLastChanged: UnwrapRef readonly useLocalStorage: UnwrapRef + readonly useLogDetails: UnwrapRef readonly useLogSearchContext: UnwrapRef readonly useLoggingContext: UnwrapRef readonly useMagicKeys: UnwrapRef @@ -766,6 +773,7 @@ declare module '@vue/runtime-core' { readonly effectScope: UnwrapRef readonly extendRef: UnwrapRef readonly flattenJSON: UnwrapRef + readonly flattenJSONToMap: UnwrapRef readonly formatBytes: UnwrapRef readonly getActivePinia: UnwrapRef readonly getCurrentInstance: UnwrapRef @@ -821,6 +829,7 @@ declare module '@vue/runtime-core' { readonly pinnedContainers: UnwrapRef readonly provide: UnwrapRef readonly provideLocal: UnwrapRef + readonly provideLogDetails: UnwrapRef readonly provideLoggingContext: UnwrapRef readonly provideScrollContext: UnwrapRef readonly reactify: UnwrapRef @@ -850,6 +859,7 @@ declare module '@vue/runtime-core' { readonly shallowReadonly: UnwrapRef readonly shallowRef: UnwrapRef readonly showAllContainers: UnwrapRef + readonly showLogDetails: UnwrapRef readonly showStd: UnwrapRef readonly showTimestamp: UnwrapRef readonly size: UnwrapRef @@ -960,6 +970,7 @@ declare module '@vue/runtime-core' { readonly useKeyModifier: UnwrapRef readonly useLastChanged: UnwrapRef readonly useLocalStorage: UnwrapRef + readonly useLogDetails: UnwrapRef readonly useLogSearchContext: UnwrapRef readonly useLoggingContext: UnwrapRef readonly useMagicKeys: UnwrapRef diff --git a/assets/components.d.ts b/assets/components.d.ts index 4f6e7e14..e0487b12 100644 --- a/assets/components.d.ts +++ b/assets/components.d.ts @@ -49,6 +49,7 @@ declare module 'vue' { LabeledInput: typeof import('./components/common/LabeledInput.vue')['default'] Links: typeof import('./components/Links.vue')['default'] LogDate: typeof import('./components/LogViewer/LogDate.vue')['default'] + LogDetails: typeof import('./components/LogViewer/LogDetails.vue')['default'] LogLevel: typeof import('./components/LogViewer/LogLevel.vue')['default'] LogList: typeof import('./components/LogViewer/LogList.vue')['default'] LogMessageActions: typeof import('./components/LogViewer/LogMessageActions.vue')['default'] @@ -69,6 +70,7 @@ declare module 'vue' { 'Mdi:hexagonMultiple': typeof import('~icons/mdi/hexagon-multiple')['default'] 'Mdi:keyboardEsc': typeof import('~icons/mdi/keyboard-esc')['default'] 'Mdi:magnify': typeof import('~icons/mdi/magnify')['default'] + 'Mdi:mdi:close': typeof import('~icons/mdi/mdi')['default'] 'Mdi:satelliteVariant': typeof import('~icons/mdi/satellite-variant')['default'] MobileMenu: typeof import('./components/common/MobileMenu.vue')['default'] MultiContainerActionToolbar: typeof import('./components/LogViewer/MultiContainerActionToolbar.vue')['default'] @@ -97,6 +99,7 @@ declare module 'vue' { ScrollProgress: typeof import('./components/ScrollProgress.vue')['default'] Search: typeof import('./components/Search.vue')['default'] ServiceLog: typeof import('./components/ServiceViewer/ServiceLog.vue')['default'] + SideDrawer: typeof import('./components/common/SideDrawer.vue')['default'] SideMenu: typeof import('./components/SideMenu.vue')['default'] SidePanel: typeof import('./components/SidePanel.vue')['default'] SimpleLogItem: typeof import('./components/LogViewer/SimpleLogItem.vue')['default'] diff --git a/assets/components/FuzzySearchModal.vue b/assets/components/FuzzySearchModal.vue index 7940357e..f1846f43 100644 --- a/assets/components/FuzzySearchModal.vue +++ b/assets/components/FuzzySearchModal.vue @@ -13,7 +13,12 @@ v-model="query" :placeholder="$t('placeholder.search-containers')" /> - +
+ +