Skip to content

Commit

Permalink
uncontroversial copy tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Jan 31, 2025
1 parent 9263a5e commit 72f3ea3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
6 changes: 3 additions & 3 deletions app/components/InstanceAutoRestartPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import { pb } from '~/util/path-builder'
const helpText = {
enabled: (
<>
The control plane will attempt to automatically restart instance this instance after
entering the <HL>failed</HL> state.
The control plane will attempt to automatically restart this instance after entering
the <HL>failed</HL> state.
</>
),
disabled: (
Expand Down Expand Up @@ -66,7 +66,7 @@ export const InstanceAutoRestartPopover = ({

useInterval({ fn: () => setNow(new Date()), delay: 1000 })

const isQueued = cooldownExpiration && new Date(cooldownExpiration) < now
const isQueued = cooldownExpiration && cooldownExpiration < now

let helpTextState: keyof typeof helpText = 'disabled'
if (isQueued) helpTextState = 'starting' // Expiration is in the past and queued for restart
Expand Down
5 changes: 1 addition & 4 deletions app/pages/project/instances/instance/InstancePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,6 @@ export function InstancePage() {

const memory = filesize(instance.memory, { output: 'object', base: 2 })

// Document when this popover is showing
const hasAutoRestart = !!instance.autoRestartCooldownExpiration

return (
<>
<PageHeader>
Expand Down Expand Up @@ -216,7 +213,7 @@ export function InstancePage() {
</button>
</Tooltip>
)}
{hasAutoRestart && (
{instance.autoRestartCooldownExpiration && (
<InstanceAutoRestartPopover
enabled={instance.autoRestartEnabled}
cooldownExpiration={instance.autoRestartCooldownExpiration}
Expand Down
8 changes: 4 additions & 4 deletions app/pages/project/instances/instance/tabs/SettingsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function Component() {
/>
<FormMeta
label="Enabled"
helpText="If enabled this instance will automatically restart it if it enters the Failed state."
helpText="If enabled, this instance will automatically restart if it enters the Failed state."
>
{instance.autoRestartEnabled ? 'True' : 'False'}{' '}
{instance.autoRestartEnabled && !instance.autoRestartPolicy && (
Expand All @@ -94,7 +94,7 @@ export function Component() {
</FormMeta>
<FormMeta
label="Cooldown expiration"
helpText="The time at which the auto-restart cooldown period for this instance completes. If n/a, then either the instance has never been automatically restarted, or the cooldown period has already expired"
helpText="The time at which the auto-restart cooldown period for this instance completes. If N/A, then either the instance has never been automatically restarted, or the cooldown period has already expired"
>
{instance.autoRestartCooldownExpiration ? (
<>
Expand All @@ -110,7 +110,7 @@ export function Component() {
)}
</>
) : (
<span className="text-tertiary">n/a</span>
<span className="text-tertiary">N/A</span>
)}
</FormMeta>
<FormMeta
Expand All @@ -125,7 +125,7 @@ export function Component() {
)}
</>
) : (
<span className="text-tertiary">n/a</span>
<span className="text-tertiary">N/A</span>
)}
</FormMeta>
</SettingsGroup.Body>
Expand Down

0 comments on commit 72f3ea3

Please sign in to comment.