webs unified
This commit is contained in:
22
web/templates/pages/analytics/query_result.html
Normal file
22
web/templates/pages/analytics/query_result.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{#
|
||||
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 %}
|
||||
Reference in New Issue
Block a user