minor static adjustment

master
lalanza808 5 years ago
parent 52b9caea5b
commit 6d7bac3fac

@ -98,7 +98,9 @@ fn search(value: &RawStr) -> Redirect {
// We basically check the length of the search value and // We basically check the length of the search value and
// attempt to redirect to the appropriate route. // attempt to redirect to the appropriate route.
let sl: usize = value.len(); let sl: usize = value.len();
if sl < 8 { if sl == 0 {
return Redirect::found(uri!(index));
} else if sl < 8 {
// Less than 8 characters is probably a block height. If it can // Less than 8 characters is probably a block height. If it can
// be parsed as valid u32 then redirect to `get_block_by_height`, // be parsed as valid u32 then redirect to `get_block_by_height`,
// otherwise redirect to the error response. // otherwise redirect to the error response.

@ -56,7 +56,7 @@
<header> <header>
<h3>Database Size</h3> <h3>Database Size</h3>
</header> </header>
<p>{{ daemon_info.database_size / 1000000000 }} GB</p> <p>{% if daemon_info.database_size %}{{ daemon_info.database_size / 1000000000 }} GB{% else %}?{% endif %}</p>
</section> </section>
</div> </div>
<div class="col-3 col-6-medium col-12-small"> <div class="col-3 col-6-medium col-12-small">
@ -83,7 +83,10 @@
<header class="major"> <header class="major">
<div class="tx-table"> <div class="tx-table">
<table> <table>
<caption><h2>Transaction Pool ({{ daemon_info.tx_pool_size }})</h2></caption> <caption>
<h2>Transaction Pool ({{ daemon_info.tx_pool_size }})</h2>
<p>Transactions that have yet to be mined into a block. This is where payments sit in a PENDING state.</p>
</caption>
<tr> <tr>
<th>Hash</th> <th>Hash</th>
<th>Amount</th> <th>Amount</th>

@ -0,0 +1,103 @@
{% extends "base" %}
{% block content %}
<section id="main">
<div class="container">
<div class="col-12">
<section>
<header class="major">
<h2>Transaction {{ block_header.height }}</h2>
<p class="subheader"><strong>Hash</strong>: {{ block_header.hash }}</p>
<p class="subheader"><strong>Timestamp</strong>: {{ block_header.timestamp }}
</header>
<div class="row">
<div class="col-4 col-6-medium col-12-small">
<section class="box">
<header>
<h3>Size</h3>
</header>
<p>{{ block_header.block_size }} bytes</p>
</section>
</div>
<div class="col-4 col-6-medium col-12-small">
<section class="box">
<header>
<h3>Depth</h3>
</header>
<p>{{ block_header.depth }}</p>
</section>
</div>
<div class="col-4 col-6-medium col-12-small">
<section class="box">
<header>
<h3>Difficulty</h3>
</header>
<p>{{ block_header.difficulty }}</p>
</section>
</div>
<div class="col-4 col-6-medium col-12-small">
<section class="box">
<header>
<h3>Transactions</h3>
</header>
<p>{% if tx_hashes %}{{ tx_hashes | length }}{% else %}0{% endif %}</p>
</section>
</div>
<div class="col-4 col-6-medium col-12-small">
<section class="box">
<header>
<h3>Orphaned</h3>
</header>
<p>{{ block_header.orphan_status }}</p>
</section>
</div>
<div class="col-4 col-6-medium col-12-small">
<section class="box">
<header>
<h3>Nonce</h3>
</header>
<p>{{ block_header.nonce }}</p>
</section>
</div>
</div>
</section>
</div>
<br><br>
<div class="tx-table">
<table>
<caption><h2>Block Transactions</h2></caption>
<tr>
<th>Coinbase</th>
<th>Hash</th>
<th>Amount</th>
<th>Fee</th>
<th>Bytes</th>
</tr>
<tr>
<td>√</td>
<td><a href="/transaction/{{ block_header.miner_tx_hash }}">{{ block_header.miner_tx_hash | truncate(length=8) }}</a></td>
<td>{{ block_header.reward / 1000000000000 }} XMR</td>
<td>0</td>
<td>?</td>
</tr>
{% if tx_hashes %}
{% for hash in tx_hashes %}
<tr>
<td></td>
<td><a href="/transaction/{{ hash }}">{{ hash | truncate(length=8) }}</a></td>
<td>?</td>
<td>?</td>
<td>?</td>
</tr>
{% endfor %}
{% endif %}
</table>
</div>
<header class="major">
<h2><a href="/block/hash/{{ block_header.prev_hash }}">Previous Block</a></h2>
</header>
</div>
</section>
{% endblock content %}
Loading…
Cancel
Save