start dashboard

master
lza_menace 1 year ago
parent bf9a17a98a
commit 6de3345c85

@ -31,7 +31,12 @@ async def index():
admin_exists = User.select().first()
if not admin_exists:
return redirect("/setup")
return await render_template("index.html")
wallets = Wallet.select().order_by(Wallet.date.desc())
return await render_template(
"index.html",
config=config,
wallets=wallets
)
@app.route("/debug")
async def debug():
@ -126,7 +131,14 @@ async def setup():
return await render_template("setup.html")
@app.route("/wallets")
@login_required
async def wallets():
wallets = Wallet.select().order_by(Wallet.id.asc())
return await render_template("wallet/list.html", wallets=wallets)
@app.route("/wallet/add", methods=["GET", "POST"])
@login_required
async def wallet_add():
form = await request.form
if form:

@ -36,7 +36,7 @@
</a>
</div> -->
<div class="nav-right">
<a>Wallets</a>
<a class="{% if request.path == '/wallets' %}active{% endif %}" href="/wallets">Wallets</a>
<a href="/logout">Logout</a>
</div>
</nav>

@ -1,10 +1,12 @@
{% extends 'includes/base.html' %}
{% block content %}
{% if current_user.is_authenticated %}
<p>hi {{ current_user.username }}</p>
{% else %}
<p>hi anon</p>
{% endif %}
<div id="dashboard">
<h1>LWS Web</h1>
<p>LWS Admin: {{ config.LWS_ADMIN_URL }}</p>
<p>LWS RPC: {{ config.LWS_URL }}</p>
<p>{{ wallets.count() }} wallet{% if wallets.count() > 1 %}s{% endif %} being tracked</p>
<a href="/wallets" class="button outline primary">Manage Wallets</a>
</div>
{% endblock %}

@ -0,0 +1,15 @@
{% extends 'includes/base.html' %}
{% block content %}
<a class="button outline primary" href="/wallet/add">Add a Wallet</a>
<div id="wallets" class="content">
{% for wallet in wallets %}
<p>{{ wallet.id }} - <a href="{{ url_for('wallet_show', id=wallet.id) }}">{{ wallet.name }}</a> - {{ wallet.description }} - {{ wallet.date }}</p>
{% endfor %}
</div>
<style>
.content {
padding-top: 2em;
}
</style>
{% endblock %}

@ -1,14 +1,26 @@
{% extends 'includes/base.html' %}
{% block content %}
<p>{{ wallet.name }}</p>
<p>{{ wallet.description }}</p>
<p>{{ wallet.date }}</p>
<p>{{ wallet.restore_height }}</p>
<p>{{ wallet.address }}</p>
<pre>
{{ wallet.get_wallet_info() }}
</pre>
{% set info = wallet.get_wallet_info() %}
<h1>{{ wallet.name }}</h1>
<h5>{{ wallet.description }}</h5>
<h6>{{ wallet.date }}</h6>
<p>Restore Height: {{ wallet.restore_height }}</p>
<p>Address: {{ wallet.address }}</p>
<p>Locked: {{ info['locked_funds'] }}</p>
<p>Received: {{ info['total_received'] }}</p>
<p>Sent: {{ info['total_sent'] }}</p>
<p>Scanned Height: {{ info['scanned_height'] }} ({{ info['blockchain_height'] - info['scanned_height'] }} blocks away from top)</p>
<p>Spent Outputs: {{ info['spent_outputs'] | length }}</p>
<!--
{
'amount': '123123123',
'key_image': 'asdasdasd',
'tx_pub_key': 'asdasdasd',
'out_index': 1,
'mixin': 15
}
-->
<a href="{{ url_for('wallet_rescan', id=wallet.id) }}"><button>rescan</button></a>
{% endblock %}
Loading…
Cancel
Save