mirror of
https://git.collinwebdesigns.de/oscar.krause/fastapi-dls.git
synced 2024-11-23 23:41:06 +03:00
main.py - added confirmation to deleteOrigins()
This commit is contained in:
parent
02fccb3605
commit
aecad82914
@ -115,15 +115,19 @@ async def _manage(request: Request):
|
|||||||
<title>FastAPI-DLS Management</title>
|
<title>FastAPI-DLS Management</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<button onclick="deleteOrigins()">delete origins and their leases</button>
|
<button onclick="deleteOrigins()">delete ALL origins and their leases</button>
|
||||||
<button onclick="deleteLease()">delete specific lease</button>
|
<button onclick="deleteLease()">delete specific lease</button>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function deleteOrigins() {
|
function deleteOrigins() {
|
||||||
|
const response = confirm('Are you sure you want to delete all origins and their leases?');
|
||||||
|
|
||||||
|
if (response) {
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open("DELETE", '/-/origins', true);
|
xhr.open("DELETE", '/-/origins', true);
|
||||||
xhr.send();
|
xhr.send();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
function deleteLease(lease_ref) {
|
function deleteLease(lease_ref) {
|
||||||
if(lease_ref === undefined)
|
if(lease_ref === undefined)
|
||||||
lease_ref = window.prompt("Please enter 'lease_ref' which should be deleted");
|
lease_ref = window.prompt("Please enter 'lease_ref' which should be deleted");
|
||||||
|
Loading…
Reference in New Issue
Block a user