11<template >
2- <div class =" @container flex flex-1 gap-1.5 truncate md:gap-2" >
2+ <div class =" @container flex flex-1 items-center gap-1.5 truncate md:gap-2" >
33 <label class =" swap swap-rotate size-4" >
44 <input type =" checkbox" v-model =" pinned" />
55 <carbon:star-filled class =" swap-on text-secondary" />
66 <carbon:star class =" swap-off" />
77 </label >
8- <div class =" inline-flex font-mono text-sm" >
9- <div v-if =" config.hosts.length > 1" class =" mobile-hidden font-thin" >
10- {{ container.hostLabel }}<span class =" mx-2" >/</span >
11- </div >
12- <div class =" font-semibold" >{{ container.name }}</div >
13- <div
14- class =" mobile-hidden max-w-[1.5em] truncate transition-[max-width] hover:max-w-[400px]"
15- v-if =" container.isSwarm"
16- >
17- .{{ container.swarmId }}
8+ <div class =" inline-flex items-center text-sm" >
9+ <div class =" breadcrumbs p-0" >
10+ <ul >
11+ <li v-if =" config.hosts.length > 1" class =" mobile-hidden font-thin" >
12+ {{ container.hostLabel }}
13+ </li >
14+ <li >
15+ <div class =" wrapper" ref =" wrapper" >
16+ <button popovertarget =" popover-container-list" class =" btn btn-xs md:btn-sm anchor font-mono" >
17+ {{ container.name }} <carbon:caret-down />
18+ </button >
19+ <ul popover id =" popover-container-list" class =" dropdown menu rounded-box bg-base-100 tethered shadow-sm" >
20+ <li v-for =" other in otherContainers" >
21+ <router-link :to =" { name: '/container/[id]', params: { id: other.id } }" >
22+ <div
23+ class =" status data-[state=exited]:status-error data-[state=running]:status-success"
24+ :data-state =" other.state"
25+ ></div >
26+ <div class =" font-mono" v-if =" other.isSwarm" >{{ other.swarmId }}</div >
27+ <div class =" font-mono" v-else >{{ other.name }}</div >
28+ <div v-if =" other.state === 'running'" >running</div >
29+ <DistanceTime :date =" other.created" strict class =" text-base-content/70 text-xs" v-else />
30+ </router-link >
31+ </li >
32+ </ul >
33+ </div >
34+ </li >
35+ </ul >
1836 </div >
1937 </div >
2038 <ContainerHealth :health =" container.health" v-if =" container.health" />
@@ -38,4 +56,41 @@ const pinned = computed({
3856 }
3957 },
4058});
59+ const store = useContainerStore ();
60+ const { containers : allContainers } = storeToRefs (store );
61+
62+ const otherContainers = computed (() =>
63+ [... allContainers .value .filter ((c ) => c .name === container .name && c .id !== container .id )].sort (
64+ (a , b ) => + b .created - + a .created ,
65+ ),
66+ );
67+ const wrapper = useTemplateRef (" wrapper" );
68+
69+ onMounted (async () => {
70+ if (! (" anchorName" in document .documentElement .style )) {
71+ // @ts-ignore
72+ const module = await import (" @oddbird/css-anchor-positioning/fn" );
73+ // @ts-ignore
74+ await module .default ([wrapper .value ]);
75+ }
76+ });
4177 </script >
78+
79+ <style scoped>
80+ /* https://github.com/oddbird/css-anchor-positioning/issues/282 */
81+ .wrapper {
82+ anchor-scope : --anchor;
83+ }
84+
85+ .anchor {
86+ anchor-name : --anchor;
87+ }
88+
89+ .tethered {
90+ margin : 0 ;
91+ padding : 0 ;
92+ position-anchor : --anchor;
93+ top : anchor(bottom );
94+ left : anchor(left );
95+ }
96+ </style >
0 commit comments