81 lines
2.9 KiB
HTML
81 lines
2.9 KiB
HTML
{# GET /admin/ecb — crate::pages::admin::ecb::ui::EcbPage #}
|
|
{% extends "ui/base.html" %}
|
|
|
|
{% block title %}Exchange rates{% endblock %}
|
|
|
|
{% block content %}
|
|
<main>
|
|
<section class="heading">
|
|
<div>
|
|
<p class="eyebrow">Exchange rates</p>
|
|
<h1>ECB reference rates</h1>
|
|
<p>
|
|
The importer fetches the ECB's published rates once a day and records every
|
|
attempt. Conversions read only what it has verified, so coverage is what decides
|
|
whether a foreign-currency amount can be posted at all.
|
|
</p>
|
|
</div>
|
|
<div class="actions">
|
|
<a href="/admin">← Admin panel</a>
|
|
</div>
|
|
</section>
|
|
|
|
{% include "pages/admin/ecb/status.html" %}
|
|
|
|
<section class="panel">
|
|
<h2>Import attempts <span class="count">{{ page.batches.len() }}</span></h2>
|
|
{% if page.batches.is_empty() %}
|
|
<p class="hint">
|
|
The importer has not recorded an attempt. It runs on startup and then daily, so
|
|
an empty log means the server has not completed a run since this table was
|
|
created.
|
|
</p>
|
|
{% else %}
|
|
<div class="table-scroll">
|
|
<table class="builder-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Started</th><th>Finished</th><th>Window</th><th>Result</th>
|
|
<th>Observations</th><th>Verified through</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for batch in page.batches %}
|
|
<tr>
|
|
<td>{{ batch.started_at }}</td>
|
|
<td>
|
|
{%- if let Some(finished) = batch.completed_at %}{{ finished }}
|
|
{%- else %}<span class="hint">still running</span>{% endif -%}
|
|
</td>
|
|
<td>
|
|
{{ batch.window() }}
|
|
<div class="hint"><code>{{ batch.endpoint }}</code></div>
|
|
</td>
|
|
<td>
|
|
{%- if batch.succeeded() %}<span class="tag tag-ok">succeeded</span>
|
|
{%- else if batch.running() %}<span class="tag">running</span>
|
|
{%- else %}<span class="tag tag-bad">failed</span>{% endif -%}
|
|
{%- if let Some(message) = batch.error_message %}
|
|
<div class="hint">{{ message }}</div>
|
|
{% endif -%}
|
|
</td>
|
|
<td>{{ batch.observations() }}</td>
|
|
<td>
|
|
{%- if let Some(date) = batch.verified_through_date %}{{ date }}
|
|
{%- else %}<span class="hint">—</span>{% endif -%}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p class="hint">
|
|
Attempts are an audit record: they cannot be edited or deleted, and a batch that
|
|
re-fetched a day an earlier one already owned inserts nothing, which is why the
|
|
new count can be lower than the total.
|
|
</p>
|
|
{% endif %}
|
|
</section>
|
|
</main>
|
|
{% endblock %}
|