mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-29 07:05:14 -07:00
Add DataFolders component to ServerSettings for managing system folder paths
- Introduced a new DataFolders component to display and manage paths for application data, models, and providers. - Implemented a FolderRow component for individual folder display, including loading states and open folder functionality. - Added API client methods and hooks to fetch system folder paths from the backend. - Updated ServerTab to include the new DataFolders component, enhancing server settings management.
This commit is contained in:
@@ -74,6 +74,19 @@ async def shutdown():
|
||||
return {"message": "Shutting down..."}
|
||||
|
||||
|
||||
@app.get("/system/folders", response_model=models.FolderPathsResponse)
|
||||
async def get_system_folders():
|
||||
"""Get system folder paths for data, models, and providers."""
|
||||
from huggingface_hub import constants as hf_constants
|
||||
from .providers.installer import _get_providers_dir
|
||||
|
||||
return models.FolderPathsResponse(
|
||||
data_dir=str(config.get_data_dir().absolute()),
|
||||
models_dir=str(Path(hf_constants.HF_HUB_CACHE).absolute()),
|
||||
providers_dir=str(_get_providers_dir().absolute()),
|
||||
)
|
||||
|
||||
|
||||
@app.get("/health", response_model=models.HealthResponse)
|
||||
async def health():
|
||||
"""Health check endpoint."""
|
||||
|
||||
@@ -170,6 +170,13 @@ class ActiveTasksResponse(BaseModel):
|
||||
generations: List[ActiveGenerationTask]
|
||||
|
||||
|
||||
class FolderPathsResponse(BaseModel):
|
||||
"""Response model for system folder paths."""
|
||||
data_dir: str
|
||||
models_dir: str
|
||||
providers_dir: str
|
||||
|
||||
|
||||
class AudioChannelCreate(BaseModel):
|
||||
"""Request model for creating an audio channel."""
|
||||
name: str = Field(..., min_length=1, max_length=100)
|
||||
|
||||
Reference in New Issue
Block a user