feat: Visualize active iSCSI sessions
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user