forked from mpolden/echoip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
83 lines (83 loc) · 2.88 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>What is my IP address? — ifconfig.k0nsl.org</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="What is my IP address?">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/pure-min.css">
<style>
body {
font-family: "Press Start 2P", sans-serif;
font-size: 12px;
}
.response {
font-family: "Press Start 2P", monospace;
}
.content {
margin-left: auto;
margin-right: auto;
max-width: 1024px;
}
#wrapper {
margin-bottom: 10px;
text-align: center;
}
.ip {
border: 1px solid #cbcbcb;
background: #f2f2f2;
font-size: 36px;
}
</style>
<script type="text/javascript">
WebFontConfig = {
google: { families: [ 'Roboto:300:latin' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://survivor.k0nsl.org/js/webfont/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
</script>
</head>
<body>
<div class="content">
<div id="wrapper">
<h1>What is my IP address?</h1>
<h2>Your IP:</h2>
<p><code class="ip">{{ .IP }}</code></p>
<a href="?cmd=curl" class="pure-button{{ if eq .Cmd.Name "curl" }} pure-button-active pure-button-primary{{end}}">curl</a>
<a href="?cmd=wget" class="pure-button{{ if eq .Cmd.Name "wget" }} pure-button-active pure-button-primary{{end}}">wget</a>
<a href="?cmd=fetch" class="pure-button{{ if eq .Cmd.Name "fetch" }} pure-button-active pure-button-primary{{end}}">fetch</a>
</div>
<table class="pure-table pure-table-bordered pure-table-striped">
<thead>
<tr>
<th style="width: 350px">Command</th>
<th>Response</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><span class="command">{{ .Cmd.String }}</span> ifconfig.k0nsl.org</code></td>
<td class="response">{{ .IP }}</td>
</tr>
{{ if $self := . }}
{{ range $key, $value := .Header }}
<tr>
<td><code><span class="command">{{ $self.Cmd.String }}</span> ifconfig.k0nsl.org/{{ ToLower $key }}</code></td>
<td class="response">{{ index $self.Header $key 0 }}</td>
</tr>
{{end}}
{{end}}
<td><code><span class="command">{{ .Cmd.String }}</span> ifconfig.k0nsl.org/all.json</code></td>
<td><pre class="response">{{ .JSON }}</pre></td>
</tbody>
</table>
</div>
</body>
</html>