's'
This commit is contained in:
12
web.py
12
web.py
@@ -34,6 +34,7 @@ from src.control_plane import (
|
||||
system_snapshot,
|
||||
write_root_file,
|
||||
)
|
||||
from src.hub_routes import configure_hub, router as hub_router
|
||||
from src.web_process_backend import WebProcessBackend, force_kill_ffmpeg, strip_ansi_codes
|
||||
|
||||
# ---------------- 配置(根目录结构) ----------------
|
||||
@@ -176,6 +177,9 @@ async def lifespan(app: FastAPI):
|
||||
|
||||
app = FastAPI(title="多进程录制控制台", lifespan=lifespan)
|
||||
|
||||
configure_hub(process_backend, list(PROCESS_MONITOR))
|
||||
app.include_router(hub_router)
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
@@ -634,6 +638,14 @@ async def shellcrash_page():
|
||||
return await index()
|
||||
|
||||
|
||||
@app.get("/console", include_in_schema=False)
|
||||
async def console_page():
|
||||
route_file = _console_route_html("console")
|
||||
if route_file:
|
||||
return FileResponse(route_file)
|
||||
return await index()
|
||||
|
||||
|
||||
@app.get("/android", include_in_schema=False)
|
||||
async def android_page():
|
||||
route_file = _console_route_html("android")
|
||||
|
||||
Reference in New Issue
Block a user