feat: add checkpoint hash filtering and navigation

- Add checkpoint hash parameter parsing to backend routes
- Implement checkpoint hash filtering in frontend API client
- Add click navigation from recipe modal to checkpoints page
- Update checkpoint items to use pointer cursor for better UX

Checkpoint items in recipe modal are now clickable and will navigate to the checkpoints page with appropriate hash filtering applied. This improves user workflow when wanting to view checkpoint details from recipes.
This commit is contained in:
Will Miao
2025-11-21 16:17:01 +08:00
parent 1971881537
commit 9a789f8f08
16 changed files with 227 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
import logging
from typing import Dict
from aiohttp import web
from .base_model_routes import BaseModelRoutes
@@ -51,6 +52,19 @@ class CheckpointRoutes(BaseModelRoutes):
def _get_expected_model_types(self) -> str:
"""Get expected model types string for error messages"""
return "Checkpoint"
def _parse_specific_params(self, request: web.Request) -> Dict:
"""Parse Checkpoint-specific parameters"""
params: Dict = {}
if 'checkpoint_hash' in request.query:
params['hash_filters'] = {'single_hash': request.query['checkpoint_hash'].lower()}
elif 'checkpoint_hashes' in request.query:
params['hash_filters'] = {
'multiple_hashes': [h.lower() for h in request.query['checkpoint_hashes'].split(',')]
}
return params
async def get_checkpoint_info(self, request: web.Request) -> web.Response:
"""Get detailed information for a specific checkpoint by name"""