@@ -11,7 +11,11 @@ import useTailscale, {
1111 openTailscaleOnHost ,
1212} from "src/tailscale"
1313import copyToClipboard from "src/lib/clipboard"
14- import { navigateToContainerLogs , openBrowser } from "src/utils"
14+ import {
15+ navigateToContainer ,
16+ navigateToContainerLogs ,
17+ openBrowser ,
18+ } from "src/utils"
1519import Icon from "src/components/icon"
1620import useTimedToggle from "src/hooks/timed-toggle"
1721
@@ -192,12 +196,16 @@ function ContainerTable() {
192196 < HostWarning />
193197 { containers . length > 0 ? (
194198 < >
195- < table className = "w-full text-left" >
199+ < table className = "table-fixed w-full text-left" >
196200 < thead >
197201 < tr >
198- < th className = { cx ( tableHeaderClass , "w-1/3" ) } > Container</ th >
199- < th className = { cx ( tableHeaderClass , "w-1/2" ) } > Tailscale URL</ th >
200- < th className = { tableHeaderClass } />
202+ < th className = { cx ( tableHeaderClass , "w-1/3 sm:w-2/5" ) } >
203+ Container
204+ </ th >
205+ < th className = { cx ( tableHeaderClass , "w-1/3 sm:w-2/5" ) } >
206+ Tailscale URL
207+ </ th >
208+ < th className = { cx ( tableHeaderClass , "w-1/6" ) } />
201209 </ tr >
202210 </ thead >
203211 < tbody >
@@ -259,20 +267,22 @@ function ContainerRow(props: {
259267 borderColor ,
260268 ) }
261269 >
262- < td className = { cx ( tableCellClass , "flex items-center" ) } >
263- < Icon
264- className = { cx ( "mr-3" , {
265- "text-emerald-400 dark:text-green-300" : online ,
266- "text-gray-400 dark:text-gray-600" : ! online ,
267- } ) }
268- name = "container"
269- size = "24"
270- />
271- < span className = "truncate" >
272- { container . Names . map ( ( n ) => n . slice ( 1 ) . trim ( ) ) . join ( "," ) }
273- </ span >
270+ < td className = { cx ( tableCellClass ) } >
271+ < div className = "flex items-center min-w-0" >
272+ < Icon
273+ className = { cx ( "mr-3 shrink-0" , {
274+ "text-emerald-400 dark:text-green-300" : online ,
275+ "text-gray-400 dark:text-gray-600" : ! online ,
276+ } ) }
277+ name = "container"
278+ size = "24"
279+ />
280+ < span className = "truncate" >
281+ { container . Names . map ( ( n ) => n . slice ( 1 ) . trim ( ) ) . join ( "," ) }
282+ </ span >
283+ </ div >
274284 </ td >
275- < td className = { cx ( tableCellClass , "min-w-0" ) } >
285+ < td className = { cx ( tableCellClass ) } >
276286 { hasPublicPorts ? (
277287 < Tooltip
278288 asChild
@@ -284,12 +294,12 @@ function ContainerRow(props: {
284294 onOpenChange = { setShowTooltip }
285295 >
286296 < button
287- className = { cx ( tableButtonClass , "flex items-center min -w-0 " ) }
297+ className = { cx ( tableButtonClass , "flex items-center max -w-full " ) }
288298 onClick = { handleCopyClick }
289299 >
290- < span className = "truncate" > { tailscaleIPPort } </ span >
300+ < span className = "truncate min-w-0 " > { tailscaleIPPort } </ span >
291301 < Icon
292- className = "ml-1.5 text-gray-500 dark:text-gray-400"
302+ className = "ml-1.5 text-gray-500 dark:text-gray-400 shrink-0 "
293303 name = { copied ? "check" : "clipboard" }
294304 size = "14"
295305 />
@@ -312,51 +322,57 @@ function ContainerRow(props: {
312322 </ Tooltip >
313323 ) }
314324 </ td >
315- < td className = { cx ( "space-x-3 text-right" , tableButtonCellClass ) } >
316- < Tooltip asChild content = "Open URL in browser" >
317- < button
318- disabled = { ! online }
319- className = { cx ( tableIconButtonClass ) }
320- onClick = { ( ) => openBrowser ( tailscaleURL ) }
321- >
322- < Icon name = "external-link" size = "1.25em" />
323- </ button >
324- </ Tooltip >
325- < DropdownMenu
326- asChild
327- trigger = {
328- < button className = { cx ( tableIconButtonClass ) } >
329- < Icon name = "more" size = "1.25em" />
325+ < td className = { cx ( tableCellClass ) } >
326+ < div className = "flex justify-end items-center gap-x-2" >
327+ < Tooltip asChild content = "Open URL in browser" >
328+ < button
329+ disabled = { ! online }
330+ className = { cx ( tableIconButtonClass ) }
331+ onClick = { ( ) => openBrowser ( tailscaleURL ) }
332+ >
333+ < Icon name = "external-link" size = "1.25em" />
330334 </ button >
331- }
332- >
333- < DropdownMenu . Item
334- disabled = { ! online }
335- onSelect = { ( ) => copyToClipboard ( tailscaleIPUrl ) }
336- >
337- Copy IP address
338- </ DropdownMenu . Item >
339- < DropdownMenu . Separator />
340- < DropdownMenu . Item
341- onSelect = { ( ) => navigateToContainerLogs ( container . Id ) }
335+ </ Tooltip >
336+ < DropdownMenu
337+ asChild
338+ trigger = {
339+ < button className = { cx ( tableIconButtonClass ) } >
340+ < Icon name = "more" size = "1.25em" />
341+ </ button >
342+ }
342343 >
343- View logs
344- </ DropdownMenu . Item >
345- </ DropdownMenu >
344+ < DropdownMenu . Item
345+ disabled = { ! online }
346+ onSelect = { ( ) => copyToClipboard ( tailscaleIPUrl ) }
347+ >
348+ Copy IP address
349+ </ DropdownMenu . Item >
350+ < DropdownMenu . Separator />
351+ < DropdownMenu . Item
352+ onSelect = { ( ) => navigateToContainer ( container . Id ) }
353+ >
354+ View container
355+ </ DropdownMenu . Item >
356+ < DropdownMenu . Item
357+ onSelect = { ( ) => navigateToContainerLogs ( container . Id ) }
358+ >
359+ View logs
360+ </ DropdownMenu . Item >
361+ </ DropdownMenu >
362+ </ div >
346363 </ td >
347364 </ tr >
348365 )
349366}
350367
351368const borderColor = "border-gray-200 dark:border-[rgba(255,255,255,0.09)]"
352- const tablePadding = "px-2 py-4 "
369+ const tablePadding = "px-2 h-14 "
353370const tableHeaderClass = cx (
354371 "uppercase tracking-wider text-gray-700 dark:text-gray-200 text-xs border-b select-none" ,
355372 tablePadding ,
356373 borderColor ,
357374)
358375const tableCellClass = cx ( tablePadding , borderColor )
359- const tableButtonCellClass = cx ( "px-2" , borderColor )
360376const tableIconButtonClass =
361377 "text-gray-600 dark:text-gray-300 focus:outline-none enabled:hover:bg-[rgba(31,41,55,0.05)] enabled:dark:hover:bg-[rgba(255,255,255,0.05)] focus-visible:bg-[rgba(31,41,55,0.05)] dark:focus-visible:bg-[rgba(255,255,255,0.05)] px-2 py-2 rounded disabled:opacity-50"
362378const tableButtonClass = "focus:outline-none focus-visible:ring"
0 commit comments