mirror of
https://git.dn42.dev/lare/myip.dn42.git
synced 2024-10-24 03:11:33 +02:00
add static html site with clientside js
This commit is contained in:
parent
7feff33885
commit
eb09c13ce0
4 changed files with 127 additions and 7 deletions
92
wwwroot/index.html
Normal file
92
wwwroot/index.html
Normal file
|
@ -0,0 +1,92 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<title>myip.dn42</title>
|
||||
|
||||
<meta name="author" content="dn42 community">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="index, follow">
|
||||
<meta name="description" content="This service can tell you your IP address in dn42.">
|
||||
<meta name="keywords" content="what is my ip,my ip">
|
||||
|
||||
<link rel="icon" type="image/png" href="/favicon.png">
|
||||
<link rel="shortcut icon" type="image/png" href="/favicon.png">
|
||||
|
||||
<link rel="stylesheet" href="/assets/css/normalize.css" integrity="sha384-M86HUGbBFILBBZ9ykMAbT3nVb0+2C7yZlF8X2CiKNpDOQjKroMJqIeGZ/Le8N2Qp">
|
||||
<link rel="stylesheet" href="/assets/css/simple.min.css" integrity="sha384-ZLDMtZ+NjwNE3nk4wWLGpX4atVTD4fql9ruaAw2xFz7CLPlFcwrifgX2HgkdX6X7">
|
||||
<script>
|
||||
function getdefault() {
|
||||
fetch('/api')
|
||||
.then(function (response) {
|
||||
return response.json();
|
||||
})
|
||||
.then(function (data) {
|
||||
document.getElementById("defaultip").innerHTML=data.ip;
|
||||
document.getElementById("serverdefault").innerHTML=data.server;
|
||||
document.getElementById("node_as").innerHTML=data.node_as;
|
||||
document.getElementById("node_location").innerHTML=data.node_location;
|
||||
document.getElementById("node_id").innerHTML=data.node_id;
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function getipv4() {
|
||||
fetch('http://v4.myip.dn42/api')
|
||||
.then(function (response) {
|
||||
return response.json();
|
||||
})
|
||||
.then(function (data) {
|
||||
document.getElementById("ipv4").innerHTML=data.ip;
|
||||
document.getElementById("serveripv4").innerHTML=data.server;
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
function getipv6() {
|
||||
fetch('http://v6.myip.dn42/api')
|
||||
.then(function (response) {
|
||||
return response.json();
|
||||
})
|
||||
.then(function (data) {
|
||||
document.getElementById("ipv6").innerHTML=data.ip;
|
||||
document.getElementById("serveripv6").innerHTML=data.server;
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
window.onload = function () {
|
||||
getdefault();
|
||||
getipv4();
|
||||
getipv6();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>myip.dn42</h1>
|
||||
</header>
|
||||
<main>
|
||||
<div>
|
||||
<h2>Your IP address</h2>
|
||||
Your default IP address is <strong><span id=defaultip>fetching from <a href="/api">api</a></span></strong>.<br>
|
||||
Your IPv4 address is <strong><span id=ipv4>fetching from <a href="http://v4.myip.dn42/api">api</a></span></strong>.<br>
|
||||
Your IPv6 address is <strong><span id=ipv6>fetching from <a href="http://v6.myip.dn42/api">api</a></span></strong>.<br>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Remote Node</h2>
|
||||
The node's ip address is <span id="serverdefault">fetching from <a href="/api">api</a></span>. <br>
|
||||
The node's ipv4 address is <span id="serveripv4">fetching from <a href="http://v4.myip.dn42/api">api</a></span>.<br>
|
||||
The node's ipv6 address is <span id="serveripv6">fetching from <a href="http://v6.myip.dn42/api">api</a></span>.<br>
|
||||
You have reached the myip.dn42 service of AS<span id="node_as">fetching from <a href="/api">api</a></span>. The server is located in <span id="node_location">fetching from <a href="/api">api</a></span> . The server has the ID/name <code id="node_id">fetching from <a href="/api">api</a></code>.
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
<p>
|
||||
This service is provided by the dn42 community. Anycast is used to ensure the reliability of the service. Bugs or feedback about the service can be submitted via the Mailling list or the <a href="https://git.dn42.dev/lare/myip.dn42/issues">issue tracker</a>.
|
||||
</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue