Files
crypto_monitor/lib/instance/templates/settings_panel.html
T

78 lines
3.7 KiB
HTML

{# 系统设置:CSS Tab(与 env 配置同方案) #}
<div class="settings-page full">
<div class="env-config-head card">
<h2>系统设置</h2>
<p class="settings-env-hint env-config-head-hint">各区块说明见 <code>docs/系统设置说明.md</code>.</p>
</div>
{% if settings_tabs %}
{% set _sub = (request.args.get('settings_tab') or '').strip() %}
{% set _legacy_tab = (request.args.get('tab') or '').strip() %}
{% set ns = namespace(active_idx=0, active_key='') %}
{% for tab in settings_tabs %}
{% if _sub and tab.key == _sub %}
{% set ns.active_idx = loop.index0 %}
{% set ns.active_key = tab.key %}
{% elif (not _sub) and _legacy_tab and tab.key == _legacy_tab %}
{% set ns.active_idx = loop.index0 %}
{% set ns.active_key = tab.key %}
{% endif %}
{% endfor %}
<div class="env-config-body card settings-config-body" data-settings-active-tab="{{ ns.active_key }}">
{% for tab in settings_tabs %}
<input type="radio" name="settings-section" id="settings-sec-{{ loop.index0 }}" class="env-tab-radio" data-settings-tab="{{ tab.key }}"{% if loop.index0 == ns.active_idx %} checked{% endif %}>
{% endfor %}
<div class="env-config-tabs" role="tablist" aria-label="系统设置分类">
{% for tab in settings_tabs %}
<label for="settings-sec-{{ loop.index0 }}" class="env-tab-btn" role="tab">{{ tab.title }}</label>
{% endfor %}
</div>
<div class="env-config-panels">
{% for tab in settings_tabs %}
<section class="env-panel env-panel--{{ loop.index0 }} settings-tab-panel" role="tabpanel">
{% if tab.key == 'nav' %}
{% include 'display_prefs_panel.html' %}
{% elif tab.key == 'password' %}
{% include 'password_settings_panel.html' %}
{% elif tab.key == 'transfer' %}
<h2>永续资金划转</h2>
<p class="settings-subcard-desc">账户内:资金账户与交易账户之间划转 USDT.</p>
{% include 'instance_transfer_panel.html' %}
{% elif tab.key == 'export' %}
<h2>数据导出</h2>
<p class="settings-subcard-desc muted">CSV · v{{ instance_settings.data_export_version }}</p>
<div class="settings-export-links-inline settings-export-links-block">
<a href="/export/trade_records">交易记录</a>
<a href="/export/journal_entries">复盘记录</a>
<a href="/export/key_monitors">关键位(当前)</a>
<a href="/export/key_monitor_history">关键位历史</a>
</div>
{% elif tab.key == 'options_swap' %}
<h2>币种兑换</h2>
{% include 'options_settings_swap.html' %}
{% elif tab.key == 'options_transfer' %}
<h2>期权资金划转</h2>
{% include 'options_settings_transfer.html' %}
{% endif %}
</section>
{% endfor %}
</div>
</div>
{% endif %}
{% if instance_settings.options_settings_enabled %}
{% include 'options_settings_panel.html' %}
{% endif %}
</div>
<script>
(function () {
try {
var q = new URLSearchParams(window.location.search || "");
var key = (q.get("settings_tab") || "").trim();
if (!key) return;
var radio = document.querySelector('input.env-tab-radio[data-settings-tab="' + key + '"]');
if (radio) radio.checked = true;
} catch (e) {}
})();
</script>