KTVManager_UI/templates/config_dashboard.html

76 lines
2.8 KiB
HTML
Raw Normal View History

2025-07-19 08:56:13 +01:00
{% 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>
2025-07-19 09:05:28 +01:00
<button id="check-expiring-accounts-btn" class="btn btn-info">Check Expiring Accounts</button>
2025-07-19 09:16:15 +01:00
<div class="card mt-4">
<div class="card-header">
DNS Manager
</div>
<div class="card-body">
<form action="{{ url_for('dns.add_dns') }}" method="post">
<div class="input-group mb-3">
<input type="text" class="form-control" name="dns_entry" placeholder="Enter DNS entry">
<div class="input-group-append">
<button class="btn btn-primary" type="submit">Add</button>
</div>
</div>
</form>
</div>
<ul class="list-group list-group-flush">
{% for entry in dns_list %}
<li class="list-group-item d-flex justify-content-between align-items-center">
{{ entry }}
<form action="{{ url_for('dns.remove_dns') }}" method="post" style="display: inline;">
<input type="hidden" name="dns_entry" value="{{ entry }}">
<button type="submit" class="btn btn-danger btn-sm">Remove</button>
</form>
</li>
{% else %}
<li class="list-group-item">No DNS entries found.</li>
{% endfor %}
</ul>
</div>
2025-07-19 08:56:13 +01:00
</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.');
});
});
2025-07-19 09:05:28 +01:00
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.');
});
});
2025-07-19 08:56:13 +01:00
</script>
{% endblock %}