Skip to content

Commit fa7a89f

Browse files
committed
feat: add allocating actor label
1 parent d1e37e7 commit fa7a89f

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

frontend/src/components/actors/actor-status-indicator.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export const ActorStatusIndicator = ({
5454
"bg-blue-600 animate-pulse": status === "starting",
5555
"bg-destructive": status === "crashed",
5656
"bg-foreground/10": status === "stopped",
57+
"bg-primary": status === "pending",
5758
"bg-accent": status === "unknown",
5859
},
5960
props.className,

frontend/src/components/actors/actor-status-label.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const ACTOR_STATUS_LABEL_MAP = {
99
stopped: "Stopped",
1010
crashed: "Crashed",
1111
sleeping: "Sleeping",
12+
pending: "Pending (Allocating)",
1213
} satisfies Record<ActorStatus, string>;
1314

1415
export const ActorStatusLabel = ({ status }: { status?: ActorStatus }) => {

frontend/src/components/actors/queries/index.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,30 @@ export type ActorStatus =
9595
| "stopped"
9696
| "crashed"
9797
| "sleeping"
98+
| "pending"
9899
| "unknown";
99100

100101
export function getActorStatus(
101102
actor: Pick<
102103
Actor,
103-
"createdAt" | "startedAt" | "destroyedAt" | "sleepingAt"
104+
| "createdAt"
105+
| "startedAt"
106+
| "destroyedAt"
107+
| "sleepingAt"
108+
| "pendingAllocationAt"
104109
>,
105110
): ActorStatus {
106-
const { createdAt, startedAt, destroyedAt, sleepingAt } = actor;
111+
const {
112+
createdAt,
113+
startedAt,
114+
destroyedAt,
115+
sleepingAt,
116+
pendingAllocationAt,
117+
} = actor;
118+
119+
if (pendingAllocationAt && !startedAt && !destroyedAt) {
120+
return "pending";
121+
}
107122

108123
if (createdAt && sleepingAt && !destroyedAt) {
109124
return "sleeping";

0 commit comments

Comments
 (0)