Files
komp_ac/web/templates/pages/analytics/query_result.html
2026-08-03 13:32:25 +02:00

23 lines
870 B
HTML

{#
POST /api/query — crate::pages::analytics::ui::QueryResult
Either a scrollable table or an ECharts container, depending on the chart
type the form asked for. `chart_option` is JSON built in Rust.
#}
<p class="result-meta">{{ row_count }} rows in {{ elapsed_ms }} ms{% if truncated %} (truncated){% endif %}</p>
{% match chart_option %}
{% when Some(option) %}
<div class="chart" data-option="{{ option }}"
x-init="echarts.init($el).setOption(JSON.parse($el.dataset.option))"></div>
{% when None %}
<div class="table-wrap">
<table>
<thead><tr>{% for column in columns %}<th>{{ column.name }}</th>{% endfor %}</tr></thead>
<tbody>
{%- for row in rows %}
<tr>{% for cell in row %}<td>{{ cell }}</td>{% endfor %}</tr>
{%- endfor %}
</tbody>
</table>
</div>
{% endmatch %}