phase 4
This commit is contained in:
@@ -58,32 +58,30 @@ def write_config(update: ConfigUpdate):
|
||||
|
||||
|
||||
@router.get("/config/profiles")
|
||||
def list_profiles():
|
||||
def get_profiles():
|
||||
"""List available detection profiles."""
|
||||
from detect.profiles import _PROFILES
|
||||
return [{"name": name} for name in _PROFILES]
|
||||
from core.detect.profile import list_profiles as _list
|
||||
return [{"name": name} for name in _list()]
|
||||
|
||||
|
||||
@router.get("/config/profiles/{profile_name}/pipeline")
|
||||
def get_pipeline_config(profile_name: str):
|
||||
"""Return the pipeline composition for a profile."""
|
||||
from detect.profiles import get_profile
|
||||
from core.detect.profile import get_profile
|
||||
from fastapi import HTTPException
|
||||
from dataclasses import asdict
|
||||
|
||||
try:
|
||||
profile = get_profile(profile_name)
|
||||
except ValueError:
|
||||
raise HTTPException(status_code=404, detail=f"Unknown profile: {profile_name}")
|
||||
|
||||
config = profile.pipeline_config()
|
||||
return asdict(config)
|
||||
return profile["pipeline"]
|
||||
|
||||
|
||||
@router.get("/config/stages", response_model=list[StageConfigInfo])
|
||||
def list_stage_configs():
|
||||
"""Return the stage palette with config field metadata for the editor."""
|
||||
from detect.stages import list_stages
|
||||
from core.detect.stages import list_stages
|
||||
|
||||
result = []
|
||||
for stage in list_stages():
|
||||
@@ -95,7 +93,7 @@ def list_stage_configs():
|
||||
@router.get("/config/stages/{stage_name}", response_model=StageConfigInfo)
|
||||
def get_stage_config(stage_name: str):
|
||||
"""Return config field metadata for a single stage."""
|
||||
from detect.stages import get_stage
|
||||
from core.detect.stages import get_stage
|
||||
|
||||
try:
|
||||
stage = get_stage(stage_name)
|
||||
|
||||
Reference in New Issue
Block a user