openpanel/templates/tabler/emails/mailserver_is_stopped.html

44 lines
1.6 KiB
HTML

<div class="page page-center">
<div class="container-tight py-4">
<div class="empty">
<div class="empty-header">MailServer is not running</div>
<p class="empty-title">Mailserver is currently stopped.</p>
<p class="d-none empty-subtitle text-secondary">
</p>
<div class="empty-action">
<a href="/service/start/openadmin_mailserver" id="start_mailserver" class="btn btn-primary>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-player-play"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 4v16l13 -8z" /></svg>
Click to start mailserver
</a>
</div>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const startMailServerButton = document.getElementById('start_mailserver');
startMailServerButton.addEventListener('click', (event) => {
event.preventDefault(); // Prevent the default link behavior
fetch(startMailServerButton.href, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
})
.then(response => {
if (response.ok) {
window.location.reload();
} else {
console.error('Failed to start mail server:', response.statusText);
}
})
.catch(error => {
console.error('Error during AJAX request:', error);
});
});
});
</script>