Compare commits

...

2 Commits

Author SHA1 Message Date
21234fccc6 Bump version: 1.4.0 → 1.4.1
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 1m35s
2025-07-19 09:05:40 +01:00
c62441a2d1 manual check on config page 2025-07-19 09:05:28 +01:00
4 changed files with 31 additions and 2 deletions

View File

@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "1.4.0"
current_version = "1.4.1"
commit = true
tag = true
tag_name = "{new_version}"

View File

@ -1 +1 @@
1.4.0
1.4.1

13
app.py
View File

@ -317,6 +317,19 @@ def config_dashboard():
return redirect(url_for('config'))
return render_template('config_dashboard.html')
@app.route('/check-expiring-accounts', methods=['POST'])
def check_expiring_accounts():
"""Proxies the request to check for expiring accounts to the backend."""
if not session.get("config_logged_in"):
return jsonify({'error': 'Unauthorized'}), 401
backend_url = f"{app.config['BASE_URL']}/check-expiry"
try:
response = requests.post(backend_url)
return Response(response.content, status=response.status_code, mimetype=response.headers['Content-Type'])
except requests.exceptions.RequestException as e:
return jsonify({"error": str(e)}), 502
if __name__ == "__main__":
app.run(

View File

@ -7,6 +7,7 @@
<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 %}
@ -27,5 +28,20 @@ document.getElementById('send-test-notification-btn').addEventListener('click',
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 %}