Skip to content

Conversation

@raghavyuva
Copy link
Owner

@raghavyuva raghavyuva commented Sep 11, 2025

Closes #85

Summary by CodeRabbit

  • New Features

    • Added a Terminal tab in container details for an in-browser shell session. Available when the container is running; otherwise shows guidance to start the container.
  • Bug Fixes

    • Improved stability when displaying exposed ports to avoid rare rendering glitches with duplicate entries.
  • Chores

    • Updated API version metadata release date.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Adds a container terminal feature to the UI by introducing a Terminal component and a new “Terminal” tab on the container details page. Updates port badge keys in the overview to avoid collisions. Adjusts API version metadata by updating a release_date timestamp.

Changes

Cohort / File(s) Summary
API version metadata
api/api/versions.json
Updated release_date for version v1; no structural or other field changes.
Container terminal feature
view/app/containers/[id]/components/Terminal.tsx, view/app/containers/[id]/page.tsx
Added a client-side Terminal component using xterm + WebSocket; integrated as a new “Terminal” tab (enabled when container is running) and sends an init docker exec command to attach a shell.
Ports list key fix
view/app/containers/[id]/components/OverviewTab.tsx
Changed list rendering to use (port, index) and updated key to include index to prevent key collisions; display unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant P as ContainerDetailsPage
  participant Tabs as Tabs
  participant Term as Terminal component
  participant HookR as useContainerReady
  participant HookX as useTerminal (xterm)
  participant WS as useWebSocket
  participant BE as Backend
  participant DK as Docker Engine

  U->>P: Navigate to container details
  P->>Tabs: Render tabs (overview/images/logs/details/terminal)
  U->>Tabs: Select "Terminal" tab
  Tabs->>Term: Mount with containerId
  Term->>HookR: Check container DOM ready
  HookR-->>Term: Ready
  Term->>HookX: initializeTerminal()
  HookX-->>Term: terminalInstance
  Term->>WS: sendJsonMessage({ action: 'terminal', data: { value: initCmd, terminalId } })
  WS->>BE: Forward terminal init and subsequent I/O
  BE->>DK: docker exec -it {containerId} /bin/bash || /bin/sh
  DK-->>BE: PTY stream
  BE-->>WS: Data frames
  WS-->>Term: Data
  Term-->>U: Interactive shell I/O

  note over Term,WS: Init command sent once (guard + slight delay)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

A tap on the tab and the shell springs to life,
I thump-thump commands, no SSH strife.
Ports line up neatly, keys won’t collide,
A warren of containers, I burrow inside.
With whiskered wit and terminal cheer—
Exec away, the rabbit is here! 🐇💻

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/exec_commands_on_container

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@raghavyuva raghavyuva changed the title Feat/exec commands on container feat: exec commands on container Sep 11, 2025
@raghavyuva raghavyuva requested a review from zhravan September 11, 2025 15:10
@raghavyuva raghavyuva self-assigned this Sep 11, 2025
@raghavyuva raghavyuva moved this to In progress in Nixopus Sep 11, 2025
@raghavyuva raghavyuva added this to the Beta Release milestone Sep 11, 2025
@raghavyuva raghavyuva linked an issue Sep 11, 2025 that may be closed by this pull request
@raghavyuva
Copy link
Owner Author

@coderabbitai summary

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

✅ Actions performed

Summary regeneration triggered.

Copy link
Collaborator

@zhravan zhravan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM

@raghavyuva raghavyuva merged commit 3cb776d into feat/develop Sep 11, 2025
4 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Nixopus Sep 11, 2025
@coderabbitai coderabbitai bot mentioned this pull request Sep 11, 2025
@raghavyuva raghavyuva deleted the feat/exec_commands_on_container branch October 16, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Interactively run commands inside running containers through the UI

3 participants