Add container controls and detail inspector#8
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a4c033d44a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 619001064f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
For containers published to a specific host address, for example 192.168.64.2:8080->80/tcp, the parser stores that address in hostIP but browserURL always opens localhost, which can fail or hit a different service than the Docker binding shown in the row. Use the parsed host IP for non-wildcard bindings and only substitute localhost for 0.0.0.0/::.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed the remaining review-body note about published ports in |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e7bb071099
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| func inspectContainer(_ container: DockerContainerResource) async throws -> String { | ||
| let output = try await dockerContainerController.inspect(containerID: container.id, context: selectedDockerContext) | ||
| return cappedLog(output) |
There was a problem hiding this comment.
Preserve parseable inspect JSON for mounts
When docker inspect returns more than maxLogCharacters (for example a container with very large env/label metadata), this replaces the JSON with a truncation banner plus a suffix before loadInspect stores it. That string is no longer valid JSON, so containerMounts(from: inspectText) in the Files tab cannot parse Mounts and misleadingly reports no mounts; keep a raw/parsed inspect payload for mount extraction and cap only the displayed text.
Useful? React with 👍 / 👎.
| var availableActions: Set<DockerContainerAction> { | ||
| var actions: Set<DockerContainerAction> = [.logs, .inspect, .copyID, .copyImage] | ||
| if !ports.isEmpty { actions.insert(.copyPorts) } | ||
| if !portBindings.isEmpty { actions.insert(.openPort) } |
There was a problem hiding this comment.
Hide open-port actions for stopped containers
Because .openPort is inserted before checking the container state, any stopped/exited/created container that still reports a published port binding gets an Open Port button/menu item. In that state Docker is not running the container process, so opening the retained host mapping sends users to a dead endpoint; only add this action for states where the container can actually serve the port, such as running.
Useful? React with 👍 / 👎.
| ) | ||
| value = replacing( | ||
| #"(?i)\b([A-Z0-9_.-]*(?:PASSWORD|PASSWD|SECRET|TOKEN|API[_-]?KEY|ACCESS[_-]?KEY|PRIVATE[_-]?KEY|AUTHORIZATION|CREDENTIAL)[A-Z0-9_.-]*)\s*=\s*("[^"]*"|'[^']*'|[^\s,;]+)"#, | ||
| #"(?i)\b([A-Z0-9_.-]*(?:PASSWORD|PASSWD|SECRET|TOKEN|API[_-]?KEY|ACCESS[_-]?KEY|PRIVATE[_-]?KEY|AUTHORIZATION|CREDENTIAL)[A-Z0-9_.-]*)\s*=\s*("[^"]*"|'[^']*'|[^"'\s,;\]\}]+)"#, |
There was a problem hiding this comment.
Redact full env values containing delimiters
When inspect/log output contains an env-style secret whose value includes a comma, semicolon, or closing JSON delimiter, such as Docker inspect's "PASSWORD=abc,def" inside Config.Env, this pattern only replaces the prefix through abc and leaves ,def visible in the inspector and copy buffer. Since container logs and inspect output now rely on this redactor before display, make the assignment redaction consume the full JSON string/env value instead of stopping at those delimiters.
Useful? React with 👍 / 👎.
Adds per-container lifecycle controls, row actions, Compose-aware grouping, and a full selected-container inspector for logs, inspect JSON, stats, terminal access, files, and ports.
Summary:
Verification: