Add Active Workers table to Background Jobs dashboard

Shows currently processing cache tasks in a dynamic table with:
- Package name and version constraint being cached
- Recursion depth and attempt number
- Start timestamp
- Pulsing indicator to show live activity

Backend changes:
- Add get_active_tasks() function to pypi_cache_worker.py
- Add GET /pypi/cache/active endpoint to pypi_proxy.py

Frontend changes:
- Add PyPICacheActiveTask type
- Add getPyPICacheActiveTasks() API function
- Add Active Workers section with animated table
- Auto-refreshes every 5 seconds with existing data
This commit is contained in:
Mondo Diaz
2026-02-02 13:50:45 -06:00
parent 5517048f05
commit a485852a6f
6 changed files with 225 additions and 47 deletions

View File

@@ -754,6 +754,7 @@ export async function testUpstreamSource(id: string): Promise<UpstreamSourceTest
import {
PyPICacheStatus,
PyPICacheTask,
PyPICacheActiveTask,
PyPICacheRetryResponse,
} from './types';
@@ -771,6 +772,13 @@ export async function getPyPICacheFailedTasks(limit: number = 50): Promise<PyPIC
return handleResponse<PyPICacheTask[]>(response);
}
export async function getPyPICacheActiveTasks(limit: number = 50): Promise<PyPICacheActiveTask[]> {
const response = await fetch(`/pypi/cache/active?limit=${limit}`, {
credentials: 'include',
});
return handleResponse<PyPICacheActiveTask[]>(response);
}
export async function retryPyPICacheTask(packageName: string): Promise<PyPICacheRetryResponse> {
const response = await fetch(`/pypi/cache/retry/${encodeURIComponent(packageName)}`, {
method: 'POST',