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 spent_key_images: Option<Vec<SpentKeyImages>>,
|
||||||
pub status: String,
|
pub status: String,
|
||||||
pub top_hash: String,
|
pub top_hash: String,
|
||||||
pub transactions: Vec<Transactions>
|
pub transactions: Option<Vec<Transactions>>
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Hash, Eq, PartialEq, Debug, Clone)]
|
#[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 {
|
} 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.
|
// For this let's just redirect to the `show_wallet_address` route.
|
||||||
return Redirect::found(uri!(show_wallet_address: value.as_str(), "", "", "", ""))
|
return Redirect::found(uri!(show_wallet_address: value.as_str(), "", "", "", ""))
|
||||||
} else if sl == 105 {
|
} else if sl == 107 {
|
||||||
// Equal to 105 characters is probably an integrated address.
|
// Equal to 107 characters is probably an integrated address.
|
||||||
// For this let's just redirect to the `show_wallet_address` route.
|
// For this let's just redirect to the `show_wallet_address` route.
|
||||||
return Redirect::found(uri!(show_wallet_address: value.as_str(), "", "", "", ""))
|
return Redirect::found(uri!(show_wallet_address: value.as_str(), "", "", "", ""))
|
||||||
} else {
|
} else {
|
||||||
|
@ -212,26 +212,25 @@ fn search(value: &RawStr) -> Redirect {
|
||||||
|
|
||||||
#[get("/")]
|
#[get("/")]
|
||||||
fn index() -> Template {
|
fn index() -> Template {
|
||||||
|
let daemon_uri = env::var("DAEMON_URI").unwrap();
|
||||||
let daemon_info: GetInfoResult = build_rpc(
|
let daemon_info: GetInfoResult = build_rpc(
|
||||||
&"get_info", None, true
|
&"get_info", None, true
|
||||||
).send().unwrap().json().unwrap();
|
).send().unwrap().json().unwrap();
|
||||||
|
|
||||||
let mut tx_pool: GetTransactionPool = build_rpc(
|
let tx_pool: GetTransactionPool = build_rpc(
|
||||||
&"get_transaction_pool", None, true
|
&"get_transaction_pool", None, true
|
||||||
).send().unwrap().json().unwrap();
|
).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();
|
f.process();
|
||||||
let j: TransactionJSON = serde_json::from_str(&f.tx_json).unwrap();
|
|
||||||
tx_json_raw.push(j)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let context: JsonValue = json!({
|
let context: JsonValue = json!({
|
||||||
"daemon_info": daemon_info,
|
"daemon_info": daemon_info,
|
||||||
"tx_pool_txs": tx_pool.transactions,
|
"tx_pool_txs": pool_txs,
|
||||||
"tx_json": tx_json_raw
|
"daemon_uri": daemon_uri
|
||||||
});
|
});
|
||||||
|
|
||||||
Template::render("index", context)
|
Template::render("index", context)
|
||||||
|
|
|
@ -4,8 +4,12 @@
|
||||||
|
|
||||||
<section id="main">
|
<section id="main">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<section id="slim-header">
|
<section id="header">
|
||||||
<a href="/" class="button">Go Back</a>
|
<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>
|
</section>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<section>
|
<section>
|
||||||
|
|
|
@ -4,8 +4,12 @@
|
||||||
|
|
||||||
<section id="main">
|
<section id="main">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<section id="slim-header">
|
<section id="header">
|
||||||
<a href="/" class="button">Go Back</a>
|
<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>
|
</section>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<section>
|
<section>
|
||||||
|
|
|
@ -20,7 +20,8 @@
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<section>
|
<section>
|
||||||
<header class="major">
|
<header class="major">
|
||||||
<h2>Network Statistics</h2>
|
<h2>Daemon Statistics</h2>
|
||||||
|
<p class="subheader"><strong>Address</strong>: {{ daemon_uri | default(value="?") }}</p>
|
||||||
</header>
|
</header>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-3 col-6-medium col-12-small">
|
<div class="col-3 col-6-medium col-12-small">
|
||||||
|
@ -28,7 +29,7 @@
|
||||||
<header>
|
<header>
|
||||||
<h3>Version</h3>
|
<h3>Version</h3>
|
||||||
</header>
|
</header>
|
||||||
<p>{% if daemon_info.version %}{{ daemon_info.version }}{% else %}?{% endif %}</p>
|
<p>{{ daemon_info.version | default(value="?") }}</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">
|
||||||
|
@ -68,7 +69,7 @@
|
||||||
<header>
|
<header>
|
||||||
<h3>Database Size</h3>
|
<h3>Database Size</h3>
|
||||||
</header>
|
</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>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3 col-6-medium col-12-small">
|
<div class="col-3 col-6-medium col-12-small">
|
||||||
|
|
|
@ -4,8 +4,12 @@
|
||||||
|
|
||||||
<section id="main">
|
<section id="main">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<section id="slim-header">
|
<section id="header">
|
||||||
<a href="/" class="button">Go Back</a>
|
<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>
|
</section>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<section>
|
<section>
|
||||||
|
@ -26,9 +30,9 @@
|
||||||
<div class="col-4 col-6-medium col-12-small">
|
<div class="col-4 col-6-medium col-12-small">
|
||||||
<section class="box">
|
<section class="box">
|
||||||
<header>
|
<header>
|
||||||
<h3>In Pool</h3>
|
<h3>Transaction Fee</h3>
|
||||||
</header>
|
</header>
|
||||||
<p>{{ tx_info.0.in_pool }}</p>
|
<p>{{ tx_info.0.as_json_full.rct_signatures.txnFee | default(value="?") }} WOW</p>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4 col-6-medium col-12-small">
|
<div class="col-4 col-6-medium col-12-small">
|
||||||
|
@ -42,9 +46,9 @@
|
||||||
<div class="col-4 col-6-medium col-12-small">
|
<div class="col-4 col-6-medium col-12-small">
|
||||||
<section class="box">
|
<section class="box">
|
||||||
<header>
|
<header>
|
||||||
<h3>Transaction Fee</h3>
|
<h3>In Tx Pool</h3>
|
||||||
</header>
|
</header>
|
||||||
<p>{{ tx_info.0.as_json_full.rct_signatures.txnFee / 1000000000000 | default(value="?") }} WOW</p>
|
<p>{{ tx_info.0.in_pool }}</p>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4 col-6-medium col-12-small">
|
<div class="col-4 col-6-medium col-12-small">
|
||||||
|
@ -76,7 +80,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
{% for i in tx_info.0.as_json_full.vin %}
|
{% for i in tx_info.0.as_json_full.vin %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ i.key.k_image }}</td>
|
<td>{{ i.key.k_image | default(value="?") }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue