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

Side by Side Diff: appengine/cmd/cron/ui/project.go

Issue 2043423004: Make HTTP middleware easier to use (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: gaemiddleware: add middleware func for WithProd Created 4 years, 6 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 | « appengine/cmd/cron/ui/job.go ('k') | appengine/cmd/dm/distributor/handlers.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 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 ui 5 package ui
6 6
7 import ( 7 import (
8 "net/http"
9
10 "github.com/julienschmidt/httprouter"
11 "golang.org/x/net/context"
12
13 "github.com/luci/luci-go/common/clock" 8 "github.com/luci/luci-go/common/clock"
9 "github.com/luci/luci-go/server/router"
14 "github.com/luci/luci-go/server/templates" 10 "github.com/luci/luci-go/server/templates"
15 ) 11 )
16 12
17 func projectPage(c context.Context, w http.ResponseWriter, r *http.Request, p ht tprouter.Params) { 13 func projectPage(c *router.Context) {
18 » projectID := p.ByName("ProjectID") 14 » projectID := c.Params.ByName("ProjectID")
19 » jobs, err := config(c).Engine.GetProjectCronJobs(c, projectID) 15 » jobs, err := config(c.Context).Engine.GetProjectCronJobs(c.Context, proj ectID)
20 if err != nil { 16 if err != nil {
21 panic(err) 17 panic(err)
22 } 18 }
23 » templates.MustRender(c, w, "pages/project.html", map[string]interface{}{ 19 » templates.MustRender(c.Context, c.Writer, "pages/project.html", map[stri ng]interface{}{
24 "ProjectID": projectID, 20 "ProjectID": projectID,
25 » » "Jobs": convertToSortedCronJobs(jobs, clock.Now(c).UTC()), 21 » » "Jobs": convertToSortedCronJobs(jobs, clock.Now(c.Context). UTC()),
26 }) 22 })
27 } 23 }
OLDNEW
« no previous file with comments | « appengine/cmd/cron/ui/job.go ('k') | appengine/cmd/dm/distributor/handlers.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698