Fix terminal

This commit is contained in:
Raven Scott
2025-11-24 08:42:46 -05:00
parent 8e4738b903
commit 8a15468124
4 changed files with 247 additions and 164 deletions
+18 -1
View File
@@ -24,8 +24,19 @@ function closeAllModals() {
const modals = document.querySelectorAll('.modal.show');
modals.forEach(modal => {
const modalInstance = bootstrap.Modal.getInstance(modal);
modalInstance.hide();
if (modalInstance) {
modalInstance.hide();
} else {
// If no instance exists, create one and hide it
const newInstance = new bootstrap.Modal(modal);
newInstance.hide();
}
});
// Also explicitly close the deploy modal if it exists
if (templateDeployModal) {
templateDeployModal.hide();
}
}
// Show status indicator
@@ -703,7 +714,13 @@ deployForm.addEventListener('submit', async (e) => {
showStatusIndicator('Deploying container...');
const successResponse = await deployDockerContainer(formData);
hideStatusIndicator();
// Close all modals including the deploy modal
closeAllModals();
if (templateDeployModal) {
templateDeployModal.hide();
}
showAlert('success', successResponse.message || 'Container deployed successfully!');
} catch (error) {
console.error('[ERROR] Failed to deploy container:', error.message);