diff --git a/assets/components/LogViewer/DockerEventLogItem.vue b/assets/components/LogViewer/DockerEventLogItem.vue index 5db7896b..a05ce228 100644 --- a/assets/components/LogViewer/DockerEventLogItem.vue +++ b/assets/components/LogViewer/DockerEventLogItem.vue @@ -6,10 +6,7 @@
-
+

{{ $t("alert.similar-container-found.title") }}

@@ -45,18 +42,25 @@ const store = useContainerStore(); const { containers: allContainers } = storeToRefs(store); -const nextContainer = computed(() => - containers.value.length === 1 && logEntry.event === "container-stopped" - ? [ - ...allContainers.value.filter( - (c) => - c.host === containers.value[0].host && - c.created > logEntry.date && - c.name === containers.value[0].name && - c.state === "running", - ), - ].sort((a, b) => +a.created - +b.created)[0] - : null, +const nextContainer = computed( + () => + [ + ...allContainers.value.filter( + (c) => + c.host === containers.value[0].host && + c.created > logEntry.date && + c.name === containers.value[0].name && + c.state === "running", + ), + ].sort((a, b) => +a.created - +b.created)[0], +); + +const followEligible = computed( + () => + router.currentRoute.value.name === "container-id" && + logEntry.event === "container-stopped" && + containers.value.length === 1 && + nextContainer.value !== undefined, ); function redirectNow() {