Files
weval-l99/v116_fix_map.py
2026-04-24 04:38:58 +02:00

28 lines
978 B
Python

#!/usr/bin/env python3
"""V116 FIX - Add dashboards to tab map + auto-load"""
path = "/var/www/html/all-ia-hub.html"
with open(path, "r", encoding="utf-8") as f:
c = f.read()
if "V116-MAP-FIX" in c:
print("ALREADY")
exit(0)
old = "const map={chat:'v-chat',code:'v-code',arena:'v-arena',capabilities:'v-caps',training:'v-train',orchestrator:'v-orch'};"
new = "const map={chat:'v-chat',code:'v-code',arena:'v-arena',capabilities:'v-caps',training:'v-train',orchestrator:'v-orch',dashboards:'v-dashboards'}; /* V116-MAP-FIX */"
if old not in c:
print("map anchor missing")
exit(1)
c = c.replace(old, new, 1)
# Also add dashboards trigger in tab click
old_trigger = "if(v==='orchestrator') loadAgents();"
new_trigger = "if(v==='orchestrator') loadAgents(); if(v==='dashboards') loadDashboards();"
if old_trigger in c:
c = c.replace(old_trigger, new_trigger, 1)
with open(path, "w", encoding="utf-8") as f:
f.write(c)
print(f"PATCHED size={len(c)}")