add kill endpoint
This commit is contained in:
parent
504a5a979f
commit
66bad99a4e
9
app.py
9
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",
|
||||
|
|
|
@ -22,8 +22,13 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>Nome</th>
|
||||
<th>
|
||||
<a href="/kill">kill</a>
|
||||
</th>
|
||||
<!-- {% for header in headers %} -->
|
||||
<!-- <th>{{ header }}</th> -->
|
||||
<th>
|
||||
{{ header }}
|
||||
</th>
|
||||
<!-- {% endfor %} -->
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -31,7 +36,9 @@
|
|||
{% for file in files %}
|
||||
<tr>
|
||||
<td>{{ file }}</td>
|
||||
<td><a href="/run/{{ file }}">run</a></td>
|
||||
<td>
|
||||
<a href="/run/{{ file }}">run</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
Loading…
Reference in New Issue
Block a user