Add js function to show alerts when updating http functions

This commit is contained in:
Peter Stockings
2023-12-18 18:39:55 +11:00
parent 8ffdf4c28c
commit 8ad1b6bb85
3 changed files with 35 additions and 8 deletions

View File

@@ -190,10 +190,9 @@
},
body: JSON.stringify({ name, script_content, environment_info }),
})
.then(response => response.text())
.then(text => {
document.querySelector('#container').innerHTML = text
htmx.process(htmx.find('#container'))
.then(response => response.json())
.then(json => {
showAlert(json.message, json.status)
})
})
</script>