From c268fa4e8be28d6d0cf8428c3e005ca8ea99836f Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Fri, 24 May 2024 13:04:50 -0700 Subject: [PATCH] fix: bug when a new container in service mode is created (#2982) --- assets/components/HostMenu.vue | 2 +- assets/components/LogViewer/ContainerName.vue | 7 +- .../LogViewer/DockerEventLogItem.vue | 84 ++++++++++--------- assets/models/Container.spec.ts | 38 --------- assets/models/Container.ts | 28 ++++--- 5 files changed, 62 insertions(+), 97 deletions(-) delete mode 100644 assets/models/Container.spec.ts diff --git a/assets/components/HostMenu.vue b/assets/components/HostMenu.vue index 22fa5abd..8ed8152a 100644 --- a/assets/components/HostMenu.vue +++ b/assets/components/HostMenu.vue @@ -52,7 +52,7 @@ :title="item.name" >
- {{ item.name }}{{ item.swarmId }} + {{ item.name }}.{{ item.swarmId }}
(); -const { containers } = useLoggingContext(); - const colors = [ "#4B0082", "#FF00FF", @@ -32,10 +30,7 @@ const colors = [ "#FF4040", ] as const; -const color = computed(() => { - const index = containers.value.findIndex((container) => container.id === id); - return colors[index % colors.length]; -}); +const color = computed(() => colors[Math.abs(hashCode(id)) % colors.length]);