Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: milo/appengine/buildbot/html.go

Issue 2810113002: Milo buildbot builder page: Add pagnation with cursors. (Closed)
Patch Set: Touchups Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: milo/appengine/buildbot/html.go
diff --git a/milo/appengine/buildbot/html.go b/milo/appengine/buildbot/html.go
index bde2071bb83b558daf4c747bc75e9b41fda32f30..dedd5ccd30be75a4f793ce0cd7a9f5d6036016b2 100644
--- a/milo/appengine/buildbot/html.go
+++ b/milo/appengine/buildbot/html.go
@@ -9,6 +9,7 @@ import (
"net/http"
"strconv"
+ "github.com/luci/gae/service/datastore"
"github.com/luci/luci-go/milo/appengine/common"
"github.com/luci/luci-go/server/router"
"github.com/luci/luci-go/server/templates"
@@ -80,8 +81,19 @@ func BuilderHandler(c *router.Context) {
if limit < 0 {
limit = 25
}
+ sCursor := c.Request.FormValue("cursor")
- result, err := builderImpl(c.Context, master, builder, limit)
+ var thisCursor *datastore.Cursor
+ if sCursor != "" {
+ tmpCur, err := datastore.DecodeCursor(c.Context, sCursor)
+ if err != nil {
+ common.ErrorPage(c, http.StatusBadRequest, fmt.Sprintf("bad cursor: %s", err.Error()))
+ return
+ }
+ thisCursor = &tmpCur
+ }
+
+ result, err := builderImpl(c.Context, master, builder, limit, thisCursor)
if err != nil {
common.ErrorPage(c, http.StatusInternalServerError, err.Error())
return

Powered by Google App Engine
This is Rietveld 408576698