23 lines
796 B
HTML
23 lines
796 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">{{ meta }}</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 %}
|