| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 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 logdog | 5 package logdog |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "errors" | 8 "errors" |
| 9 "fmt" | 9 "fmt" |
| 10 "time" | 10 "time" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 if server == "" { | 196 if server == "" { |
| 197 server = b.Host | 197 server = b.Host |
| 198 } | 198 } |
| 199 | 199 |
| 200 prefix := types.StreamName(ls.Prefix) | 200 prefix := types.StreamName(ls.Prefix) |
| 201 if prefix == "" { | 201 if prefix == "" { |
| 202 prefix = b.Prefix | 202 prefix = b.Prefix |
| 203 } | 203 } |
| 204 | 204 |
| 205 u := viewer.GetURL(server, b.Project, prefix.Join(types.StreamNa
me(ls.Name))) | 205 u := viewer.GetURL(server, b.Project, prefix.Join(types.StreamNa
me(ls.Name))) |
| 206 » » link := resp.Link{ | 206 » » link := resp.NewLink(l.Label, u) |
| 207 » » » Label: l.Label, | |
| 208 » » » URL: u, | |
| 209 » » } | |
| 210 if link.Label == "" { | 207 if link.Label == "" { |
| 211 link.Label = ls.Name | 208 link.Label = ls.Name |
| 212 } | 209 } |
| 213 » » return &link | 210 » » return link |
| 214 | 211 |
| 215 case *miloProto.Link_Url: | 212 case *miloProto.Link_Url: |
| 216 » » link := resp.Link{ | 213 » » link := resp.NewLink(l.Label, t.Url) |
| 217 » » » Label: l.Label, | |
| 218 » » » URL: t.Url, | |
| 219 » » } | |
| 220 if link.Label == "" { | 214 if link.Label == "" { |
| 221 link.Label = "unnamed" | 215 link.Label = "unnamed" |
| 222 } | 216 } |
| 223 » » return &link | 217 » » return link |
| 224 | 218 |
| 225 default: | 219 default: |
| 226 // Don't know how to render. | 220 // Don't know how to render. |
| 227 return nil | 221 return nil |
| 228 } | 222 } |
| 229 } | 223 } |
| OLD | NEW |