First cut of user admin page (#19)

This commit is contained in:
2022-07-19 22:51:51 -04:00
parent 1e987fdf72
commit 41ae1d8dad
17 changed files with 605 additions and 464 deletions

View File

@@ -334,13 +334,10 @@ htmx.on("htmx:afterOnLoad", function (evt) {
})
htmx.on("htmx:responseError", function (evt) {
/** @type {XMLHttpRequest} */
const xhr = evt.detail.xhr
const hdrs = xhr.getAllResponseHeaders()
// Show messages if there were any in the response
if (hdrs.indexOf("x-message") >= 0) {
Admin.showMessage(evt.detail.xhr.getResponseHeader("x-message"))
} else {
// Show an error message if there were none in the response
if (hdrs.indexOf("x-message") < 0) {
Admin.showMessage(`danger|||${xhr.status}: ${xhr.statusText}`)
}
})