Fix false options close sync, restore bar layout, and show open premium in history.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3303,9 +3303,9 @@ html[data-theme="light"] .options-estimate-row {
|
||||
.opt-pos-bar-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
flex: 0 1 auto;
|
||||
flex: 1 1 auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
.opt-pos-bar-id-group {
|
||||
@@ -3313,7 +3313,7 @@ html[data-theme="light"] .options-estimate-row {
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
flex-shrink: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
.opt-pos-bar .pos-side-badge {
|
||||
@@ -3325,17 +3325,19 @@ html[data-theme="light"] .options-estimate-row {
|
||||
font-size: 0.62rem;
|
||||
line-height: 1;
|
||||
}
|
||||
.opt-pos-cards--accordion .opt-pos-bar-meta {
|
||||
display: none;
|
||||
.opt-pos-bar-meta {
|
||||
font-size: 0.66rem;
|
||||
color: #8b95b0;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.opt-pos-bar-side {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
gap: 1px;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex: 0 0 auto;
|
||||
margin-left: auto;
|
||||
margin-left: 8px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.opt-pos-bar-title {
|
||||
@@ -3348,11 +3350,6 @@ html[data-theme="light"] .options-estimate-row {
|
||||
flex: 0 1 auto;
|
||||
min-width: 0;
|
||||
}
|
||||
.opt-pos-bar-meta {
|
||||
font-size: 0.66rem;
|
||||
color: #8b95b0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.opt-pos-bar-cd {
|
||||
font-size: 0.66rem;
|
||||
color: #8b95b0;
|
||||
|
||||
@@ -485,12 +485,14 @@
|
||||
'<span class="opt-pos-bar-id-group">' +
|
||||
'<strong class="opt-pos-bar-title" title="' + inst + '">' + inst + "</strong>" +
|
||||
'<span class="pos-side-badge ' + sideCls + '">' + optTypeLabel(p.opt_type) + "</span>" +
|
||||
"</span></span>" +
|
||||
"</span>" +
|
||||
'<span class="opt-pos-bar-meta">行权 ' + fmt(p.strike, 0) + " · " + fmt(p.pos, 0) + "张</span>" +
|
||||
"</span>" +
|
||||
'<span class="opt-pos-bar-side">' +
|
||||
(expAttr
|
||||
? '<span class="opt-pos-bar-cd"><span class="opt-expiry-cd" data-opt-exp-ms="' + expAttr + '">—</span></span>'
|
||||
? '<span class="opt-pos-bar-cd">到期 <span class="opt-expiry-cd" data-opt-exp-ms="' + expAttr + '">—</span></span>'
|
||||
: "") +
|
||||
'<span class="opt-pos-bar-pnl ' + uplCls + '">' + fmt(p.upl, 2) + "</span>" +
|
||||
'<span class="opt-pos-bar-pnl ' + uplCls + '">' + fmt(p.upl, 2) + " USDC</span>" +
|
||||
'<span class="opt-pos-bar-roi ' + uplCls + '">' +
|
||||
(p.upl_ratio_pct != null ? fmt(p.upl_ratio_pct, 2) + "%" : "—") + "</span>" +
|
||||
"</span>" +
|
||||
@@ -679,8 +681,7 @@
|
||||
}
|
||||
list.forEach(function (h) {
|
||||
const tr = document.createElement("tr");
|
||||
const prem = h.status === "closed" ? h.premium_received : h.premium_paid;
|
||||
const premTxt = prem != null ? fmt(prem, 2) : "—";
|
||||
const premTxt = h.premium_paid != null ? fmt(h.premium_paid, 2) : "—";
|
||||
const pnl = h.realized_pnl;
|
||||
const pnlTxt = pnl != null ? fmt(pnl, 2) : "—";
|
||||
const pnlCls = pnl > 0 ? "pos-pnl-profit" : pnl < 0 ? "pos-pnl-loss" : "";
|
||||
|
||||
Reference in New Issue
Block a user