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

Side by Side Diff: milo/frontend/view_builder.go

Issue 2976393002: Milo: Fix ?limit= param (Closed)
Patch Set: review Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « milo/frontend/middleware.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The LUCI Authors. All rights reserved. 1 // Copyright 2017 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package frontend 5 package frontend
6 6
7 import ( 7 import (
8 "github.com/luci/luci-go/milo/buildsource" 8 "github.com/luci/luci-go/milo/buildsource"
9 "github.com/luci/luci-go/server/router" 9 "github.com/luci/luci-go/server/router"
10 "github.com/luci/luci-go/server/templates" 10 "github.com/luci/luci-go/server/templates"
11 ) 11 )
12 12
13 // BuilderHandler is responsible for taking a universal builder ID and rendering 13 // BuilderHandler is responsible for taking a universal builder ID and rendering
14 // the builder page (defined in ./appengine/templates/pages/builder.html). 14 // the builder page (defined in ./appengine/templates/pages/builder.html).
15 func BuilderHandler(c *router.Context, builderID buildsource.BuilderID) { 15 func BuilderHandler(c *router.Context, builderID buildsource.BuilderID) {
16 » builder, err := builderID.Get(c.Context, c.Params.ByName("limit"), c.Par ams.ByName("cursor")) 16 » limit := 25
17 » if tLimit := GetLimit(c.Request, -1); tLimit >= 0 {
18 » » limit = tLimit
19 » }
20 » builder, err := builderID.Get(c.Context, limit, c.Request.FormValue("cur sor"))
17 // TODO(iannucci, hinoka): make MiloBuild refer to annotation stream by 21 // TODO(iannucci, hinoka): make MiloBuild refer to annotation stream by
18 // host/prefix/path instead of by directly pulling it. Do all annotation 22 // host/prefix/path instead of by directly pulling it. Do all annotation
19 // stream rendering in the frontend. 23 // stream rendering in the frontend.
20 if err != nil { 24 if err != nil {
21 ErrorHandler(c, err) 25 ErrorHandler(c, err)
22 } else { 26 } else {
23 templates.MustRender(c.Context, c.Writer, "pages/builder.html", templates.Args{ 27 templates.MustRender(c.Context, c.Writer, "pages/builder.html", templates.Args{
24 "Builder": builder, 28 "Builder": builder,
25 }) 29 })
26 } 30 }
27 } 31 }
OLDNEW
« no previous file with comments | « milo/frontend/middleware.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698