mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-01 08:59:46 +02:00
chore: refactor workfow run view
This commit is contained in:
parent
ae0dc812cd
commit
1065ae001f
15 changed files with 794 additions and 387 deletions
|
|
@ -105,8 +105,12 @@ async def get_workflow_runs(
|
|||
page: int = Query(1, ge=1, description="Page number (starts from 1)"),
|
||||
limit: int = Query(50, ge=1, le=100, description="Number of items per page"),
|
||||
filters: Optional[str] = Query(None, description="JSON-encoded filter criteria"),
|
||||
sort_by: Optional[str] = Query(None, description="Field to sort by (e.g., 'duration', 'created_at')"),
|
||||
sort_order: Optional[str] = Query("desc", description="Sort order ('asc' or 'desc')"),
|
||||
sort_by: Optional[str] = Query(
|
||||
None, description="Field to sort by (e.g., 'duration', 'created_at')"
|
||||
),
|
||||
sort_order: Optional[str] = Query(
|
||||
"desc", description="Sort order ('asc' or 'desc')"
|
||||
),
|
||||
user: UserModel = Depends(get_superuser),
|
||||
) -> SuperuserWorkflowRunsListResponse:
|
||||
"""
|
||||
|
|
@ -131,7 +135,11 @@ async def get_workflow_runs(
|
|||
sort_order = "desc"
|
||||
|
||||
workflow_runs, total_count = await db_client.get_workflow_runs_for_superadmin(
|
||||
limit=limit, offset=offset, filters=filter_criteria, sort_by=sort_by, sort_order=sort_order
|
||||
limit=limit,
|
||||
offset=offset,
|
||||
filters=filter_criteria,
|
||||
sort_by=sort_by,
|
||||
sort_order=sort_order,
|
||||
)
|
||||
|
||||
total_pages = (total_count + limit - 1) // limit # Ceiling division
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue