debugging web ui

This commit is contained in:
Dobromir Popov
2025-08-05 15:58:51 +03:00
parent 622d059aae
commit bf4d43f6f7
8 changed files with 571 additions and 58 deletions

View File

@ -267,7 +267,9 @@
async function loadInitialData() {
try {
const response = await fetch('/api/health');
// Use port 8080 for API calls since that's where our API runs
const apiUrl = `http://${window.location.hostname}:8080/api/health`;
const response = await fetch(apiUrl);
if (response.ok) {
const data = await response.json();
updateSystemStatus(data);
@ -283,7 +285,9 @@
function connectWebSocket() {
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsUrl = `${protocol}//${window.location.host}/ws/dashboard`;
// Use port 8080 for WebSocket connection since that's where our API runs
const host = window.location.hostname;
const wsUrl = `${protocol}//${host}:8080/ws/dashboard`;
ws = new WebSocket(wsUrl);