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

feat: show listening ports in port forward popup#4389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
deansheather merged 7 commits intomainfromdean/listening-ports-ui
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from1 commit
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
PrevPrevious commit
Merge branch 'main' into dean/listening-ports-ui
  • Loading branch information
@deansheather
deansheather committedOct 11, 2022
commit0380443031e00b99ebec582d43bbd864e7d8fae0
4 changes: 3 additions & 1 deletionsite/src/api/api.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -635,6 +635,8 @@ export const getWorkspaceQuota = async (
export const getAgentListeningPorts = async (
agentID: string,
): Promise<TypesGen.ListeningPortsResponse> => {
const response = await axios.get(`/api/v2/workspaceagents/${agentID}/listening-ports`)
const response = await axios.get(
`/api/v2/workspaceagents/${agentID}/listening-ports`,
)
return response.data
}
26 changes: 19 additions & 7 deletionssite/src/components/PortForwardButton/PortForwardButton.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -52,7 +52,12 @@ const EnabledView: React.FC<PortForwardButtonProps> = (props) => {
Use the form to open applications in a new tab.
</HelpTooltipText>

<Stack direction="row" spacing={1} alignItems="center" className={styles.form}>
<Stack
direction="row"
spacing={1}
alignItems="center"
className={styles.form}
>
<TextField
label="Port"
type="number"
Expand DownExpand Up@@ -104,20 +109,25 @@ const EnabledView: React.FC<PortForwardButtonProps> = (props) => {
)
}

const DisabledView: React.FC<PortForwardButtonProps> = ({ workspaceName, agentName }) => {
const DisabledView: React.FC<PortForwardButtonProps> = ({
workspaceName,
agentName,
}) => {
const cliExample = `coder port-forward ${workspaceName}.${agentName} --tcp 3000`
const styles = useStyles()

return (
<>
<HelpTooltipText>
<strong>Your deployment does not have web port forwarding enabled.</strong> See the docs for
more details.
<strong>
Your deployment does not have web port forwarding enabled.
</strong>{" "}
See the docs for more details.
</HelpTooltipText>

<HelpTooltipText>
You can use the Coder CLI to forward ports from your workspace to your local machine, as
shown below.
You can use the Coder CLI to forward ports from your workspace to your
local machine, asshown below.
</HelpTooltipText>

<CodeExample code={cliExample} className={styles.code} />
Expand DownExpand Up@@ -185,7 +195,9 @@ export const PortForwardButton: React.FC<PortForwardButtonProps> = (props) => {

const useStyles = makeStyles((theme) => ({
popoverPaper: {
padding: `${theme.spacing(2.5)}px ${theme.spacing(3.5)}px ${theme.spacing(3.5)}px`,
padding: `${theme.spacing(2.5)}px ${theme.spacing(3.5)}px ${theme.spacing(
3.5,
)}px`,
width: theme.spacing(52),
color: theme.palette.text.secondary,
marginTop: theme.spacing(0.25),
Expand Down
4 changes: 2 additions & 2 deletionssite/src/components/Resources/Resources.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -179,6 +179,7 @@ export const Resources: FC<React.PropsWithChildren<ResourcesProps>> = ({
<PortForwardButton
host={applicationsHost}
workspaceName={workspace.name}
agentId={agent.id}
agentName={agent.name}
username={workspace.owner_name}
/>
Expand All@@ -192,8 +193,7 @@ export const Resources: FC<React.PropsWithChildren<ResourcesProps>> = ({
<TerminalLink
workspaceName={workspace.name}
agentName={agent.name}
agentId={agent.id}
username={workspace.owner_name}
userName={workspace.owner_name}
/>
{agent.apps.map((app) => (
<AppLink
Expand Down
You are viewing a condensed version of this merge commit. You can view thefull changes here.

[8]ページ先頭

©2009-2025 Movatter.jp