diff --git a/assets/components/LogViewer/ContainerEventLogItem.vue b/assets/components/LogViewer/ContainerEventLogItem.vue index 2d63d2ef..c933b6d3 100644 --- a/assets/components/LogViewer/ContainerEventLogItem.vue +++ b/assets/components/LogViewer/ContainerEventLogItem.vue @@ -3,16 +3,24 @@
-
+

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

{{ $t("alert.similar-container-found.message", { containerId: nextContainer.id }) }}
- {{ - $t("button.cancel") - }} + + {{ $t("button.cancel") }} + (); -const { currentContainer } = useContainerStore(); -const container = currentContainer(toRef(() => logEntry.containerID)); +const showCard = ref(true); const { containers } = useLoggingContext(); const store = useContainerStore(); const { containers: allContainers } = storeToRefs(store); @@ -44,18 +51,18 @@ const nextContainer = computed( () => [ ...allContainers.value.filter( - (c) => - c.host === container.value.host && c.created > container.value.created && c.name === container.value.name, + (c) => c.created > containers.value[0].created && c.name === containers.value[0].name, ), ].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, + router.currentRoute.value.name === "/container/[id]" && // we are on a container page + logEntry.event === "container-stopped" && // container was stopped + containers.value.length === 1 && // only one container + Date.now() - +logEntry.date < 5 * 60 * 1000 && // was stopped in the last 5 minutes + nextContainer.value !== undefined, // there is a next container ); function redirectNow() {