Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 indexPage(c context.Context, w http.ResponseWriter, r *http.Request, p http router.Params) { | 13 func indexPage(c *router.Context) { |
| 18 » jobs, err := config(c).Engine.GetAllCronJobs(c) | 14 » jobs, err := config(c.Context).Engine.GetAllCronJobs(c.Context) |
|
iannucci
2016/06/13 19:23:28
wdyt about making router.Context embed context.Con
| |
| 19 if err != nil { | 15 if err != nil { |
| 20 panic(err) | 16 panic(err) |
| 21 } | 17 } |
| 22 » templates.MustRender(c, w, "pages/index.html", map[string]interface{}{ | 18 » templates.MustRender(c.Context, c.Writer, "pages/index.html", map[string ]interface{}{ |
| 23 » » "Jobs": convertToSortedCronJobs(jobs, clock.Now(c).UTC()), | 19 » » "Jobs": convertToSortedCronJobs(jobs, clock.Now(c.Context).UTC() ), |
| 24 }) | 20 }) |
| 25 } | 21 } |
| OLD | NEW |