feat: Add WebSocket support for checkpoint download progress and update related components

This commit is contained in:
Will Miao
2025-04-13 21:31:01 +08:00
parent 9822f2c614
commit 76fc9e5a3d
3 changed files with 95 additions and 8 deletions

View File

@@ -292,9 +292,9 @@ export class CheckpointDownloadManager {
const updateProgress = this.loadingManager.showDownloadProgress(1);
updateProgress(0, 0, this.currentVersion.name);
// Setup WebSocket for progress updates
// Setup WebSocket for progress updates using checkpoint-specific endpoint
const wsProtocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
const ws = new WebSocket(`${wsProtocol}${window.location.host}/ws/fetch-progress`);
const ws = new WebSocket(`${wsProtocol}${window.location.host}/ws/checkpoint-progress`);
ws.onmessage = (event) => {
const data = JSON.parse(event.data);