feat(frontend): add polling job queue ui
This commit is contained in:
45
frontend/src/types.ts
Normal file
45
frontend/src/types.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
export type JobStatus = "queued" | "running" | "succeeded" | "failed";
|
||||
|
||||
export type Job = {
|
||||
id: string;
|
||||
type: string;
|
||||
payload: Record<string, unknown>;
|
||||
status: JobStatus;
|
||||
priority: number;
|
||||
available_at: string;
|
||||
attempts: number;
|
||||
max_attempts: number;
|
||||
idempotency_key: string | null;
|
||||
locked_by: string | null;
|
||||
locked_until: string | null;
|
||||
last_error: string;
|
||||
result: unknown;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
finished_at: string | null;
|
||||
};
|
||||
|
||||
export type JobEvent = {
|
||||
id: number;
|
||||
job: string;
|
||||
type: string;
|
||||
attempt: number;
|
||||
worker_id: string | null;
|
||||
message: string;
|
||||
data: Record<string, unknown>;
|
||||
created_at: string;
|
||||
};
|
||||
|
||||
export type JobStats = {
|
||||
total: number;
|
||||
by_status: Record<JobStatus, number>;
|
||||
overdue_running: number;
|
||||
retries_pending: number;
|
||||
oldest_queued_at: string | null;
|
||||
};
|
||||
|
||||
export type Health = {
|
||||
ok: boolean;
|
||||
database: string;
|
||||
detail?: string;
|
||||
};
|
||||
Reference in New Issue
Block a user