bep40 commited on
Commit
bdf2909
·
verified ·
1 Parent(s): 92cc960

Fix: use direct file read for index_v2.html

Browse files
Files changed (1) hide show
  1. ai_runtime_final6.py +3 -3
ai_runtime_final6.py CHANGED
@@ -354,7 +354,7 @@ setInterval(()=>{document.querySelectorAll('#ai-topic-input-final3,.topic-final3
354
 
355
  @app.get('/')
356
  async def index_final6():
357
- html=f5.f4.f3.f2.f1._load_index_html()
358
  body=getattr(rt.old,'PATCH_INJECT','')+f5.f4.f3.f2.f1.FINAL_INJECT+f5.f4.f3.FINAL3_INJECT+f5.f4.FINAL4_INJECT+f5.FINAL5_INJECT+FINAL6_INJECT
359
  return HTMLResponse(html.replace('</body>',body+'\n</body>') if '</body>' in html else html+body)
360
 
@@ -752,7 +752,7 @@ setTimeout(()=>{window.__allowShortRefresh=true;},7000);
752
  app.router.routes=[r for r in app.router.routes if not (getattr(r,'path',None)=='/' and 'GET' in getattr(r,'methods',set()))]
753
  @app.get('/')
754
  async def index_final6_fast_home():
755
- html=f5.f4.f3.f2.f1._load_index_html()
756
  body=getattr(rt.old,'PATCH_INJECT','')+f5.f4.f3.f2.f1.FINAL_INJECT+f5.f4.f3.FINAL3_INJECT+f5.f4.FINAL4_INJECT+f5.FINAL5_INJECT+FINAL6_INJECT+FINAL6_FAST_HOME_INJECT
757
  return HTMLResponse(html.replace('</body>',body+'\n</body>') if '</body>' in html else html+body)
758
 
@@ -838,6 +838,6 @@ FINAL6E_INJECT = r'''<style>.placeholder{}</style>'''
838
 
839
  @app.get('/')
840
  async def index_final6():
841
- html = f5.f4.f3.f2.f1._load_index_html()
842
  body = getattr(rt.old, 'PATCH_INJECT', '') + f5.f4.f3.f2.f1.FINAL_INJECT + f5.f4.f3.FINAL3_INJECT + f5.f4.FINAL4_INJECT + f5.FINAL5_INJECT + FINAL6_INJECT
843
  return HTMLResponse(html.replace('</body>', body + '\n</body>') if '</body>' in html else html + body)
 
354
 
355
  @app.get('/')
356
  async def index_final6():
357
+ html=open('/app/static/index_v2.html','r',encoding='utf-8').read() if os.path.exists('/app/static/index_v2.html') else '<html></html>'
358
  body=getattr(rt.old,'PATCH_INJECT','')+f5.f4.f3.f2.f1.FINAL_INJECT+f5.f4.f3.FINAL3_INJECT+f5.f4.FINAL4_INJECT+f5.FINAL5_INJECT+FINAL6_INJECT
359
  return HTMLResponse(html.replace('</body>',body+'\n</body>') if '</body>' in html else html+body)
360
 
 
752
  app.router.routes=[r for r in app.router.routes if not (getattr(r,'path',None)=='/' and 'GET' in getattr(r,'methods',set()))]
753
  @app.get('/')
754
  async def index_final6_fast_home():
755
+ html=open('/app/static/index_v2.html','r',encoding='utf-8').read() if os.path.exists('/app/static/index_v2.html') else '<html></html>'
756
  body=getattr(rt.old,'PATCH_INJECT','')+f5.f4.f3.f2.f1.FINAL_INJECT+f5.f4.f3.FINAL3_INJECT+f5.f4.FINAL4_INJECT+f5.FINAL5_INJECT+FINAL6_INJECT+FINAL6_FAST_HOME_INJECT
757
  return HTMLResponse(html.replace('</body>',body+'\n</body>') if '</body>' in html else html+body)
758
 
 
838
 
839
  @app.get('/')
840
  async def index_final6():
841
+ html = open('/app/static/index_v2.html','r',encoding='utf-8').read() if os.path.exists('/app/static/index_v2.html') else '<html></html>'
842
  body = getattr(rt.old, 'PATCH_INJECT', '') + f5.f4.f3.f2.f1.FINAL_INJECT + f5.f4.f3.FINAL3_INJECT + f5.f4.FINAL4_INJECT + f5.FINAL5_INJECT + FINAL6_INJECT
843
  return HTMLResponse(html.replace('</body>', body + '\n</body>') if '</body>' in html else html + body)