diff --git a/app.py b/app.py index 48db41e..9d3146f 100644 --- a/app.py +++ b/app.py @@ -108,6 +108,15 @@ def run(cassetta: str): return response +@app.route("/kill", methods=["GET"]) +def kill(): + check_call(["pkill", "aplay"]) + + response = make_response(make_response("", 302)) + response.headers["Location"] = "/" + return response + + if __name__ == "__main__": app.run( host="0.0.0.0", diff --git a/templates/upload.html b/templates/upload.html index 47c513c..1bd5deb 100644 --- a/templates/upload.html +++ b/templates/upload.html @@ -22,8 +22,13 @@ Nome + + kill + - + + {{ header }} + @@ -31,7 +36,9 @@ {% for file in files %} {{ file }} - run + + run + {% endfor %}