From 0e5830df20322657685fc36cc2fad7c6277ff363 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Wed, 25 Jan 2023 10:39:21 -0800 Subject: [PATCH] Makes changes to log streamer to guess the event level (#2013) * Makes changes to log streamer to guess the event level * Updates diff * Adds log class for level * Groups messages by level * Fixes bugs for grouping * Fixes tests * Fixes json bug * Updates logic to support other kind of levels * Fixes mobile view --- assets/components.d.ts | 1 + .../components/LogViewer/ComplexLogItem.vue | 5 +- assets/components/LogViewer/LogLevel.vue | 56 ++++++ assets/components/LogViewer/SimpleLogItem.vue | 5 +- .../__snapshots__/LogEventSource.spec.ts.snap | 32 +++- assets/models/LogEntry.ts | 35 +++- docker/log_iterator.go | 164 ++++++++++++++++++ docker/types.go | 26 ++- web/__snapshots__/web.snapshot | 4 +- web/logs.go | 55 ++---- 10 files changed, 317 insertions(+), 66 deletions(-) create mode 100644 assets/components/LogViewer/LogLevel.vue create mode 100644 docker/log_iterator.go diff --git a/assets/components.d.ts b/assets/components.d.ts index cbb3a372..f427c7ef 100644 --- a/assets/components.d.ts +++ b/assets/components.d.ts @@ -22,6 +22,7 @@ declare module '@vue/runtime-core' { LogContainer: typeof import('./components/LogViewer/LogContainer.vue')['default'] LogDate: typeof import('./components/LogViewer/LogDate.vue')['default'] LogEventSource: typeof import('./components/LogViewer/LogEventSource.vue')['default'] + LogLevel: typeof import('./components/LogViewer/LogLevel.vue')['default'] LogViewer: typeof import('./components/LogViewer/LogViewer.vue')['default'] LogViewerWithSource: typeof import('./components/LogViewer/LogViewerWithSource.vue')['default'] MdiDotsVertical: typeof import('~icons/mdi/dots-vertical')['default'] diff --git a/assets/components/LogViewer/ComplexLogItem.vue b/assets/components/LogViewer/ComplexLogItem.vue index a3df7e90..288e2b04 100644 --- a/assets/components/LogViewer/ComplexLogItem.vue +++ b/assets/components/LogViewer/ComplexLogItem.vue @@ -1,8 +1,11 @@