From e6fa8ced58129f2d598da9fbac6444c0b5a86452 Mon Sep 17 00:00:00 2001
From: Akash Ramaswamy <87078332+akash-ramaswamy@users.noreply.github.com>
Date: Sat, 9 Dec 2023 19:26:51 +0530
Subject: [PATCH] feat: actions on log messages (#2572)
---
assets/components.d.ts | 4 ++
.../components/LogViewer/ComplexLogItem.vue | 7 +++-
.../components/LogViewer/CopyLogMessage.vue | 39 +++++++++++++++++++
.../LogViewer/LogEventSource.spec.ts | 3 +-
assets/components/LogViewer/LogViewer.vue | 1 +
assets/components/LogViewer/SimpleLogItem.vue | 6 ++-
.../__snapshots__/LogEventSource.spec.ts.snap | 30 ++++++++------
locales/en.yml | 7 ++++
8 files changed, 82 insertions(+), 15 deletions(-)
create mode 100644 assets/components/LogViewer/CopyLogMessage.vue
diff --git a/assets/components.d.ts b/assets/components.d.ts
index e631d3aa..970c6fcf 100644
--- a/assets/components.d.ts
+++ b/assets/components.d.ts
@@ -10,10 +10,13 @@ declare module 'vue' {
BarChart: typeof import('./components/BarChart.vue')['default']
'Carbon:caretDown': typeof import('~icons/carbon/caret-down')['default']
'Carbon:circleSolid': typeof import('~icons/carbon/circle-solid')['default']
+ 'Carbon:copyFile': typeof import('~icons/carbon/copy-file')['default']
'Carbon:information': typeof import('~icons/carbon/information')['default']
'Carbon:macShift': typeof import('~icons/carbon/mac-shift')['default']
'Carbon:play': typeof import('~icons/carbon/play')['default']
'Carbon:restart': typeof import('~icons/carbon/restart')['default']
+ 'Carbon:rowCollapse': typeof import('~icons/carbon/row-collapse')['default']
+ 'Carbon:rowExpand': typeof import('~icons/carbon/row-expand')['default']
'Carbon:star': typeof import('~icons/carbon/star')['default']
'Carbon:starFilled': typeof import('~icons/carbon/star-filled')['default']
'Carbon:stopFilledAlt': typeof import('~icons/carbon/stop-filled-alt')['default']
@@ -28,6 +31,7 @@ declare module 'vue' {
ContainerStat: typeof import('./components/LogViewer/ContainerStat.vue')['default']
ContainerTable: typeof import('./components/ContainerTable.vue')['default']
ContainerTitle: typeof import('./components/LogViewer/ContainerTitle.vue')['default']
+ CopyLogMessage: typeof import('./components/LogViewer/CopyLogMessage.vue')['default']
DateTime: typeof import('./components/common/DateTime.vue')['default']
DistanceTime: typeof import('./components/common/DistanceTime.vue')['default']
DockerEventLogItem: typeof import('./components/LogViewer/DockerEventLogItem.vue')['default']
diff --git a/assets/components/LogViewer/ComplexLogItem.vue b/assets/components/LogViewer/ComplexLogItem.vue
index 5f5e4cd9..73e76c4d 100644
--- a/assets/components/LogViewer/ComplexLogItem.vue
+++ b/assets/components/LogViewer/ComplexLogItem.vue
@@ -1,5 +1,5 @@
-
diff --git a/assets/components/LogViewer/LogEventSource.spec.ts b/assets/components/LogViewer/LogEventSource.spec.ts
index 13aad530..ea45c053 100644
--- a/assets/components/LogViewer/LogEventSource.spec.ts
+++ b/assets/components/LogViewer/LogEventSource.spec.ts
@@ -10,6 +10,7 @@ import { vi, describe, expect, beforeEach, test, afterEach } from "vitest";
import { computed, nextTick } from "vue";
import { createRouter, createWebHistory } from "vue-router";
import { containerContext } from "@/composable/containerContext";
+import { createI18n } from "vue-i18n";
vi.mock("@/stores/config", () => ({
__esModule: true,
@@ -68,7 +69,7 @@ describe("", () => {
return mount(LogEventSource, {
global: {
- plugins: [router, createTestingPinia({ createSpy: vi.fn })],
+ plugins: [router, createTestingPinia({ createSpy: vi.fn }), createI18n({})],
components: {
LogViewer,
},
diff --git a/assets/components/LogViewer/LogViewer.vue b/assets/components/LogViewer/LogViewer.vue
index 42291668..e1aff591 100644
--- a/assets/components/LogViewer/LogViewer.vue
+++ b/assets/components/LogViewer/LogViewer.vue
@@ -5,6 +5,7 @@
:key="item.id"
:data-key="item.id"
:class="{ 'border border-secondary': toRaw(item) === toRaw(lastSelectedItem) }"
+ class="group/entry"
>
-