Skip to content

Commit

Permalink
fix websocket log recv
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBrax committed Nov 2, 2023
1 parent 9c5faca commit 673660b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client-vue/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions client-vue/src/components/LogViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
<div ref="logViewer" class="log_viewer">
<table>
<tr v-for="(line, lineIndex) in logFiltered" :key="lineIndex" :class="logLineClass(line)">
<td v-if="line.metadata.timestamp">
{{ formatDate(line.metadata.timestamp) }}
<td v-if="line.timestamp">
{{ formatDate(line.timestamp) }}
</td>
<td v-else>(no date)</td>
<td>
<a @click="logSetFilter(line.metadata.module)">{{ line.metadata.module }}</a>
<a @click="logSetFilter(line.module)">{{ line.module }}</a>
</td>
<td>
{{ line.level || "UNKNOWN" }}
Expand Down Expand Up @@ -61,7 +61,7 @@ const logViewer = ref<HTMLElement | null>(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;
});
Expand Down
2 changes: 1 addition & 1 deletion common/Log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export interface WinstonLogLine {
level: string;
module: string;
timestamp: string;
metadata: {
metadata?: {
[key: string]: any;
module: string;
timestamp: string;
Expand Down

0 comments on commit 673660b

Please sign in to comment.