tailscale / tmemes

A meme generator for your tailnet!
BSD 3-Clause "New" or "Revised" License
42 stars 1 forks source link

Add pagination to the UI serving endpoints. #7

Closed creachadair closed 1 year ago

creachadair commented 1 year ago

The UI now accepts the same "page" and "count" parameters as the API endpoints, but defaults to page=1 if they are not provided.

The UI data now includes .Page, .HasNextPage, and .HasPrevPage parameters so that the template can make choices based on where it is. The function map now has add1 and sub1 functions to increment or decrement a page count. To make it a little safer for the template, sub1 saturates at 1, so "sub1 1" yields 1.