Add activity log system for provisioning lifecycle visibility
Hosts stuck in states like pxe_ready had zero visibility into why. This adds a persistent activity log that records every meaningful step (state transitions, PXE events, cluster join stages, failures) and surfaces it on the host detail page with live SSE updates. Includes a stuck-detection warning banner when a host sits in pxe_ready for >10 minutes with no iPXE request. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,24 @@
|
||||
es.addEventListener('host.state_changed', function() {
|
||||
window.location.reload();
|
||||
});
|
||||
es.addEventListener('activity.logged', function(e) {
|
||||
var data;
|
||||
try { data = JSON.parse(e.data); } catch(_) { return; }
|
||||
var logDiv = document.getElementById('activity-log');
|
||||
if (!logDiv) return;
|
||||
var hostId = logDiv.getAttribute('data-host-id');
|
||||
if (String(data.host_id) !== hostId) return;
|
||||
var empty = logDiv.querySelector('.empty');
|
||||
if (empty) empty.remove();
|
||||
var entry = document.createElement('div');
|
||||
entry.className = 'log-entry log-' + data.level;
|
||||
var t = new Date(data.created_at);
|
||||
var ts = t.getHours().toString().padStart(2,'0') + ':' + t.getMinutes().toString().padStart(2,'0');
|
||||
entry.innerHTML = '<span class="log-time">' + ts + '</span>' +
|
||||
'<span class="log-source">' + data.source + '</span>' +
|
||||
'<span class="log-msg">' + data.message + '</span>';
|
||||
logDiv.insertBefore(entry, logDiv.firstChild);
|
||||
});
|
||||
es.onerror = function() {
|
||||
dot.className = 'led led-red';
|
||||
es.close();
|
||||
|
||||
Reference in New Issue
Block a user