diff --git a/backend/instance/cookie_monitor.db b/backend/instance/cookie_monitor.db index e232d41..94b3c04 100644 Binary files a/backend/instance/cookie_monitor.db and b/backend/instance/cookie_monitor.db differ diff --git a/backend/static/js/app.js b/backend/static/js/app.js index e062963..a1e0286 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -149,22 +149,36 @@ createApp({ try { const usersRes = await axios.get('/api/users'); const websitesRes = await axios.get('/api/websites'); - const latestDetectionsRes = await axios.get('/api/detections/latest'); - const networkRes = await axios.get('/api/websites/check-network'); const usersData = usersRes.data; const allWebsites = websitesRes.data; - const latestDetections = latestDetectionsRes.data; - const networkStatus = networkRes.data; - - let onlineCount = 0, offlineCount = 0, unknownCount = 0, totalWebsites = allWebsites.length; dashboardData.value = usersData.map(user => { const userWebsites = allWebsites.filter(w => w.user_id === user.id); return { id: user.id, name: user.name, - websites: userWebsites.map(w => { + websites: userWebsites.map(w => ({ + ...w, + networkStatus: 'unknown', + loginStatus: 'unknown', + lastCheckTime: '-' + })) + }; + }); + + const latestDetectionsRes = await axios.get('/api/detections/latest'); + const networkRes = await axios.get('/api/websites/check-network'); + + const latestDetections = latestDetectionsRes.data; + const networkStatus = networkRes.data; + + let onlineCount = 0, offlineCount = 0, unknownCount = 0, totalWebsites = allWebsites.length; + + dashboardData.value = dashboardData.value.map(user => { + return { + ...user, + websites: user.websites.map(w => { const detection = latestDetections[w.id]; const net = networkStatus[w.id]; let loginStatus = 'unknown';