From 673660b123107792b42586de1f5f36118b33012c Mon Sep 17 00:00:00 2001 From: Braxen Date: Thu, 2 Nov 2023 14:22:52 +0100 Subject: [PATCH] fix websocket log recv --- client-vue/src/App.vue | 2 +- client-vue/src/components/LogViewer.vue | 8 ++++---- common/Log.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client-vue/src/App.vue b/client-vue/src/App.vue index e96aa8f7..853e5d24 100644 --- a/client-vue/src/App.vue +++ b/client-vue/src/App.vue @@ -395,7 +395,7 @@ function handleWebsocketMessage(action: WebhookAction, data: any) { // merge log lines const newLines: WinstonLogLine[] = data; - if (newLines.some((line) => line.metadata.timestamp && parseISO(line.metadata.timestamp).getDay() != new Date().getDay())) { + if (newLines.some((line) => line.timestamp && parseISO(line.timestamp).getDay() != new Date().getDay())) { // new day, clear log store.clearLog(); store.addLog(newLines); diff --git a/client-vue/src/components/LogViewer.vue b/client-vue/src/components/LogViewer.vue index 59bb703d..e2e2d367 100644 --- a/client-vue/src/components/LogViewer.vue +++ b/client-vue/src/components/LogViewer.vue @@ -15,12 +15,12 @@
-
- {{ formatDate(line.metadata.timestamp) }} + + {{ formatDate(line.timestamp) }} (no date) - {{ line.metadata.module }} + {{ line.module }} {{ line.level || "UNKNOWN" }} @@ -61,7 +61,7 @@ const logViewer = ref(null); const logFiltered = computed((): WinstonLogLine[] => { return logLines.value.filter((line) => { if (logModule.value) { - return line.metadata.module === logModule.value; + return line.module === logModule.value; } return true; }); diff --git a/common/Log.ts b/common/Log.ts index 751c1c34..08b4b058 100644 --- a/common/Log.ts +++ b/common/Log.ts @@ -3,7 +3,7 @@ export interface WinstonLogLine { level: string; module: string; timestamp: string; - metadata: { + metadata?: { [key: string]: any; module: string; timestamp: string;