Implement viewing live and DB information from account

This commit is contained in:
2022-10-21 23:57:32 +01:00
parent 1bdd49ee6a
commit 572b839c2c
10 changed files with 125 additions and 20 deletions

View File

@@ -55,7 +55,7 @@
</span>
</button>
{% if type == 'page' %}
<a href="{% url 'trades' type=type account_id=item.id %}"><button
<a href="{% url 'account_info' type=type account_id=item.id %}"><button
class="button is-success">
<span class="icon-text">
<span class="icon">
@@ -67,7 +67,7 @@
{% else %}
<button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-get="{% url 'trades' type=type account_id=item.id %}"
hx-get="{% url 'account_info' type=type account_id=item.id %}"
hx-trigger="click"
hx-target="#{{ type }}s-here"
class="button is-success">

View File

@@ -0,0 +1,39 @@
<h1 class="title">Live information</h1>
<table class="table is-fullwidth is-hoverable">
<thead>
<th>attribute</th>
<th>value</th>
</thead>
<tbody>
{% for key, item in live_info.items %}
<tr>
<th>{{ key }}</th>
<td>
{% if item is not None %}
{{ item }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<h1 class="title">Stored information</h1>
<table class="table is-fullwidth is-hoverable">
<thead>
<th>attribute</th>
<th>value</th>
</thead>
<tbody>
{% for key, item in db_info.items %}
<tr>
<th>{{ key }}</th>
<td>
{% if item is not None %}
{{ item }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>