implemented button for delete all expired leases

This commit is contained in:
Oscar Krause 2023-06-12 11:41:01 +02:00
parent 77dd0922d8
commit 0e39f1849b
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.open("DELETE", `/-/lease/${lease_ref}`, true);
xhr.send(); 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())"> <button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteLease().finally(() => load())">
delete lease delete lease
</button> </button>
<button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteExpiredLeases().finally(() => load())">
delete all expired leases
</button>
</div> </div>
<button type="button" class="btn btn-sm btn-outline-secondary" onclick="load()" title="refresh"> <button type="button" class="btn btn-sm btn-outline-secondary" onclick="load()" title="refresh">