Update static/index.html
Browse files- static/index.html +0 -5
static/index.html
CHANGED
|
@@ -126,13 +126,10 @@
|
|
| 126 |
const age = parseInt(document.getElementById("age").value);
|
| 127 |
const sex = document.getElementById("sex").value;
|
| 128 |
const report = document.getElementById("report").value;
|
| 129 |
-
|
| 130 |
const loadingDiv = document.getElementById("loading");
|
| 131 |
const spinner = document.getElementById("spinner");
|
| 132 |
-
|
| 133 |
loadingDiv.classList.remove("d-none");
|
| 134 |
spinner.classList.remove("d-none");
|
| 135 |
-
|
| 136 |
try {
|
| 137 |
const response = await fetch("http://localhost:8000/inbody", {
|
| 138 |
method: "POST",
|
|
@@ -141,9 +138,7 @@
|
|
| 141 |
},
|
| 142 |
body: JSON.stringify({ name, age, sex, report })
|
| 143 |
});
|
| 144 |
-
|
| 145 |
const result = await response.json();
|
| 146 |
-
|
| 147 |
document.getElementById("analysis").textContent = result.analysis;
|
| 148 |
document.getElementById("training").textContent = result.training_plan;
|
| 149 |
document.getElementById("nutrition").textContent = result.nutrition_plan;
|
|
|
|
| 126 |
const age = parseInt(document.getElementById("age").value);
|
| 127 |
const sex = document.getElementById("sex").value;
|
| 128 |
const report = document.getElementById("report").value;
|
|
|
|
| 129 |
const loadingDiv = document.getElementById("loading");
|
| 130 |
const spinner = document.getElementById("spinner");
|
|
|
|
| 131 |
loadingDiv.classList.remove("d-none");
|
| 132 |
spinner.classList.remove("d-none");
|
|
|
|
| 133 |
try {
|
| 134 |
const response = await fetch("http://localhost:8000/inbody", {
|
| 135 |
method: "POST",
|
|
|
|
| 138 |
},
|
| 139 |
body: JSON.stringify({ name, age, sex, report })
|
| 140 |
});
|
|
|
|
| 141 |
const result = await response.json();
|
|
|
|
| 142 |
document.getElementById("analysis").textContent = result.analysis;
|
| 143 |
document.getElementById("training").textContent = result.training_plan;
|
| 144 |
document.getElementById("nutrition").textContent = result.nutrition_plan;
|