worked backup

This commit is contained in:
2025-12-21 00:16:12 +03:00
parent d05344e604
commit 43b4c75e36
18 changed files with 273 additions and 59 deletions

View File

@@ -14,7 +14,12 @@ const API_BASE_URL = '/api';
* @returns {string}
*/
export const getWsUrl = (taskId) => {
const baseUrl = PUBLIC_WS_URL || `ws://${window.location.hostname}:8000`;
let baseUrl = PUBLIC_WS_URL;
if (!baseUrl) {
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
// Use the current host and port to allow Vite proxy to handle the connection
baseUrl = `${protocol}//${window.location.host}`;
}
return `${baseUrl}/ws/logs/${taskId}`;
};