From e31e3138fbd48dd4dd9687f5404702a7bbd8e238 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Fri, 22 Sep 2023 12:24:05 -0700 Subject: [PATCH] chore: creates a container context (#2388) * chore: creates a container context * fixes tests * fixes tests --- assets/auto-imports.d.ts | 7 ++++++ assets/components/LogViewer/ContainerStat.vue | 5 +--- .../components/LogViewer/ContainerTitle.vue | 5 +--- .../LogViewer/LogActionsToolbar.vue | 6 +---- assets/components/LogViewer/LogContainer.vue | 6 +---- .../LogViewer/LogEventSource.spec.ts | 9 ++++--- .../components/LogViewer/LogEventSource.vue | 8 ++---- assets/components/LogViewer/LogViewer.vue | 8 +++--- .../__snapshots__/LogEventSource.spec.ts.snap | 12 ++++----- assets/composables/containerContext.ts | 23 ++++++++++++++++++ assets/composables/eventsource.ts | 4 +-- assets/composables/storage.ts | 2 +- ...default-homepage-1-Mobile-Chrome-linux.png | Bin 8805 -> 8904 bytes .../default-homepage-1-chromium-linux.png | Bin 11628 -> 11753 bytes 14 files changed, 56 insertions(+), 39 deletions(-) create mode 100644 assets/composables/containerContext.ts diff --git a/assets/auto-imports.d.ts b/assets/auto-imports.d.ts index ad4163ae..2ee126d6 100644 --- a/assets/auto-imports.d.ts +++ b/assets/auto-imports.d.ts @@ -25,6 +25,7 @@ declare global { const computedInject: typeof import('@vueuse/core')['computedInject'] const computedWithControl: typeof import('@vueuse/core')['computedWithControl'] const config: typeof import('./stores/config')['default'] + const containerContext: typeof import('./composables/containerContext')['containerContext'] const controlledComputed: typeof import('@vueuse/core')['controlledComputed'] const controlledRef: typeof import('@vueuse/core')['controlledRef'] const createApp: typeof import('vue')['createApp'] @@ -102,6 +103,7 @@ declare global { const persistentVisibleKeys: typeof import('./composables/storage')['persistentVisibleKeys'] const pinnedContainers: typeof import('./composables/storage')['pinnedContainers'] const provide: typeof import('vue')['provide'] + const provideContainerContext: typeof import('./composables/containerContext')['provideContainerContext'] const reactify: typeof import('@vueuse/core')['reactify'] const reactifyObject: typeof import('@vueuse/core')['reactifyObject'] const reactive: typeof import('vue')['reactive'] @@ -186,6 +188,7 @@ declare global { const useCloned: typeof import('@vueuse/core')['useCloned'] const useColorMode: typeof import('@vueuse/core')['useColorMode'] const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog'] + const useContainerContext: typeof import('./composables/containerContext')['useContainerContext'] const useContainerStore: typeof import('./stores/container')['useContainerStore'] const useCounter: typeof import('@vueuse/core')['useCounter'] const useCssModule: typeof import('vue')['useCssModule'] @@ -453,6 +456,7 @@ declare module 'vue' { readonly persistentVisibleKeys: UnwrapRef readonly pinnedContainers: UnwrapRef readonly provide: UnwrapRef + readonly provideContainerContext: UnwrapRef readonly reactify: UnwrapRef readonly reactifyObject: UnwrapRef readonly reactive: UnwrapRef @@ -533,6 +537,7 @@ declare module 'vue' { readonly useCloned: UnwrapRef readonly useColorMode: UnwrapRef readonly useConfirmDialog: UnwrapRef + readonly useContainerContext: UnwrapRef readonly useContainerStore: UnwrapRef readonly useCounter: UnwrapRef readonly useCssModule: UnwrapRef @@ -785,6 +790,7 @@ declare module '@vue/runtime-core' { readonly persistentVisibleKeys: UnwrapRef readonly pinnedContainers: UnwrapRef readonly provide: UnwrapRef + readonly provideContainerContext: UnwrapRef readonly reactify: UnwrapRef readonly reactifyObject: UnwrapRef readonly reactive: UnwrapRef @@ -865,6 +871,7 @@ declare module '@vue/runtime-core' { readonly useCloned: UnwrapRef readonly useColorMode: UnwrapRef readonly useConfirmDialog: UnwrapRef + readonly useContainerContext: UnwrapRef readonly useContainerStore: UnwrapRef readonly useCounter: UnwrapRef readonly useCssModule: UnwrapRef diff --git a/assets/components/LogViewer/ContainerStat.vue b/assets/components/LogViewer/ContainerStat.vue index 15572a5f..74a37aae 100644 --- a/assets/components/LogViewer/ContainerStat.vue +++ b/assets/components/LogViewer/ContainerStat.vue @@ -6,10 +6,7 @@