Skip to content

Commit 4a42f09

Browse files
committed
Revert "Dynamic platformMeta from API, binance in Worker PLATFORM_META"
This reverts commit 81310ff.
1 parent 81310ff commit 4a42f09

3 files changed

Lines changed: 3 additions & 15 deletions

File tree

web/strategy-switch-console/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ <h2 data-i18n="summary">切换摘要</h2>
14871487
binance: "QuantStrategyLab/BinancePlatform",
14881488
};
14891489

1490-
let platformMeta = {
1490+
const platformMeta = {
14911491
longbridge: { label: "LongBridge", code: "LB", accent: "var(--lb)" },
14921492
ibkr: { label: "IBKR", code: "IB", accent: "var(--ib)" },
14931493
schwab: { label: "Schwab", code: "SW", accent: "var(--sw)" },
@@ -4059,7 +4059,6 @@ <h2 data-i18n="summary">切换摘要</h2>
40594059
if (payload.accountOptions) {
40604060
applyStrategyProfiles(payload.strategyProfiles || defaultStrategyProfiles);
40614061
state.accountOptions = normalizeAccountOptions(payload.accountOptions);
4062-
if (payload.platformMeta) { platformMeta = payload.platformMeta; }
40634062
state.repositories = normalizePlatformRepositories(payload.platformRepositories || {});
40644063
state.currentStrategies = normalizeCurrentStrategies(payload.currentStrategies || {});
40654064
state.configSource = "private";

web/strategy-switch-console/page_asset.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/strategy-switch-console/worker.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -534,24 +534,14 @@ async function renderAdminPage(state) {
534534
</html>`;
535535
}
536536

537-
const PLATFORM_META = {
538-
longbridge: { label: "LongBridge", code: "LB", accent: "var(--lb)" },
539-
ibkr: { label: "IBKR", code: "IB", accent: "var(--ib)" },
540-
schwab: { label: "Schwab", code: "SW", accent: "var(--sw)" },
541-
firstrade: { label: "Firstrade", code: "FT", accent: "var(--ft)" },
542-
qmt: { label: "QMT", code: "QM", accent: "var(--qmt)" },
543-
binance: { label: "Binance", code: "BN", accent: "var(--bn)" },
544-
};
545-
546537
async function configPayload(request, env) {
547538
const session = await readSession(request, env);
548-
if (!session?.allowed) return { accountOptions: null, platformMeta: PLATFORM_META };
539+
if (!session?.allowed) return { accountOptions: null };
549540
const accountConfig = await loadAccountOptionsConfig(env);
550541
const strategyProfiles = await loadStrategyProfilesConfig(env);
551542
return {
552543
accountOptions: accountConfig.options,
553544
platformRepositories: platformRepositories(env),
554-
platformMeta: PLATFORM_META,
555545
strategyProfiles,
556546
currentStrategies: await loadCurrentStrategiesSafely(accountConfig.options, env),
557547
};
@@ -560,7 +550,6 @@ async function configPayload(request, env) {
560550
async function strategyProfilesPayload(env) {
561551
return {
562552
strategyProfiles: await loadStrategyProfilesConfig(env),
563-
platformMeta: PLATFORM_META,
564553
};
565554
}
566555

0 commit comments

Comments
 (0)