diff --git a/static/index.html b/static/index.html
index 34a53f89..3f88f6fb 100644
--- a/static/index.html
+++ b/static/index.html
@@ -2302,6 +2302,30 @@ function sortStrategies(strategies, key, dir) {
return arr;
}
+// ── 2026-08-16 手动可用性(全局,供 onclick 调用):激活只能是可用的策略 ──
+async function toggleAvail(version, checked) {
+ try {
+ await fetch('/api/research/availability', {
+ method: 'POST', headers: {'Content-Type': 'application/json'},
+ body: JSON.stringify({version: version, available: checked, note: '手动切换'})
+ });
+ loadStrategyList(); // 刷新(state 可能变化)
+ } catch(e) { console.error('toggleAvail failed', e); }
+}
+async function batchAvail(rg, available) {
+ const list = (window._strats || [])
+ .filter(s => s.best_regime === rg && (s.market || 'all') !== 'hk')
+ .map(s => s.version);
+ if (!list.length) return;
+ try {
+ await fetch('/api/research/availability?batch=1', {
+ method: 'POST', headers: {'Content-Type': 'application/json'},
+ body: JSON.stringify({versions: list, available: available, note: '批量' + (available ? '可用' : '不可用')})
+ });
+ loadStrategyList();
+ } catch(e) { console.error('batchAvail failed', e); }
+}
+
function renderStrategyTable(strategies) {
const el = document.getElementById('strategyList');
if (!strategies.length) { el.innerHTML = '
暂无策略版本
'; return; }
@@ -2543,30 +2567,6 @@ function renderStrategyTable(strategies) {
cell('portfolio_max_dd_pct', ddV, v => v + '%', '') +
' | ';
};
- // 2026-08-16 手动可用性:切换单个策略(激活只能是可用的策略)
- async function toggleAvail(version, checked) {
- try {
- await fetch('/api/research/availability', {
- method: 'POST', headers: {'Content-Type': 'application/json'},
- body: JSON.stringify({version: version, available: checked, note: '手动切换'})
- });
- loadStrategyList(); // 刷新(state 可能变化)
- } catch(e) { console.error('toggleAvail failed', e); }
- }
- // 2026-08-16 批量设置可用性(当前温区表全部)
- async function batchAvail(rg, available) {
- const list = (window._strats || [])
- .filter(s => s.best_regime === rg && (s.market || 'all') !== 'hk')
- .map(s => s.version);
- if (!list.length) return;
- try {
- await fetch('/api/research/availability?batch=1', {
- method: 'POST', headers: {'Content-Type': 'application/json'},
- body: JSON.stringify({versions: list, available: available, note: '批量' + (available ? '可用' : '不可用')})
- });
- loadStrategyList();
- } catch(e) { console.error('batchAvail failed', e); }
- }
const renderRegimeTable = (strats, rg, isCur, marketLabel, tempHtml) => {
// 2026-08-15 方案A:策略只在适应温区(best_regime)表显示一行——所有列都是该策略在适应温区的数据
// 2026-08-16 温区感知排序:尊重 window._sortKey(点列头排序),字段从 regime_winrates[rg] 取