mirror of
https://gitea.publichub.eu/oscar.krause/fastapi-dls.git
synced 2024-11-23 06:48:50 +00:00
fixed refreshing data after deleting some origin or lease
This commit is contained in:
parent
08440d242f
commit
5035dd4947
@ -102,7 +102,6 @@ async function deleteOrigins() {
|
|||||||
let xhr = new XMLHttpRequest();
|
let xhr = new XMLHttpRequest();
|
||||||
xhr.open("DELETE", '/-/origins', true);
|
xhr.open("DELETE", '/-/origins', true);
|
||||||
xhr.send();
|
xhr.send();
|
||||||
await fetchOriginsWithLeases()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteOrigin(origin_ref) {
|
async function deleteOrigin(origin_ref) {
|
||||||
|
@ -10,7 +10,9 @@
|
|||||||
<h1 class="h2">Leases <small>with origin</small></h1>
|
<h1 class="h2">Leases <small>with origin</small></h1>
|
||||||
<div class="btn-toolbar mb-2 mb-md-0">
|
<div class="btn-toolbar mb-2 mb-md-0">
|
||||||
<div class="btn-group me-2">
|
<div class="btn-group me-2">
|
||||||
<button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteLease();load();">delete lease</button>
|
<button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteLease().finally(() => load())">
|
||||||
|
delete lease
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,7 +10,12 @@
|
|||||||
<h1 class="h2">Origins <small>with leases</small></h1>
|
<h1 class="h2">Origins <small>with leases</small></h1>
|
||||||
<div class="btn-toolbar mb-2 mb-md-0">
|
<div class="btn-toolbar mb-2 mb-md-0">
|
||||||
<div class="btn-group me-2">
|
<div class="btn-group me-2">
|
||||||
<button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteOrigins()">delete all</button>
|
<button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteOrigin().finally(() => load())">
|
||||||
|
delete origin
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteOrigins().finally(() => load())">
|
||||||
|
delete all
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -22,7 +27,11 @@
|
|||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
|
function load() {
|
||||||
const origins = document.getElementById('origins')
|
const origins = document.getElementById('origins')
|
||||||
fetchOriginsWithLeases(origins)
|
fetchOriginsWithLeases(origins)
|
||||||
|
}
|
||||||
|
|
||||||
|
load()
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user