Delete
parent
c0498b96db
commit
3cb2708704
Binary file not shown.
10
app/keep.py
10
app/keep.py
|
|
@ -57,4 +57,12 @@ def getalive(location):
|
||||||
|
|
||||||
@keep.route('/loc/<location>/', methods=["GET"])
|
@keep.route('/loc/<location>/', methods=["GET"])
|
||||||
def show_location(location):
|
def show_location(location):
|
||||||
return f"<h1>Received keepalive from: {location}</h1>"
|
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'))
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{% extends 'keepbase.html' %}
|
{% extends 'keepbase.html' %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
{% if items %}
|
{% if items %}
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
|
|
@ -9,24 +8,25 @@
|
||||||
<th scope="col">Location</th>
|
<th scope="col">Location</th>
|
||||||
<th scope="col">Date</th>
|
<th scope="col">Date</th>
|
||||||
<th scope="col">Time</th>
|
<th scope="col">Time</th>
|
||||||
|
<th scope="col">Delete</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
{% for item in items %}
|
{% for item in items %}
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td>{{ item.location }}</td>
|
<td>{{ item.location }}</td>
|
||||||
<td>{{ item.date }}</td>
|
<td>{{ item.date }}</td>
|
||||||
<td>{{ item.time }}</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>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
{% else %}
|
{% else %}
|
||||||
<h1 class="offset-lg-3">No items to show.</h1>
|
<h1 class="offset-lg-3">No items to show.</h1>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
Loading…
Reference in New Issue