feat: Add dashboard charts with interactivity and basic authentication support
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<div
|
||||
id="charts-panel"
|
||||
class="panel"
|
||||
style="margin-top: 16px"
|
||||
x-data="{ expanded: true }"
|
||||
>
|
||||
<div class="chart-head">
|
||||
<div>
|
||||
<div class="label">Opportunity Trend</div>
|
||||
<div class="meta">Recent opportunities from DuckDB. Updated {{ generated_at }}</div>
|
||||
</div>
|
||||
<button type="button" class="button secondary" x-on:click="expanded = !expanded">
|
||||
<span x-text="expanded ? 'Hide chart' : 'Show chart'"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div x-show="expanded" x-transition style="margin-top: 16px">
|
||||
<div class="card" style="padding: 12px">
|
||||
{% if has_chart_data %}
|
||||
<canvas id="opportunity-chart" class="chart-canvas"></canvas>
|
||||
<script>
|
||||
window.arbitradeRenderCharts(
|
||||
{{ {
|
||||
"has_chart_data": has_chart_data,
|
||||
"labels": labels,
|
||||
"net_pct_values": net_pct_values,
|
||||
"est_profit_values": est_profit_values,
|
||||
"cycles": cycles,
|
||||
} | tojson }}
|
||||
);
|
||||
</script>
|
||||
{% else %}
|
||||
<div class="meta">No opportunity data yet.</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user