Rearrange columns

This commit is contained in:
Martin Polden 2018-02-09 20:59:28 +01:00
parent 64bb0e56c7
commit b3e0079aa4
1 changed files with 18 additions and 18 deletions

View File

@ -42,7 +42,7 @@
</div>
<div class="pure-g">
<div class="pure-u-1 pure-u-md-1-2">
<h2>CLI examples:</h2>
<h2>CLI examples</h2>
<pre>
$ curl {{ .Host }}
{{ .IP }}
@ -59,7 +59,7 @@ $ fetch -qo- https://{{ .Host }}
$ bat -print=b {{ .Host }}/ip
{{ .IP }}</pre>
{{ if .IsLookupCountryEnabled }}
<h2>Country lookup:</h2>
<h2>Country lookup</h2>
<pre>
$ http {{ .Host }}/country
{{ .Country }}
@ -68,50 +68,50 @@ $ http {{ .Host }}/country-iso
{{ .CountryISO }}</pre>
{{ end }}
{{ if .IsLookupCityEnabled }}
<h2>City lookup:</h2>
<h2>City lookup</h2>
<pre>
$ http {{ .Host }}/city
{{ .City }}</pre>
{{ end }}
</div>
<div class="pure-u-1 pure-u-md-1-2">
<h2>JSON output:</h2>
<h2>JSON output</h2>
<pre>
$ http {{ .Host }}/json
{ {{ if .IsLookupCityEnabled }}
"city": "{{ .City }}",
"country": "{{ .Country }}",
"country_iso": "{{ .CountryISO }}",{{ end }}{{ if .IsLookupAddrEnabled }}
"hostname": "{{ .Hostname }}",{{ end }}
"ip": "{{ .IP }}",
"ip_decimal": {{ .IPDecimal }}
"city": "{{ .City }}",
"country": "{{ .Country }}",
"country_iso": "{{ .CountryISO }}",{{ end }}{{ if .IsLookupAddrEnabled }}
"hostname": "{{ .Hostname }}",{{ end }}
"ip": "{{ .IP }}",
"ip_decimal": {{ .IPDecimal }}
}</pre>
<p>Setting the Accept header to application/json also works.</p>
<h2>Plain output:</h2>
<h2>Plain output</h2>
<p>Always returns the IP address including a trailing newline, regardless of user agent.</p>
<pre>
$ http {{ .Host }}/ip
{{ .IP }}</pre>
{{ if .IsLookupPortEnabled }}
<h2>Testing port connectivity:</h2>
<h2>Port testing</h2>
<pre>
$ http {{ .Host }}/port/8080
{
"ip": "{{ .IP }}",
"port": 8080,
"reachable": false
"ip": "{{ .IP }}",
"port": 8080,
"reachable": false
}</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">
<div class="pure-u-1 pure-u-md-1-2">
<h2>Map</h2>
<p><img src="https://maps.googleapis.com/maps/api/staticmap?size=600x200&amp;scale=2&amp;markers=color%3Aorange%7Clabel%3AS%7c{{ .City }},{{ .Country }}" width="600" height="200"/>
<p><img src="https://maps.googleapis.com/maps/api/staticmap?size=500x166&amp;scale=2&amp;markers=color%3Aorange%7Clabel%3AS%7c{{ .City }},{{ .Country }}" width="500" height="166"/>
</p>
{{ end }}{{ end }}{{ end }}{{ end }}
</div>
<div class="pure-u-1 pure-u-md-1-1">
<div class="pure-u-1 pure-u-md-1-2">
<h2>FAQ</h2>
<h3>How do I force IPv4 or IPv6 lookup?</h3>
<p>IPv4 or IPv6 lookup can be forced by using the <a href="//v4.ifconfig.co">v4</a> and <a href="//v6.ifconfig.co">v6<a> subdomains.</p>