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:
Vendored
+119
-119
File diff suppressed because one or more lines are too long
@@ -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>';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
})();
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user