feat期权标的白名单:可固定只显示 ETH 或 BTC。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-13 19:09:06 +08:00
parent 8d846794a2
commit 1835a79698
11 changed files with 215 additions and 13 deletions
+23 -1
View File
@@ -8,8 +8,30 @@
const panelCache = (window.__optionsPanelCache = window.__optionsPanelCache || {});
const allowedUnderlys = (function () {
const raw = String(root.dataset.allowedUnderlys || "ETH,BTC");
const list = raw
.split(",")
.map(function (s) {
return String(s || "")
.trim()
.toUpperCase();
})
.filter(function (u) {
return u === "ETH" || u === "BTC";
});
return list.length ? list : ["ETH", "BTC"];
})();
const bootUnderly = (function () {
const d = String(root.dataset.defaultUnderly || "ETH")
.trim()
.toUpperCase();
if (allowedUnderlys.indexOf(d) >= 0) return d;
return allowedUnderlys[0] || "ETH";
})();
const state = {
underlying: root.dataset.defaultUnderly || "ETH",
underlying: bootUnderly,
optType: "C",
moneyFilter: "all",
chainView: "list",