diff --git a/archivebox/actors/templates/jobs_dashboard.html b/archivebox/actors/templates/jobs_dashboard.html index 94d8bf04..dabc8e03 100644 --- a/archivebox/actors/templates/jobs_dashboard.html +++ b/archivebox/actors/templates/jobs_dashboard.html @@ -13,9 +13,18 @@ margin: 0 auto; padding: 20px; } + @keyframes pulse { + 0% { opacity: 1; } + 48% { opacity: 0.2; } + 52% { opacity: 1; } + 100% { opacity: 1; } + } h1 { text-align: center; } + h1 a { + animation: pulse 1s; + } .dashboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); @@ -85,13 +94,21 @@ -

Job Dashboard ♻️ {{now}}

+

Job Dashboard ♻️ {{now}}}

diff --git a/archivebox/api/v1_actors.py b/archivebox/api/v1_actors.py index b35ce608..b29e89a1 100644 --- a/archivebox/api/v1_actors.py +++ b/archivebox/api/v1_actors.py @@ -7,9 +7,8 @@ from datetime import datetime from ninja import Router, Schema -from .auth import API_AUTH_METHODS -router = Router(tags=['Workers and Tasks'], auth=API_AUTH_METHODS) +router = Router(tags=['Workers and Tasks']) class TaskSchema(Schema): @@ -50,7 +49,10 @@ class ActorSchema(Schema): MAX_TICK_TIME: int MAX_CONCURRENT_ACTORS: int - queue: list[TaskSchema] + future: list[TaskSchema] + pending: list[TaskSchema] + stalled: list[TaskSchema] + active: list[TaskSchema] past: list[TaskSchema] @staticmethod @@ -72,10 +74,22 @@ class ActorSchema(Schema): @staticmethod def resolve_FINAL_STATES(obj) -> list[str]: return [str(state) for state in obj.FINAL_STATES] - + @staticmethod - def resolve_queue(obj) -> list[TaskSchema]: - return [obj for obj in obj.qs.filter(obj.pending_q | obj.future_q | obj.active_q | obj.stalled_q).order_by('-retry_at')] + def resolve_future(obj) -> list[TaskSchema]: + return [obj for obj in obj.qs.filter(obj.future_q).order_by('-retry_at')] + + @staticmethod + def resolve_pending(obj) -> list[TaskSchema]: + return [obj for obj in obj.qs.filter(obj.pending_q).order_by('-retry_at')] + + @staticmethod + def resolve_stalled(obj) -> list[TaskSchema]: + return [obj for obj in obj.qs.filter(obj.stalled_q).order_by('-retry_at')] + + @staticmethod + def resolve_active(obj) -> list[TaskSchema]: + return [obj for obj in obj.qs.filter(obj.active_q).order_by('-retry_at')] @staticmethod def resolve_past(obj) -> list[TaskSchema]: