-
Notifications
You must be signed in to change notification settings - Fork 16
fix(docker): improve logs and console UX when container is stopped #1868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -381,16 +381,23 @@ const hasActiveConsoleSession = computed(() => { | |
| return name ? hasActiveSession(name) : false; | ||
| }); | ||
|
|
||
| const isContainerRunning = computed(() => activeContainer.value?.state === 'RUNNING'); | ||
|
|
||
| const consoleBadge = computed(() => { | ||
| if (isContainerRunning.value && hasActiveConsoleSession.value) { | ||
| return { color: 'success' as const, variant: 'solid' as const, class: 'w-2 h-2 p-0 min-w-0' }; | ||
| } | ||
| return undefined; | ||
| }); | ||
|
|
||
| const legacyPaneTabs = computed(() => [ | ||
| { label: 'Overview', value: 'overview' as const }, | ||
| { label: 'Settings', value: 'settings' as const }, | ||
| { label: 'Logs', value: 'logs' as const }, | ||
| { | ||
| label: 'Console', | ||
| value: 'console' as const, | ||
| badge: hasActiveConsoleSession.value | ||
| ? { color: 'success' as const, variant: 'solid' as const, class: 'w-2 h-2 p-0 min-w-0' } | ||
| : undefined, | ||
| badge: consoleBadge.value, | ||
| }, | ||
| ]); | ||
|
Comment on lines
+384
to
402
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's read the actual file to see the full context
head -n 420 web/src/components/Docker/DockerContainerManagement.vue | tail -n 50Repository: unraid/api Length of output: 1523 🏁 Script executed: # Search for UTabs usage with badge in the codebase
rg -n 'UTabs' web/src --type=vue -A 10 -B 2 | head -100Repository: unraid/api Length of output: 81 🏁 Script executed: # Search for badge property usage patterns
rg -n 'badge\s*:' web/src --type=vue -A 2 -B 1Repository: unraid/api Length of output: 81 🏁 Script executed: # Check if there's a package.json to see the @nuxt/ui version
cat web/package.json | grep -A 5 -B 5 '@nuxt/ui'Repository: unraid/api Length of output: 451 🏁 Script executed: # Search for UTabs in files without specifying vue type (use general file search)
rg -n 'UTabs' web/src -A 10 -B 2 | head -150Repository: unraid/api Length of output: 2357 🏁 Script executed: # Search for badge property patterns more broadly
rg -n 'badge' web/src --type=ts -A 2 -B 1 | head -100Repository: unraid/api Length of output: 36 🏁 Script executed: # Check the component template to see how UTabs is used with legacyPaneTabs
sed -n '415,500p' web/src/components/Docker/DockerContainerManagement.vueRepository: unraid/api Length of output: 2945 🌐 Web query:
💡 Result: UTabs (v4.0.0‑alpha.0) — badge API (summary)
Example:
Sources:
Citations:
Badge object violates @nuxt/ui BadgeProps API—green dot indicator won't render properly. The Fix: Either provide a |
||
|
|
||
|
|
@@ -550,12 +557,6 @@ const [transitionContainerRef] = useAutoAnimate({ | |
| {{ stripLeadingSlash(activeContainer?.names?.[0]) || 'Container' }} | ||
| </div> | ||
| </div> | ||
| <UBadge | ||
| v-if="activeContainer?.state" | ||
| :label="activeContainer.state" | ||
| color="primary" | ||
| variant="subtle" | ||
| /> | ||
| </div> | ||
| <UTabs | ||
| v-model="legacyPaneTab" | ||
|
|
@@ -606,6 +607,7 @@ const [transitionContainerRef] = useAutoAnimate({ | |
| :container-name="stripLeadingSlash(activeContainer.names?.[0])" | ||
| :auto-scroll="logAutoScroll" | ||
| :client-filter="logFilterText" | ||
| :is-running="isContainerRunning" | ||
| class="h-full flex-1" | ||
| /> | ||
| </div> | ||
|
|
@@ -617,6 +619,7 @@ const [transitionContainerRef] = useAutoAnimate({ | |
| v-if="activeContainer" | ||
| :container-name="activeContainerName" | ||
| :shell="activeContainer.shell ?? 'sh'" | ||
| :is-running="isContainerRunning" | ||
| class="h-full" | ||
| /> | ||
| </div> | ||
|
|
@@ -636,12 +639,6 @@ const [transitionContainerRef] = useAutoAnimate({ | |
| /> | ||
| <div class="font-medium">Overview</div> | ||
| </div> | ||
| <UBadge | ||
| v-if="activeContainer?.state" | ||
| :label="activeContainer.state" | ||
| color="primary" | ||
| variant="subtle" | ||
| /> | ||
| </div> | ||
| </template> | ||
| <div class="relative"> | ||
|
|
@@ -684,6 +681,7 @@ const [transitionContainerRef] = useAutoAnimate({ | |
| v-if="activeContainer" | ||
| :container-name="stripLeadingSlash(activeContainer.names?.[0])" | ||
| :auto-scroll="true" | ||
| :is-running="isContainerRunning" | ||
| class="h-full" | ||
| /> | ||
| </div> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a container stops, this watcher only hides the existing session. If the user then starts the container again,
initTerminal()will see the cached session and skipcreateSession, so the iframe keeps pointing at a terminated ttyd connection and the console won’t reconnect until the user manually refreshes. This shows up when a container is stopped and then started while its console tab is open. Consider destroying the session (or forcing a new one) whenisRunningbecomes false, or bypassing the existing-session fast path on restart.Useful? React with 👍 / 👎.