Compare commits

..

No commits in common. "21234fccc642c0bf0f4aa861db6ec9eb2561be0a" and "d519a268a008858453069e921ee7d8266e220156" have entirely different histories.

4 changed files with 2 additions and 31 deletions

View File

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

View File

@ -1 +1 @@
1.4.1 1.4.0

13
app.py
View File

@ -317,19 +317,6 @@ def config_dashboard():
return redirect(url_for('config')) return redirect(url_for('config'))
return render_template('config_dashboard.html') 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__": if __name__ == "__main__":
app.run( app.run(

View File

@ -7,7 +7,6 @@
<h2>Configuration Dashboard</h2> <h2>Configuration Dashboard</h2>
<p>Welcome to the configuration page.</p> <p>Welcome to the configuration page.</p>
<button id="send-test-notification-btn" class="btn btn-primary">Send Test Notification</button> <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> </div>
{% endblock %} {% endblock %}
@ -28,20 +27,5 @@ document.getElementById('send-test-notification-btn').addEventListener('click',
alert('An error occurred while sending the test notification.'); 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> </script>
{% endblock %} {% endblock %}