Fix turbo nav layout flash and stats page not loading.

Wait for page CSS before swapping content, hoist inline styles to head, and boot page scripts immediately when DOM markers exist.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-26 20:55:36 +08:00
parent c79bb2ea4b
commit 6d55a54946
10 changed files with 93 additions and 57 deletions
+29 -27
View File
@@ -1,6 +1,35 @@
{# Copyright (c) 2025-2026 马建军. All rights reserved. 专有软件,详见 LICENSE.zh-CN.txt #}
{% extends "base.html" %}
{% block title %}统计分析 - 国内期货 · 交易复盘系统{% endblock %}
{% block extra_css %}
<style>
.stats-summary-card{margin-bottom:1.25rem}
.stats-toolbar{display:flex;align-items:center;justify-content:flex-start;gap:1rem;margin-bottom:.75rem;flex-wrap:wrap}
.stat-grid-summary{
display:flex;flex-wrap:nowrap;align-items:stretch;gap:0;
margin-bottom:0;overflow-x:auto;-webkit-overflow-scrolling:touch;
}
.stat-grid-summary .stat-item{
flex:1 1 0;min-width:4.5rem;background:transparent;border:none;border-radius:0;
padding:.35rem .2rem;text-align:center;position:relative;overflow:visible;
border-right:1px solid var(--table-border);
}
.stat-grid-summary .stat-item:last-child{border-right:none}
.stat-grid-summary .stat-item::before{display:none}
.stat-grid-summary .stat-item:hover{transform:none;box-shadow:none}
.stat-grid-summary .stat-item .label{
font-size:.62rem;line-height:1.25;color:var(--text-muted);white-space:nowrap;
}
.stat-grid-summary .stat-item .value{
font-size:.78rem;font-weight:600;color:var(--text-title);margin-top:.12rem;
font-variant-numeric:tabular-nums;white-space:nowrap;
}
.stats-card-head{display:flex;align-items:flex-end;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-bottom:1rem}
.stats-card-head h2{margin-bottom:0}
.stats-view-field{width:auto;min-width:200px}
.stats-view-field select{width:100%;min-width:180px}
</style>
{% endblock %}
{% block content %}
<div class="card stats-summary-card">
@@ -43,33 +72,6 @@
</div>
</div>
<style>
.stats-summary-card{margin-bottom:1.25rem}
.stats-toolbar{display:flex;align-items:center;justify-content:flex-start;gap:1rem;margin-bottom:.75rem;flex-wrap:wrap}
.stat-grid-summary{
display:flex;flex-wrap:nowrap;align-items:stretch;gap:0;
margin-bottom:0;overflow-x:auto;-webkit-overflow-scrolling:touch;
}
.stat-grid-summary .stat-item{
flex:1 1 0;min-width:4.5rem;background:transparent;border:none;border-radius:0;
padding:.35rem .2rem;text-align:center;position:relative;overflow:visible;
border-right:1px solid var(--table-border);
}
.stat-grid-summary .stat-item:last-child{border-right:none}
.stat-grid-summary .stat-item::before{display:none}
.stat-grid-summary .stat-item:hover{transform:none;box-shadow:none}
.stat-grid-summary .stat-item .label{
font-size:.62rem;line-height:1.25;color:var(--text-muted);white-space:nowrap;
}
.stat-grid-summary .stat-item .value{
font-size:.78rem;font-weight:600;color:var(--text-title);margin-top:.12rem;
font-variant-numeric:tabular-nums;white-space:nowrap;
}
.stats-card-head{display:flex;align-items:flex-end;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-bottom:1rem}
.stats-card-head h2{margin-bottom:0}
.stats-view-field{width:auto;min-width:200px}
.stats-view-field select{width:100%;min-width:180px}
</style>
{% endblock %}
{% block extra_js %}