mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
explorer/templates: Add search and error pages.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<body>
|
||||
<header class="header">
|
||||
<div class="container flex justify-between items-center">
|
||||
<div class="logo"><span>Dark</span>Fi {{ network }} Blocks</div>
|
||||
<div class="logo">DarkFi {{ network }} Blocks</div>
|
||||
<nav class="nav">
|
||||
<a href="/" class="active">Explorer</a>
|
||||
<a href="#">Stats</a>
|
||||
@@ -21,10 +21,10 @@
|
||||
|
||||
<main class="container section">
|
||||
|
||||
<div class="input-group mb-lg" style="max-width: 600px;">
|
||||
<input type="search" class="input" placeholder="Search by block height, hash, or transaction...">
|
||||
<form action="/search" method="GET" class="input-group mb-lg" style="max-width: 600px;">
|
||||
<input type="search" name="q" class="input" placeholder="Search by block height, hash, or transaction...">
|
||||
<button type="submit" class="btn">Search</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="stats-grid mb-lg">
|
||||
<div class="stat-card">
|
||||
@@ -37,7 +37,7 @@
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="label">Hashrate</div>
|
||||
<div class="value">n/a</div>
|
||||
<div class="value">{{ hashrate|default('n/a') }}</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="label">Emission</div>
|
||||
@@ -72,7 +72,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info-label">Previous Hash</td>
|
||||
<td><a href="/block/{{ block.height -1 }}" class="hash">{{ block.previous_hash }}</a></td>
|
||||
{% if block.height == 0 %}
|
||||
<td><span class="hash text-muted">{{ block.previous_hash }}</span> <span class="badge">Genesis</span></td>
|
||||
{% else %}
|
||||
<td><a href="/block/{{ block.height - 1 }}" class="hash">{{ block.previous_hash }}</a></td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info-label">Height</td>
|
||||
|
||||
71
bin/explorer/python/templates/error.html
Normal file
71
bin/explorer/python/templates/error.html
Normal file
@@ -0,0 +1,71 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Error - DarkFi Block Explorer</title>
|
||||
<link rel="stylesheet" href="/static/layout.css">
|
||||
</head>
|
||||
<body>
|
||||
<header class="header">
|
||||
<div class="container flex justify-between items-center">
|
||||
<div class="logo">>DarkFi {{ network }} Blocks</div>
|
||||
<nav class="nav">
|
||||
<a href="/">Explorer</a>
|
||||
<a href="#">Stats</a>
|
||||
<a href="https://dark.fi/book/">Docs</a>
|
||||
<a href="https://codeberg.org/darkrenaissance/darkfi/">Code</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container section">
|
||||
<div class="error-page">
|
||||
<div class="error-content">
|
||||
<h1 class="error-title">{{ error_code|default('Error') }}</h1>
|
||||
<p class="error-message">{{ error|default('An unexpected error occurred') }}</p>
|
||||
<div class="error-actions">
|
||||
<a href="/" class="btn">Return to Home</a>
|
||||
<a href="javascript:history.back()" class="btn btn-outline">Go Back</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<a href="https://dark.fi">Let there be Dark</a> · Code licensed under AGPL-3
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<style>
|
||||
.error-page {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 50vh;
|
||||
text-align: center;
|
||||
}
|
||||
.error-content {
|
||||
max-width: 500px;
|
||||
}
|
||||
.error-title {
|
||||
font-size: 4rem;
|
||||
color: var(--color-accent);
|
||||
margin-bottom: 1rem;
|
||||
border-left: none;
|
||||
padding: 0;
|
||||
}
|
||||
.error-message {
|
||||
font-size: 1.6rem;
|
||||
color: var(--color-muted);
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
.error-actions {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
@@ -9,7 +9,7 @@
|
||||
<body>
|
||||
<header class="header">
|
||||
<div class="container flex justify-between items-center">
|
||||
<div class="logo"><span>Dark</span>Fi {{ network }} Blocks</div>
|
||||
<div class="logo">DarkFi {{ network }} Blocks</div>
|
||||
<nav class="nav">
|
||||
<a href="/" class="active">Explorer</a>
|
||||
<a href="#">Stats</a>
|
||||
@@ -21,10 +21,10 @@
|
||||
|
||||
<main class="container section">
|
||||
|
||||
<div class="input-group mb-lg" style="max-width: 600px;">
|
||||
<input type="search" class="input" placeholder="Search by block height, hash, or transaction...">
|
||||
<form action="/search" method="GET" class="input-group mb-lg" style="max-width: 600px;">
|
||||
<input type="search" name="q" class="input" placeholder="Search by block height, hash, or transaction...">
|
||||
<button type="submit" class="btn">Search</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="stats-grid mb-lg">
|
||||
<div class="stat-card">
|
||||
@@ -37,7 +37,7 @@
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="label">Hashrate</div>
|
||||
<div class="value">n/a</div>
|
||||
<div class="value">{{ hashrate|default('n/a') }}</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="label">Emission</div>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<body>
|
||||
<header class="header">
|
||||
<div class="container flex justify-between items-center">
|
||||
<div class="logo"><span>Dark</span>Fi {{ network }} Blocks</div>
|
||||
<div class="logo">DarkFi {{ network }} Blocks</div>
|
||||
<nav class="nav">
|
||||
<a href="/" class="active">Explorer</a>
|
||||
<a href="#">Stats</a>
|
||||
@@ -21,10 +21,10 @@
|
||||
|
||||
<main class="container section">
|
||||
|
||||
<div class="input-group mb-lg" style="max-width: 600px;">
|
||||
<input type="search" class="input" placeholder="Search by block height, hash, or transaction...">
|
||||
<form action="/search" method="GET" class="input-group mb-lg" style="max-width: 600px;">
|
||||
<input type="search" name="q" class="input" placeholder="Search by block height, hash, or transaction...">
|
||||
<button type="submit" class="btn">Search</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="stats-grid mb-lg">
|
||||
<div class="stat-card">
|
||||
@@ -37,7 +37,7 @@
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="label">Hashrate</div>
|
||||
<div class="value">n/a</div>
|
||||
<div class="value">{{ hashrate|default('n/a') }}</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="label">Emission</div>
|
||||
|
||||
Reference in New Issue
Block a user