Add syntax highlighting for different runtimes in function history for timer & http functions
This commit is contained in:
@@ -316,7 +316,7 @@ def history(function_id):
|
||||
# Fetch the http function to verify ownership
|
||||
http_function = db.execute(
|
||||
"""
|
||||
SELECT id, name, script_content AS code, version_number
|
||||
SELECT id, name, script_content AS code, version_number, runtime
|
||||
FROM http_functions
|
||||
WHERE id = %s AND user_id = %s
|
||||
""",
|
||||
@@ -350,6 +350,7 @@ def history(function_id):
|
||||
"function_id": function_id,
|
||||
"http_function": http_function,
|
||||
"versions": versions,
|
||||
"runtime": http_function.get("runtime", "node"),
|
||||
}
|
||||
|
||||
if htmx:
|
||||
@@ -359,6 +360,7 @@ def history(function_id):
|
||||
return render_template("dashboard/http_functions/history.html", **args)
|
||||
|
||||
|
||||
|
||||
@http.route("/editor/<int:function_id>", methods=["GET"])
|
||||
@login_required
|
||||
def editor(function_id):
|
||||
|
||||
@@ -561,7 +561,7 @@ def logs(function_id):
|
||||
def history(function_id):
|
||||
# Fetch the timer function to verify ownership
|
||||
timer_function = db.execute("""
|
||||
SELECT id, name, code AS script, version_number
|
||||
SELECT id, name, code AS script, version_number, runtime
|
||||
FROM timer_functions
|
||||
WHERE id = %s AND user_id = %s
|
||||
""", [function_id, current_user.id], one=True)
|
||||
@@ -587,7 +587,8 @@ def history(function_id):
|
||||
'function_id': function_id,
|
||||
'timer_function': timer_function,
|
||||
'versions': versions,
|
||||
'title': timer_function['name']
|
||||
'title': timer_function['name'],
|
||||
'runtime': timer_function.get('runtime', 'node'),
|
||||
}
|
||||
|
||||
if htmx:
|
||||
|
||||
Reference in New Issue
Block a user