Fix sidebar counts to use is_online status
This commit is contained in:
@@ -648,10 +648,12 @@
|
||||
const response = await fetch("/api/sessions");
|
||||
machines = await response.json();
|
||||
|
||||
// Update counts
|
||||
// Update counts based on is_online status
|
||||
const onlineCount = machines.filter(m => m.is_online).length;
|
||||
const offlineCount = machines.filter(m => !m.is_online).length;
|
||||
document.getElementById("countAll").textContent = machines.length;
|
||||
document.getElementById("countOnline").textContent = machines.length;
|
||||
document.getElementById("countOffline").textContent = "0";
|
||||
document.getElementById("countOnline").textContent = onlineCount;
|
||||
document.getElementById("countOffline").textContent = offlineCount;
|
||||
|
||||
renderMachinesList();
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user