Add ability to see history of http functions invocations

This commit is contained in:
Peter Stockings
2023-12-18 20:33:58 +11:00
parent 678e978b4b
commit 6f46198693
4 changed files with 77 additions and 3 deletions

12
app.py
View File

@@ -139,6 +139,18 @@ def delete_http_function():
except Exception as e:
return jsonify({"status": 'error', "message": str(e)}), 500
@ app.route("/dashboard/http_functions/logs", methods=["GET"])
def get_http_function_logs():
name = request.args.get('name')
http_function = db.get_http_function(name)
if not http_function:
return jsonify({'error': 'Function not found'}), 404
http_function_id = http_function['id']
http_function_invocations = db.get_http_function_invocations(http_function_id)
return render_template("dashboard/http_functions/logs.html", name=name, http_function_invocations=http_function_invocations)
@ app.route("/dashboard/timer_functions", methods=["GET"])
def dashboard_timer_functions():
return render_template("dashboard/timer_functions.html")