main
Bryan Cerrati 2025-06-19 14:59:45 -04:00
parent c0498b96db
commit 3cb2708704
4 changed files with 18 additions and 14 deletions

Binary file not shown.

View File

@ -58,3 +58,11 @@ def getalive(location):
@keep.route('/loc/<location>/', methods=["GET"])
def show_location(location):
return f"<h1>Received keepalive from: {location}</h1>"
@keep.route('/delete/<int:item_id>/', methods=["POST"])
def delete_keepalive(item_id):
conn = get_db()
c = conn.cursor()
c.execute("DELETE FROM keepalive2 WHERE id = ?", (item_id,))
conn.commit()
return redirect(url_for('keep.dispkeepalive'))

View File

@ -1,7 +1,6 @@
{% extends 'keepbase.html' %}
{% block content %}
{% if items %}
<table class="table">
<thead class="thead-light">
@ -9,24 +8,25 @@
<th scope="col">Location</th>
<th scope="col">Date</th>
<th scope="col">Time</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody>
{% for item in items %}
<tr>
<td>{{ item.location }}</td>
<td>{{ item.date }}</td>
<td>{{ item.time }}</td>
<td>
<form method="POST" action="{{ url_for('keep.delete_keepalive', item_id=item.id) }}" onsubmit="return confirm('Are you sure?');">
<button type="submit" class="btn btn-danger btn-sm">X</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<h1 class="offset-lg-3">No items to show.</h1>
{% endif %}
</tbody>
</table>
{% endblock %}

View File

@ -1,4 +0,0 @@
$CurlArgument = '-X', 'POST',
'http://24.185.75.128:8889/bay/'
$CURLEXE = 'C:\Program Files\Git\mingw64\bin\curl.exe'
& $CURLEXE @CurlArgument