chore: sync change
fix: detail info
This commit is contained in:
+4
-4
@@ -2,7 +2,7 @@ const BACKEND_URL = "https://rank.intcplab.cn";
|
|||||||
|
|
||||||
async function fetchScoresData(para, project, inject) {
|
async function fetchScoresData(para, project, inject) {
|
||||||
try {
|
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 data = await response.json();
|
||||||
|
|
||||||
const tableBody = document.getElementById(`${inject}`);
|
const tableBody = document.getElementById(`${inject}`);
|
||||||
@@ -45,7 +45,7 @@ function showDetailsModal(para, project, index) {
|
|||||||
const modal = document.getElementById("detailsModal");
|
const modal = document.getElementById("detailsModal");
|
||||||
const modalDetails = document.getElementById("modal-details");
|
const modalDetails = document.getElementById("modal-details");
|
||||||
console.log(para, index);
|
console.log(para, index);
|
||||||
fetch(`${BACKEND_URL}/${para}/${project}`)
|
fetch(`${BACKEND_URL}/get_scores/${project}?sort_by=${para}`)
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
modalDetails.innerHTML = data[index].details + "<br><br>";
|
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("score", "challenge_knn", "top-data-table-body");
|
||||||
window.onload = fetchScoresData("get_scores", "challenge_knn", "recent-data-table-body");
|
window.onload = fetchScoresData("time", "challenge_knn", "recent-data-table-body");
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ def sort_by_rule(data, sort_by, limit):
|
|||||||
for score in sorted_data:
|
for score in sorted_data:
|
||||||
score["running_time"] = f"{score['running_time']}ms"
|
score["running_time"] = f"{score['running_time']}ms"
|
||||||
score["time"] = score["time"].strftime("%Y-%m-%d %H:%M:%S")
|
score["time"] = score["time"].strftime("%Y-%m-%d %H:%M:%S")
|
||||||
score["details"] = ""
|
|
||||||
|
|
||||||
return sorted_data
|
return sorted_data
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user