mirror of
https://git.wownero.com/lza_menace/wownero-explorer.git
synced 2024-08-15 01:03:26 +00:00
normalized images and flow on pages
This commit is contained in:
parent
45d2618f39
commit
0a7170a08b
6 changed files with 37 additions and 25 deletions
|
@ -159,7 +159,7 @@ pub struct GetTransactionPool {
|
|||
pub spent_key_images: Option<Vec<SpentKeyImages>>,
|
||||
pub status: String,
|
||||
pub top_hash: String,
|
||||
pub transactions: Vec<Transactions>
|
||||
pub transactions: Option<Vec<Transactions>>
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Hash, Eq, PartialEq, Debug, Clone)]
|
||||
|
|
19
src/main.rs
19
src/main.rs
|
@ -183,11 +183,11 @@ fn search(value: &RawStr) -> Redirect {
|
|||
}
|
||||
}
|
||||
} else if sl == 97 {
|
||||
// Equal to 95 characters is probably a wallet address.
|
||||
// Equal to 97 characters is probably a wallet address.
|
||||
// For this let's just redirect to the `show_wallet_address` route.
|
||||
return Redirect::found(uri!(show_wallet_address: value.as_str(), "", "", "", ""))
|
||||
} else if sl == 105 {
|
||||
// Equal to 105 characters is probably an integrated address.
|
||||
} else if sl == 107 {
|
||||
// Equal to 107 characters is probably an integrated address.
|
||||
// For this let's just redirect to the `show_wallet_address` route.
|
||||
return Redirect::found(uri!(show_wallet_address: value.as_str(), "", "", "", ""))
|
||||
} else {
|
||||
|
@ -212,26 +212,25 @@ fn search(value: &RawStr) -> Redirect {
|
|||
|
||||
#[get("/")]
|
||||
fn index() -> Template {
|
||||
let daemon_uri = env::var("DAEMON_URI").unwrap();
|
||||
let daemon_info: GetInfoResult = build_rpc(
|
||||
&"get_info", None, true
|
||||
).send().unwrap().json().unwrap();
|
||||
|
||||
let mut tx_pool: GetTransactionPool = build_rpc(
|
||||
let tx_pool: GetTransactionPool = build_rpc(
|
||||
&"get_transaction_pool", None, true
|
||||
).send().unwrap().json().unwrap();
|
||||
|
||||
let mut tx_json_raw: Vec<TransactionJSON> = vec![];
|
||||
let mut pool_txs: Vec<Transactions> = tx_pool.transactions.unwrap_or(vec![]);
|
||||
|
||||
for f in &mut tx_pool.transactions {
|
||||
for f in &mut pool_txs {
|
||||
f.process();
|
||||
let j: TransactionJSON = serde_json::from_str(&f.tx_json).unwrap();
|
||||
tx_json_raw.push(j)
|
||||
};
|
||||
|
||||
let context: JsonValue = json!({
|
||||
"daemon_info": daemon_info,
|
||||
"tx_pool_txs": tx_pool.transactions,
|
||||
"tx_json": tx_json_raw
|
||||
"tx_pool_txs": pool_txs,
|
||||
"daemon_uri": daemon_uri
|
||||
});
|
||||
|
||||
Template::render("index", context)
|
||||
|
|
|
@ -4,8 +4,12 @@
|
|||
|
||||
<section id="main">
|
||||
<div class="container">
|
||||
<section id="slim-header">
|
||||
<a href="/" class="button">Go Back</a>
|
||||
<section id="header">
|
||||
<nav id="nav">
|
||||
<a href="/"><h1>Go Back</h1><br>
|
||||
<img src="//files.lzahq.tech/wow/WOW-Bux-720x435.png" width=300 />
|
||||
</a>
|
||||
</nav>
|
||||
</section>
|
||||
<div class="col-12">
|
||||
<section>
|
||||
|
|
|
@ -4,8 +4,12 @@
|
|||
|
||||
<section id="main">
|
||||
<div class="container">
|
||||
<section id="slim-header">
|
||||
<a href="/" class="button">Go Back</a>
|
||||
<section id="header">
|
||||
<nav id="nav">
|
||||
<a href="/"><h1>Go Back</h1><br>
|
||||
<img src="//files.lzahq.tech/wow/Wownero-Mine-Stock-720x500.png" width=300 />
|
||||
</a>
|
||||
</nav>
|
||||
</section>
|
||||
<div class="col-12">
|
||||
<section>
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
<div class="col-12">
|
||||
<section>
|
||||
<header class="major">
|
||||
<h2>Network Statistics</h2>
|
||||
<h2>Daemon Statistics</h2>
|
||||
<p class="subheader"><strong>Address</strong>: {{ daemon_uri | default(value="?") }}</p>
|
||||
</header>
|
||||
<div class="row">
|
||||
<div class="col-3 col-6-medium col-12-small">
|
||||
|
@ -28,7 +29,7 @@
|
|||
<header>
|
||||
<h3>Version</h3>
|
||||
</header>
|
||||
<p>{% if daemon_info.version %}{{ daemon_info.version }}{% else %}?{% endif %}</p>
|
||||
<p>{{ daemon_info.version | default(value="?") }}</p>
|
||||
</section>
|
||||
</div>
|
||||
<div class="col-3 col-6-medium col-12-small">
|
||||
|
@ -68,7 +69,7 @@
|
|||
<header>
|
||||
<h3>Database Size</h3>
|
||||
</header>
|
||||
<p>{% if daemon_info.database_size %}{{ daemon_info.database_size / 1000000000 }} GB{% else %}?{% endif %}</p>
|
||||
<p>{{ daemon_info.database_size / 1000000000 | default(value="?") }} GB</p>
|
||||
</section>
|
||||
</div>
|
||||
<div class="col-3 col-6-medium col-12-small">
|
||||
|
|
|
@ -4,8 +4,12 @@
|
|||
|
||||
<section id="main">
|
||||
<div class="container">
|
||||
<section id="slim-header">
|
||||
<a href="/" class="button">Go Back</a>
|
||||
<section id="header">
|
||||
<nav id="nav">
|
||||
<a href="/"><h1>Go Back</h1><br>
|
||||
<img src="//files.lzahq.tech/wow/WOW-Teleporter-720x1180.png" height=220 />
|
||||
</a>
|
||||
</nav>
|
||||
</section>
|
||||
<div class="col-12">
|
||||
<section>
|
||||
|
@ -26,9 +30,9 @@
|
|||
<div class="col-4 col-6-medium col-12-small">
|
||||
<section class="box">
|
||||
<header>
|
||||
<h3>In Pool</h3>
|
||||
<h3>Transaction Fee</h3>
|
||||
</header>
|
||||
<p>{{ tx_info.0.in_pool }}</p>
|
||||
<p>{{ tx_info.0.as_json_full.rct_signatures.txnFee | default(value="?") }} WOW</p>
|
||||
</section>
|
||||
</div>
|
||||
<div class="col-4 col-6-medium col-12-small">
|
||||
|
@ -42,9 +46,9 @@
|
|||
<div class="col-4 col-6-medium col-12-small">
|
||||
<section class="box">
|
||||
<header>
|
||||
<h3>Transaction Fee</h3>
|
||||
<h3>In Tx Pool</h3>
|
||||
</header>
|
||||
<p>{{ tx_info.0.as_json_full.rct_signatures.txnFee / 1000000000000 | default(value="?") }} WOW</p>
|
||||
<p>{{ tx_info.0.in_pool }}</p>
|
||||
</section>
|
||||
</div>
|
||||
<div class="col-4 col-6-medium col-12-small">
|
||||
|
@ -76,7 +80,7 @@
|
|||
</tr>
|
||||
{% for i in tx_info.0.as_json_full.vin %}
|
||||
<tr>
|
||||
<td>{{ i.key.k_image }}</td>
|
||||
<td>{{ i.key.k_image | default(value="?") }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in a new issue