From 69d380e5bd5ac4091bec0b0930091451c95581e0 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Wed, 11 Dec 2024 11:04:15 -0800 Subject: [PATCH 1/2] fix: fixes redirect when container was created before it was stopped --- .../components/LogViewer/ContainerEventLogItem.vue | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/assets/components/LogViewer/ContainerEventLogItem.vue b/assets/components/LogViewer/ContainerEventLogItem.vue index 06bdf2ad..b7c53e06 100644 --- a/assets/components/LogViewer/ContainerEventLogItem.vue +++ b/assets/components/LogViewer/ContainerEventLogItem.vue @@ -33,19 +33,15 @@ const router = useRouter(); const { showToast } = useToast(); const { t } = useI18n(); -const { currentContainer } = useContainerStore(); - -const container = currentContainer(toRef(() => logEntry.containerID)); - const { logEntry } = defineProps<{ logEntry: ContainerEventLogEntry; showContainerName?: boolean; }>(); +const { currentContainer } = useContainerStore(); +const container = currentContainer(toRef(() => logEntry.containerID)); const { containers } = useLoggingContext(); - const store = useContainerStore(); - const { containers: allContainers } = storeToRefs(store); const nextContainer = computed( @@ -53,9 +49,9 @@ const nextContainer = computed( [ ...allContainers.value.filter( (c) => - c.host === containers.value[0].host && - c.created > logEntry.date && - c.name === containers.value[0].name && + c.host === container.value.host && + c.created > container.value.created && + c.name === container.value.name && c.state === "running", ), ].sort((a, b) => +a.created - +b.created)[0], From f50d45dcb2a771c334c65be1c4d8885e950ae0b5 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Thu, 12 Dec 2024 08:07:04 -0800 Subject: [PATCH 2/2] removes running --- assets/components/LogViewer/ContainerEventLogItem.vue | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/assets/components/LogViewer/ContainerEventLogItem.vue b/assets/components/LogViewer/ContainerEventLogItem.vue index b7c53e06..22eaa5cd 100644 --- a/assets/components/LogViewer/ContainerEventLogItem.vue +++ b/assets/components/LogViewer/ContainerEventLogItem.vue @@ -49,10 +49,7 @@ const nextContainer = computed( [ ...allContainers.value.filter( (c) => - c.host === container.value.host && - c.created > container.value.created && - c.name === container.value.name && - c.state === "running", + c.host === container.value.host && c.created > container.value.created && c.name === container.value.name, ), ].sort((a, b) => +a.created - +b.created)[0], );