Redesign jobs dashboard with unified table and progress bar

- Add overall progress bar showing completed/active/failed counts
- Unify all job types into single table with Type column
- Simplify status to Working/Pending/Failed badges
- Remove NPM "Coming Soon" section
- Add get_recent_activity() function for future activity feed
- Fix dark mode CSS using CSS variables
This commit is contained in:
Mondo Diaz
2026-02-02 14:34:48 -06:00
parent 1f98caa73c
commit df4f9d168b
4 changed files with 422 additions and 354 deletions

View File

@@ -600,6 +600,40 @@ def get_active_tasks(db: Session, limit: int = 50) -> List[dict]:
]
def get_recent_activity(db: Session, limit: int = 20) -> List[dict]:
"""
Get recent task completions and failures for activity feed.
Args:
db: Database session.
limit: Maximum number of items to return.
Returns:
List of recent activity items sorted by time descending.
"""
# Get recently completed and failed tasks
tasks = (
db.query(PyPICacheTask)
.filter(PyPICacheTask.status.in_(["completed", "failed"]))
.filter(PyPICacheTask.completed_at != None)
.order_by(PyPICacheTask.completed_at.desc())
.limit(limit)
.all()
)
return [
{
"id": str(task.id),
"package": task.package_name,
"status": task.status,
"type": "pypi",
"error": task.error_message if task.status == "failed" else None,
"completed_at": task.completed_at.isoformat() if task.completed_at else None,
}
for task in tasks
]
def retry_failed_task(db: Session, package_name: str) -> Optional[PyPICacheTask]:
"""
Reset a failed task to retry.