feat: Visualize active iSCSI sessions

This commit is contained in:
2025-12-10 14:48:16 +00:00
parent 4f28dfbc11
commit 8c9d1cc8d4
8 changed files with 249 additions and 27 deletions

View File

@@ -1029,6 +1029,38 @@ function loadTargets() {
</td>
</tr>
`).join('');
// Update Active Sessions Table
const sessionTbody = document.getElementById('iscsi-sessions-body');
const noSessionsMsg = document.getElementById('no-sessions-msg');
let hasSessions = false;
if (sessionTbody) {
let sessionsHtml = '';
data.targets.forEach(target => {
if (target.sessions && target.sessions.length > 0) {
target.sessions.forEach(session => {
hasSessions = true;
sessionsHtml += `
<tr>
<td>
<strong>TID ${target.tid}</strong><br>
<small style="font-size:0.75rem; color:#888;">${target.name}</small>
</td>
<td><code>${session.initiator}</code></td>
<td><span class="badge badge-success">${session.ip}</span></td>
</tr>
`;
});
}
});
sessionTbody.innerHTML = sessionsHtml;
if (noSessionsMsg) {
noSessionsMsg.style.display = hasSessions ? 'none' : 'block';
}
}
}
} else {
showNotification(data.error, 'error');