feat: repo list search, header sort, pagination (stage 6)
- list_repos: Pulp next 페이지 끝까지 순회 (첫-페이지-only 누락 수정) - BFF 메모리 검색(이름)·정렬(이름/검증/버전/패키지/동기화)·페이지네이션(20/페이지) - GET /repos/table 조각: 검색창은 표 밖(포커스 유지), 정렬헤더/페이저는 표 안, hx-include 로 검색어·정렬상태 상호 전송 - 폰트 재조정: 데이터 셀 14px, 헤더 13px, 배지/액션버튼 14px (동기화 버튼 대비 균형) - 버전 페이지 제목↔검증상세 마진, 데모 저장소 26개로 확장 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
19
app/views.py
19
app/views.py
@@ -139,6 +139,25 @@ def verification_detail(repo: dict[str, Any]) -> dict[str, Any]:
|
||||
}
|
||||
|
||||
|
||||
_REPO_SORT_KEYS = {
|
||||
"name": lambda r: (r["name"] or "").lower(),
|
||||
"verified": lambda r: {"pass": 0, "warn": 1, "unset": 2}.get(
|
||||
(r["gpg"] or {}).get("level"), 3
|
||||
),
|
||||
"version": lambda r: r["latest_version"] if r["latest_version"] is not None else -1,
|
||||
"packages": lambda r: r["package_count"] if r["package_count"] is not None else -1,
|
||||
"last_sync": lambda r: r["last_sync"] or "",
|
||||
}
|
||||
|
||||
|
||||
def sort_repos(
|
||||
repo_views: list[dict[str, Any]], key: str, direction: str = "asc"
|
||||
) -> list[dict[str, Any]]:
|
||||
"""대시보드 헤더 정렬. 알 수 없는 key 는 이름순으로 폴백."""
|
||||
fn = _REPO_SORT_KEYS.get(key) or _REPO_SORT_KEYS["name"]
|
||||
return sorted(repo_views, key=fn, reverse=(direction == "desc"))
|
||||
|
||||
|
||||
def summarize(repo_views: list[dict[str, Any]], syncing: int = 0) -> dict[str, int]:
|
||||
"""상단 요약 카드 수치. syncing 은 task_store.active_count() 에서 주입."""
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user