Expose openContainerLogsModal function for service card buttons

- Added window.openContainerLogsModal(containerId, containerName) function
- Service cards (grid.js) already call this when clicking the 📋 logs button
- Modal now pre-selects the correct container when called from a card
- Rebuilt dist files
This commit is contained in:
Krystie
2026-05-15 01:51:51 -07:00
parent c50b106faf
commit 0cec447bf1
2 changed files with 145 additions and 119 deletions
+119 -119
View File
File diff suppressed because one or more lines are too long
+26
View File
@@ -400,4 +400,30 @@
// Wire modal (close on backdrop click) // Wire modal (close on backdrop click)
wireModal(modal, null, closeModal); wireModal(modal, null, closeModal);
// Expose for use by service card buttons (grid.js calls openContainerLogsModal)
window.openContainerLogsModal = function(containerId, containerName) {
modal.classList.add('show');
loadContainers().then(() => {
// Try to find and select the container
const option = Array.from(containerSelect.options).find(opt =>
opt.value === containerId || opt.dataset.name === containerName
);
if (option) {
containerSelect.value = option.value;
loadContainerInfo(option.value);
loadLogs();
} else if (containerId) {
// If container not found in list but we have an ID, try loading directly
currentContainerId = containerId;
imageEl.textContent = containerName || containerId;
statusEl.textContent = '-';
createdEl.textContent = '-';
loadLogs();
} else {
// No container ID, just show modal with container list
logContent.innerHTML = '<div class="logs-loading" style="color: var(--muted); text-align: center; padding: 40px;">Select a container to view logs</div>';
}
});
};
})(); })();