增加导航栏
This commit is contained in:
@@ -721,24 +721,6 @@ function syncKeySlTpFields() {
|
|||||||
if (tpEl) tpEl.style.display = mode === "trend_manual" ? "" : "none";
|
if (tpEl) tpEl.style.display = mode === "trend_manual" ? "" : "none";
|
||||||
}
|
}
|
||||||
|
|
||||||
function wireKeyMonitorSegGroup(groupId, hiddenInputId, onChange) {
|
|
||||||
const group = document.getElementById(groupId);
|
|
||||||
const hidden = document.getElementById(hiddenInputId);
|
|
||||||
if (!group || !hidden) return;
|
|
||||||
group.addEventListener("click", (ev) => {
|
|
||||||
const btn = ev.target.closest && ev.target.closest(".matrix-seg-btn");
|
|
||||||
if (!btn) return;
|
|
||||||
group.querySelectorAll(".matrix-seg-btn").forEach((b) => b.classList.remove("is-active"));
|
|
||||||
btn.classList.add("is-active");
|
|
||||||
hidden.value = btn.getAttribute("data-value") || "";
|
|
||||||
if (onChange) onChange();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function initKeyMonitorSegGroups() {
|
|
||||||
wireKeyMonitorSegGroup("keyMonitorTypeSeg", "keyMonitorTypeInput");
|
|
||||||
}
|
|
||||||
|
|
||||||
function setKeyMonitorActiveCount(n) {
|
function setKeyMonitorActiveCount(n) {
|
||||||
const el = document.getElementById("keyMonitorActiveCount");
|
const el = document.getElementById("keyMonitorActiveCount");
|
||||||
if (el) el.textContent = String(n);
|
if (el) el.textContent = String(n);
|
||||||
@@ -839,7 +821,6 @@ async function addKeyMonitor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function wireKeyMonitorPanel() {
|
function wireKeyMonitorPanel() {
|
||||||
initKeyMonitorSegGroups();
|
|
||||||
const modeSel = document.getElementById("keySlTpModeInput");
|
const modeSel = document.getElementById("keySlTpModeInput");
|
||||||
if (modeSel) modeSel.addEventListener("change", syncKeySlTpFields);
|
if (modeSel) modeSel.addEventListener("change", syncKeySlTpFields);
|
||||||
syncKeySlTpFields();
|
syncKeySlTpFields();
|
||||||
|
|||||||
@@ -1298,11 +1298,31 @@ pre {
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.key-monitor-active-head {
|
.key-monitor-cols {
|
||||||
|
align-items: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.key-monitor-col-head {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 8px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
min-height: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.key-monitor-col-head-main {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
margin-bottom: 8px;
|
}
|
||||||
|
|
||||||
|
.key-monitor-export {
|
||||||
|
flex-shrink: 0;
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
padding: 4px 8px;
|
||||||
|
min-height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.key-monitor-count {
|
.key-monitor-count {
|
||||||
@@ -1312,12 +1332,17 @@ pre {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.key-monitor-active-list {
|
.key-monitor-scroll-list {
|
||||||
max-height: calc(8 * 52px + 7 * 8px);
|
max-height: calc(8 * 52px + 7 * 8px);
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.key-monitor-scroll-list > .item {
|
||||||
|
min-height: 52px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
.key-monitor-row {
|
.key-monitor-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -1801,10 +1826,14 @@ body.matrix-theme {
|
|||||||
font-size: 8px;
|
font-size: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.key-monitor-active-list {
|
.key-monitor-scroll-list {
|
||||||
max-height: calc(8 * 48px + 7 * 8px);
|
max-height: calc(8 * 48px + 7 * 8px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.key-monitor-scroll-list > .item {
|
||||||
|
min-height: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
.matrix-grid {
|
.matrix-grid {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,11 +136,10 @@
|
|||||||
<p id="keyMonitorRule" class="matrix-hint matrix-dim">// 规则加载中…</p>
|
<p id="keyMonitorRule" class="matrix-hint matrix-dim">// 规则加载中…</p>
|
||||||
<div class="matrix-form-row matrix-form-row-wrap key-monitor-form">
|
<div class="matrix-form-row matrix-form-row-wrap key-monitor-form">
|
||||||
<input id="keySymbolInput" class="matrix-input key-monitor-field" type="text" placeholder="BTC 或 BTC/USDT" />
|
<input id="keySymbolInput" class="matrix-input key-monitor-field" type="text" placeholder="BTC 或 BTC/USDT" />
|
||||||
<div class="matrix-seg-group" id="keyMonitorTypeSeg" aria-label="结构类型">
|
<select id="keyMonitorTypeInput" class="matrix-input key-monitor-field">
|
||||||
<button type="button" class="matrix-seg-btn is-active" data-value="箱体突破">箱体</button>
|
<option value="箱体突破">箱体突破</option>
|
||||||
<button type="button" class="matrix-seg-btn" data-value="收敛突破">收敛</button>
|
<option value="收敛突破">收敛突破</option>
|
||||||
</div>
|
</select>
|
||||||
<input type="hidden" id="keyMonitorTypeInput" value="箱体突破" />
|
|
||||||
<select id="keyDirectionInput" class="matrix-input key-monitor-field">
|
<select id="keyDirectionInput" class="matrix-input key-monitor-field">
|
||||||
<option value="">方向</option>
|
<option value="">方向</option>
|
||||||
<option value="long">做多</option>
|
<option value="long">做多</option>
|
||||||
@@ -159,20 +158,22 @@
|
|||||||
<button type="button" id="keyAddBtn" class="matrix-btn matrix-btn-pulse key-monitor-add">添加监控</button>
|
<button type="button" id="keyAddBtn" class="matrix-btn matrix-btn-pulse key-monitor-add">添加监控</button>
|
||||||
</div>
|
</div>
|
||||||
<p id="keyMonitorSaveMsg" class="matrix-msg"></p>
|
<p id="keyMonitorSaveMsg" class="matrix-msg"></p>
|
||||||
<div class="matrix-two-col" style="margin-top:12px">
|
<div class="matrix-two-col key-monitor-cols" style="margin-top:12px">
|
||||||
<div>
|
<div>
|
||||||
<div class="key-monitor-active-head">
|
<div class="key-monitor-col-head">
|
||||||
<h3 class="matrix-hint" style="margin:0">监控中</h3>
|
<div class="key-monitor-col-head-main">
|
||||||
<span id="keyMonitorActiveCount" class="matrix-chip key-monitor-count">0</span>
|
<h3 class="matrix-hint" style="margin:0">监控中</h3>
|
||||||
|
<span id="keyMonitorActiveCount" class="matrix-chip key-monitor-count">0</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="keyMonitorActive" class="matrix-list key-monitor-active-list"></div>
|
<div id="keyMonitorActive" class="matrix-list key-monitor-scroll-list"></div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div style="display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px">
|
<div class="key-monitor-col-head">
|
||||||
<h3 class="matrix-hint" style="margin:0">关键位历史</h3>
|
<h3 class="matrix-hint" style="margin:0">关键位历史</h3>
|
||||||
<a id="keyHistoryExport" class="matrix-btn ghost" href="/export/key_monitor_history.csv?days=30" style="text-decoration:none;font-size:.75rem">导出 CSV</a>
|
<a id="keyHistoryExport" class="matrix-btn ghost key-monitor-export" href="/export/key_monitor_history.csv?days=30">导出 CSV</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="keyMonitorHistory" class="matrix-list"></div>
|
<div id="keyMonitorHistory" class="matrix-list key-monitor-scroll-list"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user