diff --git a/archivebox/config/common.py b/archivebox/config/common.py index 31e8abf5..f15de884 100644 --- a/archivebox/config/common.py +++ b/archivebox/config/common.py @@ -193,7 +193,7 @@ class ServerConfig(BaseConfigSet): CSRF_TRUSTED_ORIGINS: str = Field(default="") SERVER_SECURITY_MODE: str = Field(default="safe-subdomains-fullreplay") - SNAPSHOTS_PER_PAGE: int = Field(default=40) + SNAPSHOTS_PER_PAGE: int = Field(default=50, ge=1) FOOTER_INFO: str = Field( default="Content is hosted for personal archiving purposes only. Contact server owner for any takedown requests.", ) diff --git a/archivebox/core/admin_archiveresults.py b/archivebox/core/admin_archiveresults.py index d5fb048b..7de662bc 100644 --- a/archivebox/core/admin_archiveresults.py +++ b/archivebox/core/admin_archiveresults.py @@ -498,7 +498,7 @@ class ArchiveResultAdmin(BaseModelAdmin): self.request = request request.archivebox_config = getattr(request, "archivebox_config", None) or get_config() saved_list_per_page = self.list_per_page - self.list_per_page = min(max(5, request.archivebox_config.SNAPSHOTS_PER_PAGE), 5000) + self.list_per_page = request.archivebox_config.SNAPSHOTS_PER_PAGE try: return super().changelist_view(request, extra_context) finally: diff --git a/archivebox/core/admin_snapshots.py b/archivebox/core/admin_snapshots.py index 9b7aaad0..66b9d1b6 100644 --- a/archivebox/core/admin_snapshots.py +++ b/archivebox/core/admin_snapshots.py @@ -568,7 +568,7 @@ class SnapshotAdmin(SearchResultsAdminMixin, ConfigEditorMixin, BaseModelAdmin): requested_per_page = 200 self.list_per_page = min(max(200, requested_per_page), 500) else: - self.list_per_page = min(max(50, request.archivebox_config.SNAPSHOTS_PER_PAGE), 500) + self.list_per_page = request.archivebox_config.SNAPSHOTS_PER_PAGE extra_context = extra_context or {} extra_context["embedded_changelist"] = embedded_changelist extra_context["CONFIG"] = request.archivebox_config diff --git a/docs/Configuration.md b/docs/Configuration.md index 2bcadab0..97e03526 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -424,9 +424,9 @@ More info: --- #### `SNAPSHOTS_PER_PAGE` -**Possible Values:** [`40`]/`100`/... +**Possible Values:** [`50`]/`25`/`100`/`200`/... -Maximum number of Snapshots to render per page on the snapshot list views (both the admin index and the public index). Larger values speed up bulk browsing at the cost of heavier per-request rendering. +Number of rows to render per page on the Snapshot and ArchiveResult list views (admin index, public index, and the Django admin changelists for both models). Lower values reduce per-request render time; higher values speed up bulk browsing at the cost of heavier rendering. Must be ≥ 1. --- #### `FOOTER_INFO`