Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions frontend/src/components/actors/actor-status-indicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const ActorStatusIndicator = ({
"bg-blue-600 animate-pulse": status === "starting",
"bg-destructive": status === "crashed",
"bg-foreground/10": status === "stopped",
"bg-primary": status === "pending",
"bg-accent": status === "unknown",
},
props.className,
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/actors/actor-status-label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const ACTOR_STATUS_LABEL_MAP = {
stopped: "Stopped",
crashed: "Crashed",
sleeping: "Sleeping",
pending: "Pending (Allocating)",
} satisfies Record<ActorStatus, string>;

export const ActorStatusLabel = ({ status }: { status?: ActorStatus }) => {
Expand Down
19 changes: 17 additions & 2 deletions frontend/src/components/actors/queries/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,30 @@ export type ActorStatus =
| "stopped"
| "crashed"
| "sleeping"
| "pending"
| "unknown";

export function getActorStatus(
actor: Pick<
Actor,
"createdAt" | "startedAt" | "destroyedAt" | "sleepingAt"
| "createdAt"
| "startedAt"
| "destroyedAt"
| "sleepingAt"
| "pendingAllocationAt"
>,
): ActorStatus {
const { createdAt, startedAt, destroyedAt, sleepingAt } = actor;
const {
createdAt,
startedAt,
destroyedAt,
sleepingAt,
pendingAllocationAt,
} = actor;

if (pendingAllocationAt && !startedAt && !destroyedAt) {
return "pending";
}

if (createdAt && sleepingAt && !destroyedAt) {
return "sleeping";
Expand Down
Loading