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
|
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__":
|
if __name__ == "__main__":
|
||||||
app.run(
|
app.run(
|
||||||
host="0.0.0.0",
|
host="0.0.0.0",
|
||||||
|
|
|
@ -22,8 +22,13 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Nome</th>
|
<th>Nome</th>
|
||||||
|
<th>
|
||||||
|
<a href="/kill">kill</a>
|
||||||
|
</th>
|
||||||
<!-- {% for header in headers %} -->
|
<!-- {% for header in headers %} -->
|
||||||
<!-- <th>{{ header }}</th> -->
|
<th>
|
||||||
|
{{ header }}
|
||||||
|
</th>
|
||||||
<!-- {% endfor %} -->
|
<!-- {% endfor %} -->
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -31,7 +36,9 @@
|
||||||
{% for file in files %}
|
{% for file in files %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ file }}</td>
|
<td>{{ file }}</td>
|
||||||
<td><a href="/run/{{ file }}">run</a></td>
|
<td>
|
||||||
|
<a href="/run/{{ file }}">run</a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user