mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: link with protocol on shared ports (#12908)
This commit is contained in:
@@ -393,6 +393,7 @@ export const PortForwardPopoverView: FC<PortForwardPopoverViewProps> = ({
|
||||
agent.name,
|
||||
workspaceName,
|
||||
username,
|
||||
share.protocol === "https",
|
||||
);
|
||||
const label = share.port;
|
||||
return (
|
||||
|
||||
@@ -4,12 +4,12 @@ export const portForwardURL = (
|
||||
agentName: string,
|
||||
workspaceName: string,
|
||||
username: string,
|
||||
https = false,
|
||||
): string => {
|
||||
const { location } = window;
|
||||
const suffix = https ? "s" : "";
|
||||
|
||||
const subdomain = `${
|
||||
isNaN(port) ? 3000 : port
|
||||
}--${agentName}--${workspaceName}--${username}`;
|
||||
const subdomain = `${port}${suffix}--${agentName}--${workspaceName}--${username}`;
|
||||
return `${location.protocol}//${host}`.replace("*", subdomain);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user