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:
Jamie Pine
2026-02-03 00:32:18 -08:00
parent 73d9b5d70e
commit 793e392e56
12 changed files with 185 additions and 1 deletions
+13
View File
@@ -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."""
+7
View File
@@ -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)