From: Michael Tremer Date: Wed, 31 Dec 2025 14:36:28 +0000 (+0000) Subject: dnsbl: Allow to go backwards in history X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cb363d449dae902a8df77781516d8e7273739af;p=ipfire.org.git dnsbl: Allow to go backwards in history Signed-off-by: Michael Tremer --- diff --git a/src/backend/dnsbl.py b/src/backend/dnsbl.py index 62bb5213..3f590827 100644 --- a/src/backend/dnsbl.py +++ b/src/backend/dnsbl.py @@ -242,12 +242,12 @@ class List(Model): # History - async def get_history(self, limit=None): + async def get_history(self, before=None, limit=None): """ Fetches the history of this list """ response = await self._backend.dnsbl._fetch( - "/lists/%s/history" % self.slug, args={ "limit" : limit }, + "/lists/%s/history" % self.slug, args={ "before" : before, "limit" : limit }, ) return [History(self._backend, **data) for data in response] diff --git a/src/templates/dnsbl/lists/history.html b/src/templates/dnsbl/lists/history.html index e77ce5b1..fa281920 100644 --- a/src/templates/dnsbl/lists/history.html +++ b/src/templates/dnsbl/lists/history.html @@ -10,6 +10,8 @@ {% block title %}{{ _("IPFire DNSBL") }} - {{ list }} - {{ _("History") }}{% end block %} {% block container %} + {% import urllib.parse %} +
@@ -87,4 +89,19 @@
{% end %} + + {# Pagination #} +
+
+ +
+
{% end block %} diff --git a/src/web/dnsbl.py b/src/web/dnsbl.py index 58360111..3cbbe364 100644 --- a/src/web/dnsbl.py +++ b/src/web/dnsbl.py @@ -40,7 +40,10 @@ class ListHistoryHandler(base.AnalyticsMixin, BaseHandler): raise tornado.web.HTTPError(404, "Could not find list '%s'" % slug) # Fetch the history - history = await list.get_history(limit=10) + history = await list.get_history( + before = self.get_argument("before", None), + limit = 10, + ) # Render the page self.render("dnsbl/lists/history.html", list=list, history=history)