diff --git a/src/main.rs b/src/main.rs index ee3838c..34a4700 100644 --- a/src/main.rs +++ b/src/main.rs @@ -98,7 +98,9 @@ fn search(value: &RawStr) -> Redirect { // We basically check the length of the search value and // attempt to redirect to the appropriate route. 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 // be parsed as valid u32 then redirect to `get_block_by_height`, // otherwise redirect to the error response. diff --git a/templates/index.html.tera b/templates/index.html.tera index b536981..52e3534 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -56,7 +56,7 @@

Database Size

-

{{ daemon_info.database_size / 1000000000 }} GB

+

{% if daemon_info.database_size %}{{ daemon_info.database_size / 1000000000 }} GB{% else %}?{% endif %}

@@ -83,7 +83,10 @@
- + diff --git a/templates/transaction.html.tera b/templates/transaction.html.tera new file mode 100644 index 0000000..5396af6 --- /dev/null +++ b/templates/transaction.html.tera @@ -0,0 +1,103 @@ +{% extends "base" %} + +{% block content %} + +
+
+
+
+
+

Transaction {{ block_header.height }}

+

Hash: {{ block_header.hash }}

+

Timestamp: {{ block_header.timestamp }} +

+
+
+
+
+

Size

+
+

{{ block_header.block_size }} bytes

+
+
+
+
+
+

Depth

+
+

{{ block_header.depth }}

+
+
+
+
+
+

Difficulty

+
+

{{ block_header.difficulty }}

+
+
+
+
+
+

Transactions

+
+

{% if tx_hashes %}{{ tx_hashes | length }}{% else %}0{% endif %}

+
+
+
+
+
+

Orphaned

+
+

{{ block_header.orphan_status }}

+
+
+
+
+
+

Nonce

+
+

{{ block_header.nonce }}

+
+
+
+
+
+

+
+

Transaction Pool ({{ daemon_info.tx_pool_size }})

+

Transaction Pool ({{ daemon_info.tx_pool_size }})

+

Transactions that have yet to be mined into a block. This is where payments sit in a PENDING state.

+
Hash Amount
+ + + + + + + + + + + + + + + + {% if tx_hashes %} + {% for hash in tx_hashes %} + + + + + + + + {% endfor %} + {% endif %} +

Block Transactions

CoinbaseHashAmountFeeBytes
{{ block_header.miner_tx_hash | truncate(length=8) }}{{ block_header.reward / 1000000000000 }} XMR0?
{{ hash | truncate(length=8) }}???
+
+
+

Previous Block

+
+
+ + +{% endblock content %}