Show okx_sim/okx_live and gate live API fields by matching mode.

In sim, hide LIVE/API keys and expose simulated fund settings in env UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-14 18:35:08 +08:00
parent bd742a2e43
commit e7aa724a3b
9 changed files with 150 additions and 20 deletions
@@ -1178,6 +1178,9 @@ function applyAccountSnapshot(data){
if(typeof data.show_perp_funds !== "undefined"){
applyPerpFundsVisibility(data.show_perp_funds);
}
if(data.exchange_mode_label){
setFundsFieldText("exchange-mode-label", data.exchange_mode_label);
}
if(data.funding_usdt != null && data.funding_usdt !== ""){
setFundsFieldText("total-capital", `${Number(data.funding_usdt).toFixed(2)}U`);
}
+1 -1
View File
@@ -144,7 +144,7 @@ const ORDER_ENTRY_MODEL_CODE_TO_CATEGORY = {{ entry_model_code_to_category | toj
<script>
window.__INSTANCE_DISPLAY__ = {{ display | tojson }};
</script>
<script src="/static/instance_settings_prefs.js?v=21"></script>
<script src="/static/instance_settings_prefs.js?v=22"></script>
<script src="/static/instance_live.js?v=7"></script>
<script src="/static/instance_embed.js?v=31"></script>
<script src="/static/instance_mobile_nav.js?v=2"></script>
+4 -1
View File
@@ -1444,6 +1444,9 @@ function applyAccountSnapshot(data){
if(typeof data.show_perp_funds !== "undefined"){
applyPerpFundsVisibility(data.show_perp_funds);
}
if(data.exchange_mode_label){
setFundsFieldText("exchange-mode-label", data.exchange_mode_label);
}
if(data.funding_usdt != null && data.funding_usdt !== ""){
setFundsFieldText("total-capital", `${Number(data.funding_usdt).toFixed(2)}U`);
}
@@ -1829,6 +1832,6 @@ document.addEventListener("DOMContentLoaded", function () {
});
{% endif %}
</script>
<script src="/static/instance_settings_prefs.js?v=21"></script>
<script src="/static/instance_settings_prefs.js?v=22"></script>
</body>
</html>
@@ -2,7 +2,7 @@
<div class="instance-header-stats{% if options_enabled %} instance-header-stats--options{% endif %}">
<div class="stat-strip-item stat-strip-item--primary">
<div class="label">交易所</div>
<div class="value">{{ exchange_display }}{% if is_sim_mode|default(false) %} <span class="sim-mode-badge" title="本地模拟资金撮合,不下真实交易所单">模拟</span>{% endif %}</div>
<div class="value" id="exchange-mode-label" data-funds-field="exchange-mode-label">{{ exchange_display }}</div>
</div>
<div class="stat-strip-item">
<div class="label">交易日</div>