mirror of
https://github.com/mpolden/echoip.git
synced 2025-07-16 14:03:31 +02:00
Only display enabled features on web page
This commit is contained in:
@ -58,11 +58,13 @@ $ wget -qO- ifconfig.co
|
||||
$ fetch -qo- http://ifconfig.co
|
||||
{{ .IP }}
|
||||
</pre>
|
||||
{{ if .CountryLookup }}
|
||||
<p>Country lookup:</p>
|
||||
<pre>
|
||||
$ http ifconfig.co/country
|
||||
{{ .Country }}
|
||||
</pre>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="pure-u-1-2">
|
||||
<p>JSON output:</p>
|
||||
@ -73,11 +75,13 @@ Content-Length: 61
|
||||
Content-Type: application/json
|
||||
Date: Fri, 15 Apr 2016 17:26:53 GMT
|
||||
|
||||
{
|
||||
"country": "{{ .Country }}",
|
||||
{ {{ if .CountryLookup }}
|
||||
"country": "{{ .Country }}",{{ end }}{{ if .ReverseLookup }}
|
||||
"hostname": "{{ .Hostname }}",{{ end }}
|
||||
"ip": "{{ .IP }}"
|
||||
}
|
||||
</pre>
|
||||
{{ if .PortTesting }}
|
||||
<p>Testing port connectivity (only supports JSON output):</p>
|
||||
<pre>
|
||||
http --json localhost:8080/port/8080
|
||||
@ -92,6 +96,7 @@ Date: Fri, 15 Apr 2016 18:47:20 GMT
|
||||
"reachable": true
|
||||
}
|
||||
</pre>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="pure-g">
|
||||
|
Reference in New Issue
Block a user