mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: show no provisioners warning (#17835)
<img width="1510" alt="Screenshot 2025-05-14 at 14 53 02" src="https://github.com/user-attachments/assets/f9c0fbb9-ea39-4fbc-a550-00d9f609a01e" /> Fix https://github.com/coder/coder/issues/17421
This commit is contained in:
@@ -78,6 +78,10 @@ export const Logs: Story = {
|
||||
...MockTemplateVersion.job,
|
||||
status: "running",
|
||||
},
|
||||
matched_provisioners: {
|
||||
count: 1,
|
||||
available: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
decorators: [withWebSocket],
|
||||
|
||||
@@ -29,10 +29,6 @@ export const BuildLogsDrawer: FC<BuildLogsDrawerProps> = ({
|
||||
variablesSectionRef,
|
||||
...drawerProps
|
||||
}) => {
|
||||
const matchingProvisioners = templateVersion?.matched_provisioners?.count;
|
||||
const availableProvisioners =
|
||||
templateVersion?.matched_provisioners?.available;
|
||||
|
||||
const logs = useWatchVersionLogs(templateVersion);
|
||||
const logsContainer = useRef<HTMLDivElement>(null);
|
||||
|
||||
@@ -60,6 +56,10 @@ export const BuildLogsDrawer: FC<BuildLogsDrawerProps> = ({
|
||||
error instanceof JobError &&
|
||||
error.job.error_code === "REQUIRED_TEMPLATE_VARIABLES";
|
||||
|
||||
const matchingProvisioners = templateVersion?.matched_provisioners?.count;
|
||||
const availableProvisioners =
|
||||
templateVersion?.matched_provisioners?.available;
|
||||
|
||||
return (
|
||||
<Drawer anchor="right" {...drawerProps}>
|
||||
<div css={styles.root}>
|
||||
@@ -85,7 +85,7 @@ export const BuildLogsDrawer: FC<BuildLogsDrawerProps> = ({
|
||||
drawerProps.onClose();
|
||||
}}
|
||||
/>
|
||||
) : logs ? (
|
||||
) : availableProvisioners && availableProvisioners > 0 && logs ? (
|
||||
<section ref={logsContainer} css={styles.logs}>
|
||||
<WorkspaceBuildLogs logs={logs} css={{ border: 0 }} />
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user