mirror of
https://github.com/mpolden/echoip.git
synced 2025-07-16 22:13:33 +02:00
Patch for ISO and Map display (#45)
This commit is contained in:
committed by
Martin Polden
parent
9f839c5f36
commit
c195bae4fb
16
index.html
16
index.html
@ -63,6 +63,10 @@ $ bat -print=b {{ .Host }}/ip
|
||||
<pre>
|
||||
$ http {{ .Host }}/country
|
||||
{{ .Country }}</pre>
|
||||
<h2>Short country code (ISO 3166-1 alpha-2) lookup:</h2>
|
||||
<pre>
|
||||
$ http {{ .Host }}/country-iso
|
||||
{{ .CountryISO }}</pre>
|
||||
{{ end }}
|
||||
{{ if .IsLookupCityEnabled }}
|
||||
<h2>City lookup:</h2>
|
||||
@ -76,8 +80,9 @@ $ http {{ .Host }}/city
|
||||
<pre>
|
||||
$ http {{ .Host }}/json
|
||||
{ {{ if .IsLookupCityEnabled }}
|
||||
"city": "{{ .City }}",{{ end }}{{ if .IsLookupCountryEnabled }}
|
||||
"country": "{{ .Country }}",{{ end }}{{ if .IsLookupAddrEnabled }}
|
||||
"city": "{{ .City }}",
|
||||
"country": "{{ .Country }}",
|
||||
"country_iso": "{{ .CountryISO }}",{{ end }}{{ if .IsLookupAddrEnabled }}
|
||||
"hostname": "{{ .Hostname }}",{{ end }}
|
||||
"ip": "{{ .IP }}",
|
||||
"ip_decimal": {{ .IPDecimal }}
|
||||
@ -100,6 +105,13 @@ $ http {{ .Host }}/port/8080
|
||||
}</pre>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ if .IsLookupCountryEnabled }}{{ if ne .Country "Unknown"}}{{ if .IsLookupCityEnabled }}{{ if ne .City "Unknown"}}
|
||||
<div class="pure-u-1 pure-u-md-1-1">
|
||||
<h2>Map</h2>
|
||||
<p><img src="https://maps.googleapis.com/maps/api/staticmap?size=600x200&scale=2&markers=color%3Aorange%7Clabel%3AS%7c{{ .City }},{{ .Country }}" width="600" height="200"/>
|
||||
</p>
|
||||
{{ end }}{{ end }}{{ end }}{{ end }}
|
||||
</div>
|
||||
<div class="pure-u-1 pure-u-md-1-1">
|
||||
<h2>FAQ</h2>
|
||||
<h3>How do I force IPv4 or IPv6 lookup?</h3>
|
||||
|
Reference in New Issue
Block a user