47 lines
1.6 KiB
HTML
47 lines
1.6 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Config Dashboard{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container">
|
|
<h2>Configuration Dashboard</h2>
|
|
<p>Welcome to the configuration page.</p>
|
|
<button id="send-test-notification-btn" class="btn btn-primary">Send Test Notification</button>
|
|
<button id="check-expiring-accounts-btn" class="btn btn-info">Check Expiring Accounts</button>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
{{ super() }}
|
|
<script>
|
|
document.getElementById('send-test-notification-btn').addEventListener('click', function() {
|
|
fetch('{{ url_for("send_test_notification") }}', {
|
|
method: 'POST'
|
|
}).then(response => {
|
|
if (response.ok) {
|
|
alert('Test notification sent successfully!');
|
|
} else {
|
|
alert('Failed to send test notification.');
|
|
}
|
|
}).catch(err => {
|
|
console.error('Error sending test notification:', err);
|
|
alert('An error occurred while sending the test notification.');
|
|
});
|
|
});
|
|
|
|
document.getElementById('check-expiring-accounts-btn').addEventListener('click', function() {
|
|
fetch('{{ url_for("check_expiring_accounts") }}', {
|
|
method: 'POST'
|
|
}).then(response => {
|
|
if (response.ok) {
|
|
alert('Expiring accounts check triggered successfully!');
|
|
} else {
|
|
alert('Failed to trigger expiring accounts check.');
|
|
}
|
|
}).catch(err => {
|
|
console.error('Error triggering expiring accounts check:', err);
|
|
alert('An error occurred while triggering the expiring accounts check.');
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %} |