Compare commits
No commits in common. "a9276f63dcdeb61c7fc4924625761eff24be1e7c" and "07dc83016073e133425a1c02e6a102533c959b3c" have entirely different histories.
a9276f63dc
...
07dc830160
@ -1,5 +1,5 @@
|
|||||||
[tool.bumpversion]
|
[tool.bumpversion]
|
||||||
current_version = "1.3.33"
|
current_version = "1.3.32"
|
||||||
commit = true
|
commit = true
|
||||||
tag = true
|
tag = true
|
||||||
tag_name = "{new_version}"
|
tag_name = "{new_version}"
|
||||||
|
19
app.py
19
app.py
@ -120,25 +120,6 @@ def proxy_save_subscription():
|
|||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
return jsonify({"error": str(e)}), 502
|
return jsonify({"error": str(e)}), 502
|
||||||
|
|
||||||
@app.route('/send-test-notification', methods=['POST'])
|
|
||||||
def proxy_send_test_notification():
|
|
||||||
"""Proxies the request to send a test notification to the backend."""
|
|
||||||
if not session.get("logged_in"):
|
|
||||||
return jsonify({'error': 'Unauthorized'}), 401
|
|
||||||
|
|
||||||
backend_url = f"{app.config['BASE_URL']}/send-test-notification"
|
|
||||||
credentials = base64.b64decode(session["auth_credentials"]).decode()
|
|
||||||
username, password = credentials.split(":", 1)
|
|
||||||
|
|
||||||
try:
|
|
||||||
response = requests.post(
|
|
||||||
backend_url,
|
|
||||||
auth=requests.auth.HTTPBasicAuth(username, password)
|
|
||||||
)
|
|
||||||
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
|
|
||||||
|
|
||||||
@app.route("/home")
|
@app.route("/home")
|
||||||
@cache.cached(timeout=60)
|
@cache.cached(timeout=60)
|
||||||
def home() -> str:
|
def home() -> str:
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer class="bg-dark text-white text-center py-3 mt-5">
|
<footer class="bg-dark text-white text-center py-3 mt-5">
|
||||||
<p>Version: <a href="#" id="version-link">{{ version }}</a></p>
|
<p>Version: {{ version }}</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
|
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
|
||||||
@ -65,15 +65,6 @@
|
|||||||
}, function(err) {
|
}, function(err) {
|
||||||
console.log('ServiceWorker registration failed: ', err);
|
console.log('ServiceWorker registration failed: ', err);
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('version-link').addEventListener('click', function(event) {
|
|
||||||
event.preventDefault();
|
|
||||||
fetch('/send-test-notification', {
|
|
||||||
method: 'POST'
|
|
||||||
}).then(response => response.json())
|
|
||||||
.then(data => console.log(data.message))
|
|
||||||
.catch(err => console.error('Error sending test notification:', err));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function askPermission(registration) {
|
function askPermission(registration) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user