Skip to content

Commit c958b25

Browse files
committed
Revert "🍒"
This reverts commit d8efe91.
1 parent d8efe91 commit c958b25

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

site/src/pages/WorkspacePage/WorkspaceScheduleControls.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,13 @@ const AutoStopDisplay: FC<AutoStopDisplayProps> = ({ workspace }) => {
245245
return (
246246
<Tooltip title={display.tooltip}>
247247
<ScheduleSettingsLink
248-
css={
249-
isShutdownSoon(workspace) &&
250-
((theme) => ({
251-
color: `${theme.palette.warning.light} !important`,
252-
}))
253-
}
248+
css={(theme) => ({
249+
color: isShutdownSoon(workspace)
250+
? `${theme.palette.warning.light} !important`
251+
: undefined,
252+
})}
254253
>
255-
{display.message}
254+
Stop {display.message}
256255
</ScheduleSettingsLink>
257256
</Tooltip>
258257
);

site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceSchedulePage.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ export const WorkspaceSchedulePage: FC = () => {
8080
<Helmet>
8181
<title>{pageTitle([workspaceName, "Schedule"])}</title>
8282
</Helmet>
83-
<PageHeader css={{ paddingTop: 0 }}>
83+
<PageHeader
84+
css={{
85+
paddingTop: 0,
86+
}}
87+
>
8488
<PageHeaderTitle>Workspace Schedule</PageHeaderTitle>
8589
</PageHeader>
8690

site/src/utils/schedule.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import cronstrue from "cronstrue";
2-
import cronParser from "cron-parser";
3-
import dayjs, { type Dayjs } from "dayjs";
2+
import dayjs, { Dayjs } from "dayjs";
43
import duration from "dayjs/plugin/duration";
54
import relativeTime from "dayjs/plugin/relativeTime";
65
import timezone from "dayjs/plugin/timezone";
76
import utc from "dayjs/plugin/utc";
8-
import { type ReactNode } from "react";
9-
import type { Template, Workspace } from "api/typesGenerated";
7+
import { Template, Workspace } from "api/typesGenerated";
108
import { isWorkspaceOn } from "./workspace";
9+
import cronParser from "cron-parser";
1110

1211
// REMARK: some plugins depend on utc, so it's listed first. Otherwise they're
1312
// sorted alphabetically.
@@ -92,18 +91,11 @@ export const isShuttingDown = (
9291
export const autostopDisplay = (
9392
workspace: Workspace,
9493
): {
95-
message: ReactNode;
94+
message: string;
9695
tooltip?: string;
9796
} => {
9897
const ttl = workspace.ttl_ms;
9998

100-
if (isWorkspaceOn(workspace) && true) {
101-
return {
102-
message: "Connected with SSH",
103-
tooltip: "Workspace will not stop while there is an active connection",
104-
};
105-
}
106-
10799
if (isWorkspaceOn(workspace) && workspace.latest_build.deadline) {
108100
// Workspace is on --> derive from latest_build.deadline. Note that the
109101
// user may modify their workspace object (ttl) while the workspace is
@@ -119,7 +111,7 @@ export const autostopDisplay = (
119111
} else {
120112
const deadlineTz = deadline.tz(dayjs.tz.guess());
121113
return {
122-
message: `Stop ${deadlineTz.fromNow()}`,
114+
message: deadlineTz.fromNow(),
123115
tooltip: deadlineTz.format("MMMM D, YYYY h:mm A"),
124116
};
125117
}

0 commit comments

Comments
 (0)