implemented button for delete all expired leases

This commit is contained in:
Oscar Krause 2023-06-12 11:41:01 +02:00
parent 8d236af289
commit 16271ad00b
2 changed files with 9 additions and 0 deletions

View File

@ -125,3 +125,9 @@ async function deleteLease(lease_ref) {
xhr.open("DELETE", `/-/lease/${lease_ref}`, true);
xhr.send();
}
async function deleteExpiredLeases() {
let xhr = new XMLHttpRequest();
xhr.open("DELETE", `/-/leases/expired`, true);
xhr.send();
}

View File

@ -13,6 +13,9 @@
<button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteLease().finally(() => load())">
delete lease
</button>
<button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteExpiredLeases().finally(() => load())">
delete all expired leases
</button>
</div>
<button type="button" class="btn btn-sm btn-outline-secondary" onclick="load()" title="refresh">