Skip to content

Commit 65ef1d3

Browse files
authored
fix: shows container and host name correctly for events. (#3494)
1 parent f4f61a6 commit 65ef1d3

File tree

2 files changed

+21
-25
lines changed

2 files changed

+21
-25
lines changed

assets/components/LogViewer/ContainerEventLogItem.vue

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
11
<template>
2-
<div class="flex w-full flex-col">
3-
<div class="relative flex items-start gap-x-2">
4-
<RandomColorTag class="flex-none" :value="container.name" v-if="showContainerName" />
5-
<LogDate :date="logEntry.date" v-if="showTimestamp" />
6-
<LogLevel class="flex" />
7-
<div class="whitespace-pre-wrap" :data-event="logEntry.event" v-html="logEntry.message"></div>
2+
<LogItem :logEntry>
3+
<div class="whitespace-pre-wrap" :data-event="logEntry.event" v-html="logEntry.message"></div>
4+
</LogItem>
5+
6+
<div class="alert alert-info my-4 w-auto flex-none font-sans text-[1rem] md:mx-auto md:w-1/2" v-if="followEligible">
7+
<carbon:information class="size-6 shrink-0 stroke-current" />
8+
<div>
9+
<h3 class="text-lg font-bold">{{ $t("alert.similar-container-found.title") }}</h3>
10+
{{ $t("alert.similar-container-found.message", { containerId: nextContainer.id }) }}
811
</div>
9-
<div class="alert alert-info mt-8 w-auto flex-none font-sans text-[1rem] md:mx-auto md:w-1/2" v-if="followEligible">
10-
<carbon:information class="size-6 shrink-0 stroke-current" />
11-
<div>
12-
<h3 class="text-lg font-bold">{{ $t("alert.similar-container-found.title") }}</h3>
13-
{{ $t("alert.similar-container-found.message", { containerId: nextContainer.id }) }}
14-
</div>
15-
<div>
16-
<TimedButton v-if="automaticRedirect" class="btn-primary btn-sm" @finished="redirectNow()">{{
17-
$t("button.cancel")
18-
}}</TimedButton>
19-
<router-link
20-
:to="{ name: '/container/[id]', params: { id: nextContainer.id } }"
21-
class="btn btn-primary btn-sm"
22-
v-else
23-
>
24-
{{ $t("button.redirect") }}
25-
</router-link>
26-
</div>
12+
<div>
13+
<TimedButton v-if="automaticRedirect" class="btn-primary btn-sm" @finished="redirectNow()">{{
14+
$t("button.cancel")
15+
}}</TimedButton>
16+
<router-link
17+
:to="{ name: '/container/[id]', params: { id: nextContainer.id } }"
18+
class="btn btn-primary btn-sm"
19+
v-else
20+
>
21+
{{ $t("button.redirect") }}
22+
</router-link>
2723
</div>
2824
</div>
2925
</template>

assets/models/LogEntry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export class ContainerEventLogEntry extends LogEntry<string> {
135135
date: Date,
136136
public readonly event: "container-stopped" | "container-started",
137137
) {
138-
super(message, containerID, date.getTime(), date, "stderr", "info");
138+
super(message, containerID, date.getTime(), date, "stderr", "unknown");
139139
}
140140
getComponent(): Component {
141141
return ContainerEventLogItem;

0 commit comments

Comments
 (0)