diff --git a/site/src/components/PortForwardButton/PortForwardButton.tsx b/site/src/components/PortForwardButton/PortForwardButton.tsx index 4a18681f2f836..595a32e651533 100644 --- a/site/src/components/PortForwardButton/PortForwardButton.tsx +++ b/site/src/components/PortForwardButton/PortForwardButton.tsx @@ -4,7 +4,6 @@ import Popover from "@material-ui/core/Popover" import { makeStyles } from "@material-ui/core/styles" import TextField from "@material-ui/core/TextField" import OpenInNewOutlined from "@material-ui/icons/OpenInNewOutlined" -import { ChooseOne, Cond } from "components/Conditionals/ChooseOne" import { Stack } from "components/Stack/Stack" import { useRef, useState, Fragment } from "react" import { colors } from "theme/colors" @@ -42,7 +41,7 @@ const portForwardURL = ( return `${location.protocol}//${host}`.replace("*", subdomain) } -const EnabledView: React.FC = (props) => { +const TooltipView: React.FC = (props) => { const { host, workspaceName, agentName, agentId, username } = props const styles = useStyles() const [port, setPort] = useState("3000") @@ -137,40 +136,7 @@ const EnabledView: React.FC = (props) => { ) } -const DisabledView: React.FC = ({ - workspaceName, - agentName, -}) => { - const cliExample = `coder port-forward ${workspaceName}.${agentName} --tcp 3000` - const styles = useStyles() - - return ( - <> - - - Your deployment does not have web port forwarding enabled. - {" "} - See the docs for more details. - - - - You can use the Coder CLI to forward ports from your workspace to your - local machine, as shown below. - - - - - - - Learn more about web port forwarding - - - - ) -} - export const PortForwardButton: React.FC = (props) => { - const { host } = props const anchorRef = useRef(null) const [isOpen, setIsOpen] = useState(false) const id = isOpen ? "schedule-popover" : undefined @@ -208,14 +174,7 @@ export const PortForwardButton: React.FC = (props) => { }} > Port forward - - - - - - - - + ) diff --git a/site/src/components/Resources/AgentRow.stories.tsx b/site/src/components/Resources/AgentRow.stories.tsx index e3bc358d13771..a289c3d1bf19f 100644 --- a/site/src/components/Resources/AgentRow.stories.tsx +++ b/site/src/components/Resources/AgentRow.stories.tsx @@ -76,3 +76,11 @@ Timeout.args = { applicationsHost: "", showApps: true, } + +export const ShowingPortForward = Template.bind({}) +ShowingPortForward.args = { + agent: MockWorkspaceAgent, + workspace: MockWorkspace, + applicationsHost: "https://coder.com", + showApps: true, +} diff --git a/site/src/components/Resources/AgentRow.tsx b/site/src/components/Resources/AgentRow.tsx index d0fbc112fbb44..553761233b39c 100644 --- a/site/src/components/Resources/AgentRow.tsx +++ b/site/src/components/Resources/AgentRow.tsx @@ -105,7 +105,7 @@ export const AgentRow: FC = ({ agentName={agent.name} /> )} - {applicationsHost !== undefined && ( + {applicationsHost !== undefined && applicationsHost !== "" && ( + deploymentConfig: Pick } export const NetworkSettingsPageView = ({ deploymentConfig, }: NetworkSettingsPageViewProps): JSX.Element => ( - <> -
+ +
+
+ +
- - +
+
+ + + {deploymentConfig.wildcard_access_url.value !== "" ? ( + + ) : ( + + )} + +
+
)