mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
update /check and setup html
This commit is contained in:
parent
671a0829fa
commit
122b64c2d4
2 changed files with 14 additions and 2 deletions
|
|
@ -446,7 +446,7 @@ def check():
|
|||
if "Origin" not in request.headers:
|
||||
return Response(status=403)
|
||||
|
||||
return Response(status=200, headers={"Access-Control-Allow-Origin": "*"})
|
||||
return Response(status=200, headers={"Access-Control-Allow-Origin": "*"}, response=dumps({"message": "ok"}), content_type="application/json")
|
||||
|
||||
|
||||
@app.route("/setup", methods=["GET", "POST"])
|
||||
|
|
|
|||
14
src/ui/templates/setup.html
vendored
14
src/ui/templates/setup.html
vendored
|
|
@ -348,7 +348,19 @@
|
|||
}://${this.servInp.value}/setup/check`;
|
||||
fetch(api)
|
||||
.then((res) => {
|
||||
this.updateCheck("success");
|
||||
// check if status 200 and body = {"message" : "ok"}
|
||||
if (res.status === 200) {
|
||||
return res.json();
|
||||
} else {
|
||||
this.updateCheck("error");
|
||||
}
|
||||
}).then(res => {
|
||||
// check message
|
||||
if (res.message === "ok") {
|
||||
this.updateCheck("success");
|
||||
} else {
|
||||
this.updateCheck("error");
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
this.updateCheck("error");
|
||||
|
|
|
|||
Loading…
Reference in a new issue