Changes:
1. integrates pico minimal responsive css framework for light/dark
themes and overall better looks.
2. adds a not-found page for bad url queries.
3. catches axum/serde deserialization errors of user input and routes
them to the not-found page with a helpful hint (parse error msg)
111 lines
3.1 KiB
HTML
111 lines
3.1 KiB
HTML
<html>
|
|
<head>
|
|
<title>Neptune Block Explorer: (network: {{self.network}})</title>
|
|
<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen" />
|
|
<link rel="stylesheet" type="text/css" href="/css/pico.min.css" media="screen" />
|
|
|
|
<script>
|
|
function handle_submit(form) {
|
|
let value = form.height_or_digest.value;
|
|
var is_digest = value.length == 80;
|
|
var type = is_digest ? "digest" : "height";
|
|
var uri = form.action + "/" + type + "/" + value;
|
|
window.location.href = uri;
|
|
return false;
|
|
}
|
|
function handle_utxo_submit(form) {
|
|
let value = form.utxo.value;
|
|
var uri = form.action + "/" + value;
|
|
window.location.href = uri;
|
|
return false;
|
|
}
|
|
</script>
|
|
|
|
</head>
|
|
<body>
|
|
<header class="container">
|
|
<h1>Neptune Block Explorer (network: {{self.network}})</h1>
|
|
</header>
|
|
|
|
<main class="container">
|
|
|
|
<article>
|
|
<details open>
|
|
<summary>Block Lookup</summary>
|
|
<form action="/block" method="get" onsubmit="return handle_submit(this)">
|
|
Block height or digest:
|
|
<input type="text" size="80" name="height_or_digest"/>
|
|
<input type="submit" name="height" value="Lookup Block"/>
|
|
</form>
|
|
|
|
Quick Lookup:
|
|
<a href="/block/genesis">Genesis Block</a> |
|
|
<a href="/block/tip">Tip</a><br/>
|
|
</details>
|
|
</article>
|
|
|
|
<article>
|
|
<details>
|
|
<summary>Utxo Lookup</summary>
|
|
<form action="/utxo" method="get" onsubmit="return handle_utxo_submit(this)">
|
|
Utxo index:
|
|
<input type="text" size="10" name="utxo" />
|
|
<input type="submit" name="height" value="Lookup Utxo" />
|
|
</form>
|
|
</details>
|
|
</article>
|
|
|
|
<h2>REST RPCs</h2>
|
|
|
|
<article>
|
|
<details>
|
|
<summary>/block_info</summary>
|
|
<div class="indent">
|
|
<h4>Examples</h4>
|
|
|
|
<ul>
|
|
<li><a href="/rpc/block_info/genesis">/rpc/block_info/genesis</a></li>
|
|
<li><a href="/rpc/block_info/tip">/rpc/block_info/tip</a></li>
|
|
<li><a href="/rpc/block_info/height/2">/rpc/block_info/height/2</a></li>
|
|
<li><a href="/rpc/block_info/digest/{{self.genesis_digest.to_hex()}}">/rpc/block_info/digest/{{self.genesis_digest.to_hex()}}</a></li>
|
|
<li><a href="/rpc/block_info/height_or_digest/1">/rpc/block_info/height_or_digest/1</a></li>
|
|
</ul>
|
|
</div>
|
|
</details>
|
|
</article>
|
|
|
|
<article>
|
|
<details>
|
|
<summary>/block_digest</summary>
|
|
<div class="indent">
|
|
<h4>Examples</h4>
|
|
|
|
<ul>
|
|
<li><a href="/rpc/block_digest/genesis">/rpc/block_digest/genesis</a></li>
|
|
<li><a href="/rpc/block_digest/tip">/rpc/block_digest/tip</a></li>
|
|
<li><a href="/rpc/block_digest/height/2">/rpc/block_digest/height/2</a></li>
|
|
<li><a href="/rpc/block_digest/digest/{{self.genesis_digest.to_hex()}}">/rpc/block_digest/digest/{{self.genesis_digest.to_hex()}}</a></li>
|
|
<li><a href="/rpc/block_digest/height_or_digest/{{self.genesis_digest.to_hex()}}">/rpc/block_digest/height_or_digest/{{self.genesis_digest.to_hex()}}</a></li>
|
|
</ul>
|
|
</div>
|
|
</details>
|
|
</article>
|
|
|
|
<article>
|
|
<details>
|
|
<summary>/utxo_digest</summary>
|
|
<div class="indent">
|
|
<h4>Examples</h4>
|
|
|
|
<ul>
|
|
<li><a href="/rpc/utxo_digest/2">/rpc/utxo_digest/2</a><br/></li>
|
|
</ul>
|
|
</div>
|
|
</details>
|
|
</article>
|
|
|
|
</main>
|
|
|
|
</body>
|
|
</html>
|