mirror of https://github.com/mpolden/echoip
parent
e5c8310acb
commit
cba0928a65
14
http/http.go
14
http/http.go
|
@ -222,12 +222,20 @@ func (s *Server) DefaultHandler(w http.ResponseWriter, r *http.Request) *appErro
|
|||
}
|
||||
var data = struct {
|
||||
Response
|
||||
Host string
|
||||
JSON string
|
||||
Port bool
|
||||
Host string
|
||||
BoxLatTop float64
|
||||
BoxLatBottom float64
|
||||
BoxLonLeft float64
|
||||
BoxLonRight float64
|
||||
JSON string
|
||||
Port bool
|
||||
}{
|
||||
response,
|
||||
r.Host,
|
||||
response.Latitude + 0.05,
|
||||
response.Latitude - 0.05,
|
||||
response.Longitude - 0.05,
|
||||
response.Longitude + 0.05,
|
||||
string(json),
|
||||
s.LookupPort != nil,
|
||||
}
|
||||
|
|
|
@ -97,6 +97,12 @@ $ http {{ .Host }}/port/8080
|
|||
}</pre>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ if .City }}
|
||||
<div class="pure-u-1 pure-u-md-1-1">
|
||||
<h2>Map</h2>
|
||||
<iframe width="100%" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://www.openstreetmap.org/export/embed.html?bbox={{ .BoxLonLeft }}%2C{{ .BoxLatBottom }}%2C{{ .BoxLonRight }}%2C{{ .BoxLatTop }}&layer=mapnik&marker={{ .Latitude }}%2C{{ .Longitude }}"></iframe>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="pure-u-1 pure-u-md-1-2">
|
||||
<h2>FAQ</h2>
|
||||
<h3>How do I force IPv4 or IPv6 lookup?</h3>
|
||||
|
|
Loading…
Reference in New Issue