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(site): display warning messages when wildcard is not configured#19660

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
kacpersaw merged 13 commits intomainfromkacpersaw/feat-wildcard-access-url-warnings
Sep 15, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
13 commits
Select commitHold shift + click to select a range
1b5a36d
add WildcardHostnameWarning component for workspace and template editor
kacpersawAug 29, 2025
e524b35
refactor: simplify WildcardHostnameWarning component messages in temp…
kacpersawSep 2, 2025
0da6c1c
update workspace warning text
kacpersawSep 2, 2025
542bcf3
improve styling of warnings
kacpersawSep 2, 2025
4c4e3b3
Apply review suggestions
kacpersawSep 3, 2025
be5a517
merge warnings into one component
kacpersawSep 4, 2025
9db05c3
fix fmt
kacpersawSep 4, 2025
3641f59
Merge branch 'main' into kacpersaw/feat-wildcard-access-url-warnings
kacpersawSep 4, 2025
6759882
show different text based on user permissions
kacpersawSep 4, 2025
f83949e
Merge branch 'main' into kacpersaw/feat-wildcard-access-url-warnings
kacpersawSep 10, 2025
ffdf340
Merge branch 'main' into kacpersaw/feat-wildcard-access-url-warnings
kacpersawSep 15, 2025
8ed13ae
Update docs url
kacpersawSep 15, 2025
cd9e5a2
Fix format
kacpersawSep 15, 2025
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
10 changes: 9 additions & 1 deletionsite/src/modules/resources/AgentRow.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -41,6 +41,7 @@ import { TerminalLink } from "./TerminalLink/TerminalLink";
import { useAgentContainers } from "./useAgentContainers";
import { useAgentLogs } from "./useAgentLogs";
import { VSCodeDesktopButton } from "./VSCodeDesktopButton/VSCodeDesktopButton";
import { WildcardHostnameWarning } from "./WildcardHostnameWarning";

interface AgentRowProps {
agent: WorkspaceAgent;
Expand DownExpand Up@@ -155,6 +156,10 @@ export const AgentRow: FC<AgentRowProps> = ({
// Check if any devcontainers have errors to gray out agent border
const hasDevcontainerErrors = devcontainers?.some((dc) => dc.error);

const hasSubdomainApps = agent.apps?.some((app) => app.subdomain);
const shouldShowWildcardWarning =
hasSubdomainApps && !proxy.proxy?.wildcard_hostname;

return (
<Stack
key={agent.id}
Expand All@@ -164,7 +169,8 @@ export const AgentRow: FC<AgentRowProps> = ({
styles.agentRow,
styles[`agentRow-${agent.status}`],
styles[`agentRow-lifecycle-${agent.lifecycle_state}`],
hasDevcontainerErrors && styles.agentRowWithErrors,
(hasDevcontainerErrors || shouldShowWildcardWarning) &&
styles.agentRowWithErrors,
]}
>
<header css={styles.header}>
Expand DownExpand Up@@ -226,6 +232,8 @@ export const AgentRow: FC<AgentRowProps> = ({
</section>
)}

{shouldShowWildcardWarning && <WildcardHostnameWarning />}

{shouldDisplayAppsSection && (
<section css={styles.apps}>
{shouldDisplayAgentApps && (
Expand Down
84 changes: 84 additions & 0 deletionssite/src/modules/resources/WildcardHostnameWarning.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
import AlertTitle from "@mui/material/AlertTitle";
import type { WorkspaceResource } from "api/typesGenerated";
import { Alert, AlertDetail } from "components/Alert/Alert";
import { Link } from "components/Link/Link";
import { useProxy } from "contexts/ProxyContext";
import { useAuthenticated } from "hooks/useAuthenticated";
import type { FC } from "react";
import { docs } from "utils/docs";

interface WildcardHostnameWarningProps {
// If resources are provided, show template-focused warning
resources?: WorkspaceResource[];
}

export const WildcardHostnameWarning: FC<WildcardHostnameWarningProps> = ({
resources,
}) => {
const { proxy } = useProxy();
const { permissions } = useAuthenticated();

const hasResources = Boolean(resources);
const canEditDeploymentConfig = Boolean(permissions.editDeploymentConfig);

if (proxy.proxy?.wildcard_hostname) {
return null;
}

if (hasResources) {
const hasSubdomainCoderApp = resources!.some((resource) => {
return resource.agents?.some((agent) =>
agent.apps?.some((app) => app.subdomain),
);
});

if (!hasSubdomainCoderApp) {
return null;
}
}

return (
<Alert
severity="warning"
className={
hasResources
? "rounded-none border-0 border-l-2 border-l-warning border-b-divider"
: undefined
}
>
<AlertTitle>Some workspace applications will not work</AlertTitle>
<AlertDetail>
<div>
{hasResources
? "This template contains coder_app resources with"
: "One or more apps in this workspace have"}{" "}
<code className="py-px px-1 bg-surface-tertiary rounded-sm text-content-primary">
subdomain = true
</code>
{canEditDeploymentConfig ? (
<>
, but subdomain applications are not configured. Users won't be
able to access these applications until you configure the{" "}
<code className="py-px px-1 bg-surface-tertiary rounded-sm text-content-primary">
--wildcard-access-url
</code>{" "}
flag when starting the Coder server.
</>
) : (
", which requires a Coder deployment with a Wildcard Access URL configured. Please contact your administrator."
)}
</div>
<div className="pt-2">
<Link
href={docs("/admin/networking/wildcard-access-url")}
target="_blank"
>
<span className="font-semibold">
Learn more about wildcard access URL
</span>
</Link>
</div>
</AlertDetail>
</Alert>
);
};
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,6 +37,7 @@ import {
ProvisionerAlert,
} from "modules/provisioners/ProvisionerAlert";
import { ProvisionerStatusAlert } from "modules/provisioners/ProvisionerStatusAlert";
import { WildcardHostnameWarning } from "modules/resources/WildcardHostnameWarning";
import { isBinaryData } from "modules/templates/TemplateFiles/isBinaryData";
import { TemplateFileTree } from "modules/templates/TemplateFiles/TemplateFileTree";
import { TemplateResourcesTable } from "modules/templates/TemplateResourcesTable/TemplateResourcesTable";
Expand DownExpand Up@@ -203,7 +204,7 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({
if (logsContentRef.current) {
logsContentRef.current.scrollTop = logsContentRef.current.scrollHeight;
}
}, [buildLogs]);
}, [buildLogs, resources]);

useLeaveSiteWarning(dirty);

Expand DownExpand Up@@ -630,6 +631,10 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({
logs={buildLogs}
/>
)}

{resources && (
<WildcardHostnameWarning resources={resources} />
)}
</div>
)}

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp