Skip to content

Commit

Permalink
fix: shows container and host name correctly for events. (#3494)
Browse files Browse the repository at this point in the history
  • Loading branch information
amir20 authored Dec 31, 2024
1 parent f4f61a6 commit 65ef1d3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 25 deletions.
44 changes: 20 additions & 24 deletions assets/components/LogViewer/ContainerEventLogItem.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
<template>
<div class="flex w-full flex-col">
<div class="relative flex items-start gap-x-2">
<RandomColorTag class="flex-none" :value="container.name" v-if="showContainerName" />
<LogDate :date="logEntry.date" v-if="showTimestamp" />
<LogLevel class="flex" />
<div class="whitespace-pre-wrap" :data-event="logEntry.event" v-html="logEntry.message"></div>
<LogItem :logEntry>
<div class="whitespace-pre-wrap" :data-event="logEntry.event" v-html="logEntry.message"></div>
</LogItem>

<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">
<carbon:information class="size-6 shrink-0 stroke-current" />
<div>
<h3 class="text-lg font-bold">{{ $t("alert.similar-container-found.title") }}</h3>
{{ $t("alert.similar-container-found.message", { containerId: nextContainer.id }) }}
</div>
<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">
<carbon:information class="size-6 shrink-0 stroke-current" />
<div>
<h3 class="text-lg font-bold">{{ $t("alert.similar-container-found.title") }}</h3>
{{ $t("alert.similar-container-found.message", { containerId: nextContainer.id }) }}
</div>
<div>
<TimedButton v-if="automaticRedirect" class="btn-primary btn-sm" @finished="redirectNow()">{{
$t("button.cancel")
}}</TimedButton>
<router-link
:to="{ name: '/container/[id]', params: { id: nextContainer.id } }"
class="btn btn-primary btn-sm"
v-else
>
{{ $t("button.redirect") }}
</router-link>
</div>
<div>
<TimedButton v-if="automaticRedirect" class="btn-primary btn-sm" @finished="redirectNow()">{{
$t("button.cancel")
}}</TimedButton>
<router-link
:to="{ name: '/container/[id]', params: { id: nextContainer.id } }"
class="btn btn-primary btn-sm"
v-else
>
{{ $t("button.redirect") }}
</router-link>
</div>
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion assets/models/LogEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class ContainerEventLogEntry extends LogEntry<string> {
date: Date,
public readonly event: "container-stopped" | "container-started",
) {
super(message, containerID, date.getTime(), date, "stderr", "info");
super(message, containerID, date.getTime(), date, "stderr", "unknown");
}
getComponent(): Component {
return ContainerEventLogItem;
Expand Down

0 comments on commit 65ef1d3

Please sign in to comment.