| 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 swarming | 5 package swarming |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "net/http" | 8 "net/http" |
| 9 "os" | 9 "os" |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 logname := p.ByName("logname") | 54 logname := p.ByName("logname") |
| 55 if logname == "" { | 55 if logname == "" { |
| 56 return nil, &miloerror.Error{ | 56 return nil, &miloerror.Error{ |
| 57 Message: "No log name", | 57 Message: "No log name", |
| 58 Code: http.StatusBadRequest, | 58 Code: http.StatusBadRequest, |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 » log, err := swarmingBuildLogImpl(c, getServer(r), id, logname) | 62 » log, closed, err := swarmingBuildLogImpl(c, getServer(r), id, logname) |
| 63 if err != nil { | 63 if err != nil { |
| 64 return nil, convertErr(err) | 64 return nil, convertErr(err) |
| 65 } | 65 } |
| 66 | 66 |
| 67 args := &templates.Args{ | 67 args := &templates.Args{ |
| 68 » » "Log": log, | 68 » » "Log": log, |
| 69 » » "Closed": closed, |
| 69 } | 70 } |
| 70 return args, nil | 71 return args, nil |
| 71 } | 72 } |
| 72 | 73 |
| 73 // GetTemplateName for Build returns the template name for build pages. | 74 // GetTemplateName for Build returns the template name for build pages. |
| 74 func (b Build) GetTemplateName(t settings.Theme) string { | 75 func (b Build) GetTemplateName(t settings.Theme) string { |
| 75 return "build.html" | 76 return "build.html" |
| 76 } | 77 } |
| 77 | 78 |
| 78 // Render renders both the build page and the log. | 79 // Render renders both the build page and the log. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 109 } | 110 } |
| 110 | 111 |
| 111 // isAPINotFound returns true if err is a HTTP 404 API response. | 112 // isAPINotFound returns true if err is a HTTP 404 API response. |
| 112 func isAPINotFound(err error) bool { | 113 func isAPINotFound(err error) bool { |
| 113 if apiErr, ok := err.(*googleapi.Error); ok && apiErr.Code == http.Statu
sNotFound { | 114 if apiErr, ok := err.(*googleapi.Error); ok && apiErr.Code == http.Statu
sNotFound { |
| 114 return true | 115 return true |
| 115 } | 116 } |
| 116 | 117 |
| 117 return false | 118 return false |
| 118 } | 119 } |
| OLD | NEW |