30 lines
1.2 KiB
Python
30 lines
1.2 KiB
Python
#!/usr/bin/env python3
|
|
path = "/var/www/html/weval-technology-platform.html"
|
|
with open(path, "r", encoding="utf-8") as f:
|
|
c = f.read()
|
|
|
|
if "crm_bridge" in c:
|
|
print("ALREADY_PATCHED")
|
|
exit(0)
|
|
|
|
# Insert CRM Bridge V67/V68/V69 as 6th item in extras[] array
|
|
old = """ {id:'truth', icon:'', label:'Truth Registry', color:'#22c55e', count: TREE.truth_registry?.agents||0},
|
|
];"""
|
|
new = """ {id:'truth', icon:'', label:'Truth Registry', color:'#22c55e', count: TREE.truth_registry?.agents||0},
|
|
{id:'crm_bridge', icon:'\ud83d\udd17', label:'CRM Bridge (4 CRMs)', color:'#22d3ee', count: 4},
|
|
];"""
|
|
|
|
if old in c:
|
|
c = c.replace(old, new, 1)
|
|
# Also add navigation handler - navigateTo should open admin-crm-v68 in new tab
|
|
old_nav = " else if (modId === 'all_pages') renderAllPages();"
|
|
new_nav = """ else if (modId === 'crm_bridge') { window.open('/wevia-ia/wevia-admin-crm-v68.php', '_blank'); return; }
|
|
else if (modId === 'all_pages') renderAllPages();"""
|
|
c = c.replace(old_nav, new_nav, 1)
|
|
|
|
with open(path, "w", encoding="utf-8") as f:
|
|
f.write(c)
|
|
print(f"PATCHED ok - size {len(c)}")
|
|
else:
|
|
print("PATTERN_NOT_FOUND")
|