feat(system): 添加后端初始化和健康检查功能

- 新增后端初始化对话框组件
- 实现后端健康检查和初始化逻辑
- 在 App 组件中集成后端初始化和健康检查
- 新增系统健康检查 API 和相关服务
This commit is contained in:
JefferyHcool
2025-06-20 13:05:42 +08:00
parent 7f8d4faa44
commit f23ed6ec6c
15 changed files with 267 additions and 25 deletions

View File

@@ -39,7 +39,6 @@ if not os.path.exists(out_dir):
@asynccontextmanager
async def lifespan(app: FastAPI):
register_handler()
ensure_ffmpeg_or_raise()
init_db()
get_transcriber(transcriber_type=os.getenv("TRANSCRIBER_TYPE", "fast-whisper"))
seed_default_providers()
@@ -48,7 +47,7 @@ async def lifespan(app: FastAPI):
app = create_app(lifespan=lifespan)
app.add_middleware(
CORSMiddleware,
allow_origins=["tauri://localhost"], # 加上 Tauri 的 origin
allow_origins=["tauri://localhost"], # 加上 Tauri 的 origin
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],