feat: add refresh button to RANK.html
This commit is contained in:
@@ -19,14 +19,17 @@
|
||||
|
||||
<h1 id="挑战赛数据展示">挑战赛数据展示 </h1>
|
||||
<p>该页面展示<strong>得分前五名</strong>和<strong>最近三十次提交成功</strong>的数据(包括<strong>零分</strong>)。</p>
|
||||
<p>数据非实时刷新,可能有最长<strong>五分钟</strong>的延迟。</p>
|
||||
<p>返回榜单数据非实时刷新,可能有最长<strong>五分钟</strong>的延迟。</p>
|
||||
<p>详细日志信息点击「查看详情」即可查看。</p>
|
||||
<h2 id="榜单选择">榜单选择 </h2>
|
||||
<h2 id="榜单选项">榜单选项 </h2>
|
||||
<p>当前展示 <select id="projectSelect">
|
||||
<option value="challenge_knn">KNN 挑战赛</option>
|
||||
<option value="challenge_knn" selected="">KNN 挑战赛</option>
|
||||
<option value="challenge_svm">SVM 挑战赛</option>
|
||||
</select> 榜单
|
||||
</p><h2 id="前十名排行榜">前十名排行榜 </h2>
|
||||
</p><hr>
|
||||
<p>点击 <button id="refreshBtn">刷新</button> 按钮即可刷新页面榜单数据。</p>
|
||||
<p>注意,仍可能存在最长<strong>五分钟</strong>延迟,该按钮仅仅用于<strong>重载</strong>页面数据!</p>
|
||||
<h2 id="前十名排行榜">前十名排行榜 </h2>
|
||||
<p>这里展示<strong>得分前十名</strong>的数据。</p>
|
||||
<p>以得分排序,分数高的靠前,若分数相同,则运行时间短的靠前。</p>
|
||||
<hr>
|
||||
|
||||
@@ -2,17 +2,24 @@
|
||||
|
||||
该页面展示**得分前五名**和**最近三十次提交成功**的数据(包括**零分**)。
|
||||
|
||||
数据非实时刷新,可能有最长**五分钟**的延迟。
|
||||
返回榜单数据非实时刷新,可能有最长**五分钟**的延迟。
|
||||
|
||||
详细日志信息点击「查看详情」即可查看。
|
||||
|
||||
## 榜单选择
|
||||
## 榜单选项
|
||||
|
||||
当前展示 <select id="projectSelect">
|
||||
<option value="challenge_knn">KNN 挑战赛</option>
|
||||
|
||||
<option value="challenge_knn" selected>KNN 挑战赛</option>
|
||||
<option value="challenge_svm">SVM 挑战赛</option>
|
||||
</select> 榜单
|
||||
|
||||
---
|
||||
|
||||
点击 <button id="refreshBtn">刷新</button> 按钮即可刷新页面榜单数据。
|
||||
|
||||
注意,仍可能存在最长**五分钟**延迟,该按钮仅仅用于**重载**页面数据!
|
||||
|
||||
## 前十名排行榜
|
||||
|
||||
这里展示**得分前十名**的数据。
|
||||
|
||||
+9
-2
@@ -72,7 +72,7 @@ window.onload = () => {
|
||||
// 获取记忆的选择
|
||||
const savedProject = localStorage.getItem("selectedProject") || "challenge_knn";
|
||||
document.getElementById("projectSelect").value = savedProject;
|
||||
|
||||
|
||||
fetchScoresData("score", savedProject, "top-data-table-body");
|
||||
fetchScoresData("time", savedProject, "recent-data-table-body");
|
||||
};
|
||||
@@ -80,7 +80,7 @@ window.onload = () => {
|
||||
// 监听下拉框
|
||||
document.getElementById("projectSelect").addEventListener("change", function () {
|
||||
const selectedProject = this.value;
|
||||
|
||||
|
||||
// 保存选择到 localStorage
|
||||
localStorage.setItem("selectedProject", selectedProject);
|
||||
|
||||
@@ -88,3 +88,10 @@ document.getElementById("projectSelect").addEventListener("change", function ()
|
||||
fetchScoresData("score", selectedProject, "top-data-table-body");
|
||||
fetchScoresData("time", selectedProject, "recent-data-table-body");
|
||||
});
|
||||
|
||||
// 刷新按钮
|
||||
document.getElementById("refreshBtn").addEventListener("click", function () {
|
||||
const selectedProject = document.getElementById("projectSelect").value;
|
||||
fetchScoresData("score", selectedProject, "top-data-table-body");
|
||||
fetchScoresData("time", selectedProject, "recent-data-table-body");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user