diff --git a/crypto_monitor_binance/templates/index.html b/crypto_monitor_binance/templates/index.html index f7e114d..e870f87 100644 --- a/crypto_monitor_binance/templates/index.html +++ b/crypto_monitor_binance/templates/index.html @@ -237,7 +237,7 @@ .stats-period-block h3{font-size:1rem;color:#dbe4ff;margin-bottom:4px} .stats-period-block .sub{font-size:.78rem;color:#8892b0;margin-bottom:10px;line-height:1.4} - + @@ -822,7 +822,7 @@ - + @@ -911,6 +911,7 @@ function setDetailBodyMarkdown(text){ if(window.InstanceUI && InstanceUI.clearDetailActions) InstanceUI.clearDetailActions(); const body = document.getElementById("detailBody"); if(!body) return; + body.classList.remove("trade-record-detail-wrap", "journal-detail-meta"); if(window.AiReviewRender && AiReviewRender.setElementMarkdown){ body.classList.add("md-review"); AiReviewRender.setElementMarkdown(body, text || ""); diff --git a/crypto_monitor_gate/templates/index.html b/crypto_monitor_gate/templates/index.html index 3cedc36..8a9a610 100644 --- a/crypto_monitor_gate/templates/index.html +++ b/crypto_monitor_gate/templates/index.html @@ -237,7 +237,7 @@ .stats-period-block h3{font-size:1rem;color:#dbe4ff;margin-bottom:4px} .stats-period-block .sub{font-size:.78rem;color:#8892b0;margin-bottom:10px;line-height:1.4} - + @@ -789,7 +789,7 @@ - + @@ -878,6 +878,7 @@ function setDetailBodyMarkdown(text){ if(window.InstanceUI && InstanceUI.clearDetailActions) InstanceUI.clearDetailActions(); const body = document.getElementById("detailBody"); if(!body) return; + body.classList.remove("trade-record-detail-wrap", "journal-detail-meta"); if(window.AiReviewRender && AiReviewRender.setElementMarkdown){ body.classList.add("md-review"); AiReviewRender.setElementMarkdown(body, text || ""); diff --git a/crypto_monitor_gate_bot/templates/index.html b/crypto_monitor_gate_bot/templates/index.html index 3cedc36..8a9a610 100644 --- a/crypto_monitor_gate_bot/templates/index.html +++ b/crypto_monitor_gate_bot/templates/index.html @@ -237,7 +237,7 @@ .stats-period-block h3{font-size:1rem;color:#dbe4ff;margin-bottom:4px} .stats-period-block .sub{font-size:.78rem;color:#8892b0;margin-bottom:10px;line-height:1.4} - + @@ -789,7 +789,7 @@ - + @@ -878,6 +878,7 @@ function setDetailBodyMarkdown(text){ if(window.InstanceUI && InstanceUI.clearDetailActions) InstanceUI.clearDetailActions(); const body = document.getElementById("detailBody"); if(!body) return; + body.classList.remove("trade-record-detail-wrap", "journal-detail-meta"); if(window.AiReviewRender && AiReviewRender.setElementMarkdown){ body.classList.add("md-review"); AiReviewRender.setElementMarkdown(body, text || ""); diff --git a/crypto_monitor_okx/templates/index.html b/crypto_monitor_okx/templates/index.html index a681611..be56ba5 100644 --- a/crypto_monitor_okx/templates/index.html +++ b/crypto_monitor_okx/templates/index.html @@ -237,7 +237,7 @@ .stats-period-block h3{font-size:1rem;color:#dbe4ff;margin-bottom:4px} .stats-period-block .sub{font-size:.78rem;color:#8892b0;margin-bottom:10px;line-height:1.4} - + @@ -818,7 +818,7 @@ - + @@ -907,6 +907,7 @@ function setDetailBodyMarkdown(text){ if(window.InstanceUI && InstanceUI.clearDetailActions) InstanceUI.clearDetailActions(); const body = document.getElementById("detailBody"); if(!body) return; + body.classList.remove("trade-record-detail-wrap", "journal-detail-meta"); if(window.AiReviewRender && AiReviewRender.setElementMarkdown){ body.classList.add("md-review"); AiReviewRender.setElementMarkdown(body, text || ""); diff --git a/static/instance_theme.css b/static/instance_theme.css index bef47f9..3810061 100644 --- a/static/instance_theme.css +++ b/static/instance_theme.css @@ -208,6 +208,14 @@ font-size: 0.78rem !important; padding: 6px 10px !important; } + + .detail-modal .panel-body.trade-record-detail-wrap { + white-space: normal; + } + + .trd-row { + grid-template-columns: 76px minmax(0, 1fr); + } } @media (min-width: 721px) { @@ -216,6 +224,41 @@ } } +.detail-modal .panel-body.trade-record-detail-wrap { + white-space: normal; +} + +.trade-record-detail { + display: flex; + flex-direction: column; + gap: 8px; +} + +.trd-row { + display: grid; + grid-template-columns: 92px minmax(0, 1fr); + gap: 8px 12px; + align-items: center; + line-height: 1.45; +} + +.trd-label { + color: #8892b0; + font-size: 0.82rem; +} + +.trd-value { + color: #e5e9ff; + font-size: 0.86rem; + text-align: left; + min-width: 0; +} + +.trd-value .badge { + display: inline-block; + vertical-align: middle; +} + /* 手机竖屏(含大屏手机) */ @media (max-width: 900px) and (orientation: portrait) { .grid { @@ -1206,6 +1249,14 @@ html[data-theme="light"] .key-row-collapse.key-history-failed .key-history-outco border-color: rgba(192, 48, 48, 0.22) !important; } +html[data-theme="light"] .trd-label { + color: #6a7588 !important; +} + +html[data-theme="light"] .trd-value { + color: #142232 !important; +} + html[data-theme="light"] .mobile-record-row { background: #fff !important; border-color: #b8c8d8 !important; diff --git a/static/instance_ui.js b/static/instance_ui.js index f8df97d..460302a 100644 --- a/static/instance_ui.js +++ b/static/instance_ui.js @@ -53,7 +53,7 @@ function setJournalDetailBody(o, formatExitLine) { const body = document.getElementById("detailBody"); if (!body) return; - body.classList.remove("md-review"); + body.classList.remove("md-review", "trade-record-detail-wrap"); body.classList.add("journal-detail-meta"); body.innerHTML = buildJournalDetailHtml(o, formatExitLine); } @@ -144,7 +144,7 @@ rowId: tr.id, symbol: cells[0].textContent.trim(), type: cells[1].textContent.trim(), - directionHtml: dirBadge ? dirBadge.outerHTML : cells[2].innerHTML, + directionHtml: (dirBadge ? dirBadge.outerHTML : cells[2].innerHTML).trim(), directionText: cells[2].textContent.trim(), trigger: cells[3].textContent.trim(), stopLoss: cells[4].textContent.trim(), @@ -154,9 +154,9 @@ holdMinutes: cells[8].textContent.trim(), openedAt: cells[9].textContent.trim(), closedAt: cells[10].textContent.trim(), - pnlHtml: cells[11].innerHTML, + pnlHtml: cells[11].innerHTML.trim(), pnlText: cells[11].textContent.trim(), - resultHtml: cells[12].innerHTML, + resultHtml: cells[12].innerHTML.trim(), resultText: cells[12].textContent.trim(), actionsHtml: cells[13].innerHTML, }; @@ -173,23 +173,26 @@ `; } + function tradeDetailRow(label, valueHtml) { + return `
${escapeHtml(label)}${valueHtml}
`; + } + function buildTradeRecordDetailHtml(row) { - const lines = [ - `品种:${escapeHtml(row.symbol)}`, - `类型:${escapeHtml(row.type)}`, - `方向:${row.directionHtml}`, - `成交价:${escapeHtml(row.trigger)}`, - `止损(开仓):${escapeHtml(row.stopLoss)}`, - `止盈:${escapeHtml(row.takeProfit)}`, - `基数:${escapeHtml(row.margin)}`, - `杠杆:${escapeHtml(row.leverage)}`, - `持仓分钟:${escapeHtml(row.holdMinutes)}`, - `开仓时间:${escapeHtml(row.openedAt)}`, - `平仓时间:${escapeHtml(row.closedAt)}`, - `盈亏U:${row.pnlHtml}`, - `结果:${row.resultHtml}`, - ]; - return lines.join("
"); + return `
${ + tradeDetailRow("品种", escapeHtml(row.symbol)) + + tradeDetailRow("类型", escapeHtml(row.type)) + + tradeDetailRow("方向", row.directionHtml) + + tradeDetailRow("成交价", escapeHtml(row.trigger)) + + tradeDetailRow("止损(开仓)", escapeHtml(row.stopLoss)) + + tradeDetailRow("止盈", escapeHtml(row.takeProfit)) + + tradeDetailRow("基数", escapeHtml(row.margin)) + + tradeDetailRow("杠杆", escapeHtml(row.leverage)) + + tradeDetailRow("持仓分钟", escapeHtml(row.holdMinutes)) + + tradeDetailRow("开仓时间", escapeHtml(row.openedAt)) + + tradeDetailRow("平仓时间", escapeHtml(row.closedAt)) + + tradeDetailRow("盈亏U", row.pnlHtml) + + tradeDetailRow("结果", row.resultHtml) + }
`; } function clearDetailActions() { @@ -229,6 +232,7 @@ const body = document.getElementById("detailBody"); if (body) { body.classList.remove("md-review", "journal-detail-meta"); + body.classList.add("trade-record-detail-wrap"); body.innerHTML = buildTradeRecordDetailHtml(row); } setDetailActionsHtml(