Files
claude code agent 0bf4e71b79 fix(stacks): keep the stack breadcrumb trail on container attribute sub-tabs
When a container is opened from a stack, the detail tab kept the stack
trail (PR #7) but the attribute sub-tabs (Logs, Stats, Inspect, Console,
Attach) dropped it: those tabs were registered only under the global
docker.containers.container.* tree, so navigating to one left the stack
state (and its inherited params) behind, and each sub-view set a hardcoded
"Containers > ..." breadcrumb.

- Register stack-scoped child states docker.stacks.stack.container.{attach,
  exec,inspect,logs,stats} mirroring the global ones, so the inherited stack
  params survive and the trail can be kept.
- Centralize the breadcrumb logic in containerBreadcrumbs.ts (moved out of
  ItemView, which re-exports it) and add isStackContainerState +
  getContainerSubTabBreadcrumbs + buildStackContainerLinkParams.
- ActionLinksRow links sub-tabs into the stack tree (with stack+container
  params) when opened from a stack, else the global states unchanged.
- InspectView + the logs/stats/console controllers render the stack-aware
  trail; set up-front (no name) so it survives the load window and errors.

Covers regular/external/orphaned stacks and the non-stack fallback,
matching the existing ItemView breadcrumb behavior. New unit tests in
containerBreadcrumbs.test.ts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 02:25:04 +03:00

49 lines
1.8 KiB
HTML

<page-header title="'Container console'" breadcrumbs="breadcrumbs"> </page-header>
<div class="row" ng-init="autoconnectAttachView()" ng-show="loaded">
<div class="col-lg-12 col-md-12 col-xs-12">
<rd-widget>
<rd-widget-header icon="terminal" title-text="Attach"></rd-widget-header>
<rd-widget-body>
<div class="small text-warning" ng-if="!container.Config.OpenStdin">
<p>
<pr-icon icon="'alert-triangle'" mode="'warning'"></pr-icon>
The interactive-flag is not set. You might not be able to use the console properly.
</p>
</div>
<div class="small text-warning" ng-if="!container.Config.Tty">
<p>
<pr-icon icon="'alert-triangle'" mode="'warning'"></pr-icon>
The TTY-flag is not set. You might not be able to use the console properly.
</p>
</div>
<div class="small text-warning" ng-hide="container.State.Running">
<p>
<pr-icon icon="'alert-triangle'" mode="'warning'"></pr-icon>
The container is not running.
</p>
</div>
<button
type="button"
class="btn btn-primary"
ng-disabled="state === states.connecting || !container.State.Running"
ng-click="state == states.disconnected ? connectAttach() : disconnect()"
>
<span ng-show="state === states.disconnected">Attach to Container</span>
<span ng-show="state === states.connected">Detach</span>
<span ng-show="state === states.connecting">Attaching...</span>
</button>
</rd-widget-body>
</rd-widget>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-xs-12">
<shell-terminal url="shellUrl" connect="shellConnect" on-state-change="(onShellStateChange)" on-resize="(onShellResize)"></shell-terminal>
</div>
</div>