chore: sync change

fix: detail info
This commit is contained in:
2024-10-11 19:57:30 +08:00
parent 3fbf010724
commit 3a3e09592e
2 changed files with 4 additions and 5 deletions
+4 -4
View File
@@ -2,7 +2,7 @@ const BACKEND_URL = "https://rank.intcplab.cn";
async function fetchScoresData(para, project, inject) {
try {
const response = await fetch(`${BACKEND_URL}/${para}/${project}`);
const response = await fetch(`${BACKEND_URL}/get_scores/${project}?sort_by=${para}`);
const data = await response.json();
const tableBody = document.getElementById(`${inject}`);
@@ -45,7 +45,7 @@ function showDetailsModal(para, project, index) {
const modal = document.getElementById("detailsModal");
const modalDetails = document.getElementById("modal-details");
console.log(para, index);
fetch(`${BACKEND_URL}/${para}/${project}`)
fetch(`${BACKEND_URL}/get_scores/${project}?sort_by=${para}`)
.then((response) => response.json())
.then((data) => {
modalDetails.innerHTML = data[index].details + "<br><br>";
@@ -53,5 +53,5 @@ function showDetailsModal(para, project, index) {
});
}
window.onload = fetchScoresData("get_top_scores", "challenge_knn", "top-data-table-body");
window.onload = fetchScoresData("get_scores", "challenge_knn", "recent-data-table-body");
window.onload = fetchScoresData("score", "challenge_knn", "top-data-table-body");
window.onload = fetchScoresData("time", "challenge_knn", "recent-data-table-body");