fix(ui): 右上角时间改为同时显示价格数据时间+页面刷新时间,各带图标和标签
This commit is contained in:
@@ -280,10 +280,22 @@ def get_watch():
|
||||
d.pop('_pos', None)
|
||||
d.pop('_rr', None)
|
||||
|
||||
# 数据最新更新时间(price_monitor/live_prices)
|
||||
_data_time = ""
|
||||
try:
|
||||
_dtc = sqlite3.connect("/home/hmo/MoFin/data/mofin.db")
|
||||
_r = _dtc.execute("SELECT MAX(updated_at) FROM live_prices").fetchone()
|
||||
if _r and _r[0]:
|
||||
_data_time = str(_r[0])
|
||||
_dtc.close()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return json.dumps({"stocks": results, "count": len(results),
|
||||
"cash": _cash, "total_assets": _total,
|
||||
"budget_pct": round(_budget_pct, 2),
|
||||
"rec_used_pct": round(_cum, 2)}, ensure_ascii=False)
|
||||
"rec_used_pct": round(_cum, 2),
|
||||
"data_time": _data_time}, ensure_ascii=False)
|
||||
|
||||
|
||||
@app.route("/api/strategy_history/<code>")
|
||||
|
||||
Reference in New Issue
Block a user