Show options-page price clock and drive header trade stats from pure options.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
<link rel="apple-touch-icon" href="/static/icons/apple-touch-icon.png">
|
||||
<link rel="manifest" href="/static/icons/manifest.webmanifest">
|
||||
<title>{{ pwa_app_name }}</title>
|
||||
<link rel="stylesheet" href="/static/instance_page.css?v=15">
|
||||
<link rel="stylesheet" href="/static/instance_page.css?v=16">
|
||||
<link rel="stylesheet" href="/static/instance_theme.css?v=118">
|
||||
|
||||
</head>
|
||||
@@ -178,7 +178,7 @@
|
||||
{% with msg=get_flashed_messages() %}{% if msg %}<div class="flash">{{ msg[0] }}</div>{% endif %}{% endwith %}
|
||||
|
||||
{% include 'instance_header_panel.html' %}
|
||||
{% if page not in ('settings', 'risk_policy', 'system_guide', 'env_config', 'options', 'options_review', 'hedge_plan') %}
|
||||
{% if page not in ('settings', 'risk_policy', 'system_guide', 'env_config', 'options_review') %}
|
||||
{% include 'instance_top_bar.html' %}
|
||||
{% endif %}
|
||||
|
||||
@@ -1441,6 +1441,10 @@ function accountSnapshotFundingMissing(data){
|
||||
let accountSnapshotRetryCount = 0;
|
||||
function applyAccountSnapshot(data){
|
||||
if(!data || typeof data !== "object") return;
|
||||
if(data.updated_at){
|
||||
const updatedEl = document.getElementById("price-last-updated");
|
||||
if(updatedEl) updatedEl.innerText = data.updated_at;
|
||||
}
|
||||
if(typeof data.show_perp_funds !== "undefined"){
|
||||
applyPerpFundsVisibility(data.show_perp_funds);
|
||||
}
|
||||
@@ -1541,7 +1545,11 @@ function applyAccountSnapshot(data){
|
||||
}
|
||||
function refreshAccountSnapshot(opts){
|
||||
const options = opts || {};
|
||||
const qs = options.force ? "?force=1" : "";
|
||||
const params = new URLSearchParams();
|
||||
if(options.force) params.set("force", "1");
|
||||
const page = (document.body && document.body.getAttribute("data-page")) || "";
|
||||
if(page) params.set("page", page);
|
||||
const qs = params.toString() ? ("?" + params.toString()) : "";
|
||||
fetch("/api/account_snapshot" + qs).then(r=>r.json()).then(data=>{
|
||||
applyAccountSnapshot(data);
|
||||
if(accountSnapshotFundingMissing(data) && !options.force && accountSnapshotRetryCount < 3){
|
||||
|
||||
Reference in New Issue
Block a user