Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion opencode-ui/packages/app/src/pages/agent.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createSignal, createEffect, createMemo, onCleanup, onMount, Show, For } from "solid-js"
import { createSignal, createEffect, createMemo, onCleanup, onMount, Show, For, Index } from "solid-js"
import { useParams, useNavigate, A } from "@solidjs/router"
import { DevaipodProvider, useDevaipod } from "@/context/devaipod"
import { apiFetch } from "@/utils/devaipod-api"
Expand Down Expand Up @@ -162,6 +162,11 @@ function AgentView() {
return status.activity
}

// -- Forwarded ports for the current pod -----------------------------------

const currentPod = () => ctx.pods.find((p) => p.Name === fullName())
const forwardedPorts = () => currentPod()?.ForwardedPorts ?? []

// Display name for pod trigger button
const triggerLabel = () => {
const title = sessionTitle()
Expand Down Expand Up @@ -200,6 +205,31 @@ function AgentView() {
{isDone() ? "Done" : "Mark Done"}
</button>

{/* Forwarded ports */}
<Show when={forwardedPorts().length > 0}>
<div class="flex items-center gap-1.5 text-[13px] text-text-weak ml-2">
<span>Ports:</span>
<Index each={forwardedPorts()}>
{(port, idx) => (
<>
<Show when={idx > 0}>
<span class="opacity-40">,</span>
</Show>
<a
href={`http://${window.location.hostname}:${port().hostPort}`}
target="_blank"
rel="noopener noreferrer"
class="text-text-secondary-base hover:text-text-strong no-underline hover:underline tabular-nums"
title={`Open port ${port().containerPort} (host port ${port().hostPort})`}
>
{port().hostPort}&rarr;{port().containerPort}
</a>
</>
)}
</Index>
</div>
</Show>

<span class="flex-1" />

{/* Pod switcher */}
Expand Down
Loading