Add ability to add new http functions (Needs refactor, bad stuff)
This commit is contained in:
13
app.py
13
app.py
@@ -81,6 +81,19 @@ def dashboard_http_functions():
|
||||
http_functions = create_http_functions_view_model(http_functions)
|
||||
return render_template("dashboard/http_functions.html", http_functions=http_functions)
|
||||
|
||||
@ app.route("/dashboard/http_functions/add_form", methods=["GET"])
|
||||
def get_http_function_add_form():
|
||||
script=DEFAULT_SCRIPT
|
||||
name = "foo"
|
||||
return render_template("dashboard/http_functions/new.html", name=name, script=script)
|
||||
|
||||
@ app.route("/dashboard/http_functions/create", methods=["POST"])
|
||||
def create_http_function():
|
||||
name = request.json.get('name')
|
||||
script_content = request.json.get('script_content')
|
||||
db.create_new_http_function(name, script_content)
|
||||
return render_template("dashboard/http_functions/new.html", name=name, script=script_content)
|
||||
|
||||
@ app.route("/dashboard/timer_functions", methods=["GET"])
|
||||
def dashboard_timer_functions():
|
||||
return render_template("dashboard/timer_functions.html")
|
||||
|
||||
Reference in New Issue
Block a user