fix: show Laya model download progress and surface errors in Settings (#12)

Track download progress in layaService (bytes/total, phase, error
state) and expose it through the laya status route. Render a progress
bar during model download in Settings via a layaStatusPresentation
service, and display download/status errors inline instead of failing
silently. Cover progress tracking and status presentation with tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
blomios
2026-10-02 11:49:36 +02:00
parent d134c9790d
commit d276d3b4c3
8 changed files with 486 additions and 48 deletions

View File

@ -17,7 +17,7 @@ router.get('/status', requireAuth, async (req, res) => {
router.post('/model/download', requireAuth, requireAdmin, async (req, res) => {
try {
res.json(await laya.downloadModel(req.body?.model));
res.status(202).json(laya.startModelDownload(req.body?.model));
} catch (error) {
sendError(res, error);
}