Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf8f3000

Browse files
committed
fix(site): correct container port link
1 parent95b156e commitf8f3000

File tree

1 file changed

+37
-19
lines changed

1 file changed

+37
-19
lines changed

‎site/src/modules/resources/AgentDevcontainerCard.tsx

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
importLinkfrom"@mui/material/Link";
2-
importtype{Workspace,WorkspaceAgentDevcontainer}from"api/typesGenerated";
2+
importtype{
3+
Workspace,
4+
WorkspaceAgentDevcontainer,
5+
WorkspaceAgentDevcontainerPort,
6+
}from"api/typesGenerated";
37
import{ExternalLinkIcon}from"lucide-react";
48
importtype{FC}from"react";
59
import{portForwardURL}from"utils/portForward";
610
import{AgentButton}from"./AgentButton";
711
import{AgentDevcontainerSSHButton}from"./SSHButton/SSHButton";
812
import{TerminalLink}from"./TerminalLink/TerminalLink";
13+
importTooltip,{typeTooltipProps}from"@mui/material/Tooltip";
914

1015
typeAgentDevcontainerCardProps={
1116
container:WorkspaceAgentDevcontainer;
@@ -47,25 +52,38 @@ export const AgentDevcontainerCard: FC<AgentDevcontainerCardProps> = ({
4752
/>
4853
{wildcardHostname!==""&&
4954
container.ports.map((port)=>{
55+
letportLabel=`${port.port}/${port.network.toUpperCase()}`;
56+
lethasHostBind=
57+
port.host_port!==undefined&&
58+
port.host_port!==null&&
59+
port.host_ip!==undefined&&
60+
port.host_ip!==null;
61+
lethelperText=hasHostBind
62+
?`${port.host_ip}:${port.host_port}`
63+
:"Not bound to host";
5064
return(
51-
<Link
52-
key={port.port}
53-
color="inherit"
54-
component={AgentButton}
55-
underline="none"
56-
startIcon={<ExternalLinkIconclassName="size-icon-sm"/>}
57-
href={portForwardURL(
58-
wildcardHostname,
59-
port.port,
60-
agentName,
61-
workspace.name,
62-
workspace.owner_name,
63-
location.protocol==="https" ?"https" :"http",
64-
)}
65-
>
66-
{port.process_name||
67-
`${port.port}/${port.network.toUpperCase()}`}
68-
</Link>
65+
<Tooltipkey={portLabel}title={helperText}>
66+
<span>
67+
<Link
68+
key={portLabel}
69+
color="inherit"
70+
component={AgentButton}
71+
underline="none"
72+
startIcon={<ExternalLinkIconclassName="size-icon-sm"/>}
73+
disabled={!hasHostBind}
74+
href={portForwardURL(
75+
wildcardHostname,
76+
port.host_port!,
77+
agentName,
78+
workspace.name,
79+
workspace.owner_name,
80+
location.protocol==="https" ?"https" :"http",
81+
)}
82+
>
83+
{portLabel}
84+
</Link>
85+
</span>
86+
</Tooltip>
6987
);
7088
})}
7189
</div>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp