diff --git a/static/js/theme.js b/static/js/theme.js new file mode 100644 index 0000000..3113231 --- /dev/null +++ b/static/js/theme.js @@ -0,0 +1,36 @@ +(function () { + var KEY = 'qihuo-theme'; + + function apply(theme) { + document.documentElement.setAttribute('data-theme', theme); + try { + localStorage.setItem(KEY, theme); + } catch (e) { /* ignore */ } + var btn = document.getElementById('theme-toggle'); + if (btn) { + btn.setAttribute('data-active', theme); + btn.setAttribute('aria-label', theme === 'light' ? '切换到深色' : '切换到浅色'); + } + } + + var saved = null; + try { + saved = localStorage.getItem(KEY); + } catch (e) { /* ignore */ } + + if (saved === 'light' || saved === 'dark') { + apply(saved); + } else { + var prefersLight = window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches; + apply(prefersLight ? 'light' : 'dark'); + } + + document.addEventListener('DOMContentLoaded', function () { + var btn = document.getElementById('theme-toggle'); + if (!btn) return; + btn.addEventListener('click', function () { + var cur = document.documentElement.getAttribute('data-theme') || 'dark'; + apply(cur === 'dark' ? 'light' : 'dark'); + }); + }); +})(); diff --git a/templates/base.html b/templates/base.html index 5b1193d..6fd31e2 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,24 +4,178 @@ {% block title %}国内期货监控系统{% endblock %} + -
-

期货监控系统

- {% with messages = get_flashed_messages() %} - {% if messages %}
{{ messages[0] }}
{% endif %} - {% endwith %} -
-
- - -
-
- - -
- -
+
+
+ +
+
diff --git a/templates/plans.html b/templates/plans.html index ff0f7a3..f4fcb6b 100644 --- a/templates/plans.html +++ b/templates/plans.html @@ -3,7 +3,8 @@ {% block content %}
-

今日计划 今日 {{ today }}

+ +

今日计划 今日 {{ today }}

开盘前制定,当日有效;下方为进行中计划。

@@ -33,7 +34,7 @@
-

进行中

+
{% for p in plans %}
@@ -47,7 +48,7 @@
{% else %} -
今日暂无进行中的计划
+
今日暂无进行中的计划
{% endfor %}
@@ -60,7 +61,7 @@
- 重置 + 重置
@@ -79,7 +80,7 @@ {% else %} - + {% endfor %}
暂无历史
暂无历史
diff --git a/templates/records.html b/templates/records.html index 510ab6b..325b26f 100644 --- a/templates/records.html +++ b/templates/records.html @@ -126,7 +126,7 @@ {% else %} - 暂无复盘记录 + 暂无复盘记录 {% endfor %} diff --git a/templates/settings.html b/templates/settings.html index 7f8688d..1151826 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -4,11 +4,11 @@

行情说明

-

- 当前行情源:{{ quote_label }}
+

+ 当前行情源:{{ quote_label }}
合约代码按同花顺格式显示(如 ag2608、IF2606),便于与看盘软件对照; - 实际价格通过新浪财经免费接口获取,普通用户无需申请 token。
- 同花顺 iFinD 接口面向机构用户,个人期货通用户一般无法获取 refresh_token,故系统默认不使用。 + 实际价格通过行情接口获取,普通用户无需申请 token。
+ 同花顺 iFinD 接口面向机构用户,个人期货通用户一般无法获取 refresh_token,故系统默认不使用。

@@ -19,7 +19,7 @@ -

在企业微信群中添加机器人后,将 Webhook 地址粘贴到上方保存即可。

+

在企业微信群中添加机器人后,将 Webhook 地址粘贴到上方保存即可。

@@ -27,19 +27,19 @@
- +
- +
- +
- +
diff --git a/templates/stats.html b/templates/stats.html index 9d48ad8..0eba552 100644 --- a/templates/stats.html +++ b/templates/stats.html @@ -4,8 +4,8 @@
总交易
{{ total }}
-
止盈
{{ win }}
-
止损
{{ loss }}
+
止盈
{{ win }}
+
止损
{{ loss }}
胜率
{{ rate }}%
@@ -22,7 +22,7 @@ {{ round(s.wins / s.cnt * 100, 2) if s.cnt else 0 }}% {% else %} - 暂无数据 + 暂无数据 {% endfor %} @@ -41,7 +41,7 @@ {{ round(t.wins / t.cnt * 100, 2) if t.cnt else 0 }}% {% else %} - 暂无数据 + 暂无数据 {% endfor %} @@ -60,7 +60,7 @@ {{ round(d.wins / d.cnt * 100, 2) if d.cnt else 0 }}% {% else %} - 暂无数据 + 暂无数据 {% endfor %} @@ -82,7 +82,7 @@ {{ r.created_at[:16] if r.created_at else '' }} {% else %} - 暂无数据 + 暂无数据 {% endfor %}