feat: Add last updated timestamp to stats page and style adjustments

This commit is contained in:
zhangyuheng
2026-03-10 11:10:10 +08:00
parent 5265bcc019
commit 092935fd60
4 changed files with 15 additions and 0 deletions

View File

@@ -159,6 +159,7 @@ pip install requests tqdm
源接口需要配置认证,再设置环境变量: 源接口需要配置认证,再设置环境变量:
```bash ```bash
export STATS_BASE_URL=http://your-server/stats
export STATS_USER=your_username export STATS_USER=your_username
export STATS_PASS=your_password export STATS_PASS=your_password
``` ```

View File

@@ -12,6 +12,14 @@
background: var(--bg-color); background: var(--bg-color);
} }
.stats-updated-at {
text-align: center;
color: var(--text-secondary);
font-size: 14px;
margin-top: -45px;
margin-bottom: 40px;
}
.stats-grid { .stats-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));

View File

@@ -20,6 +20,11 @@ async function fetchStats() {
const data = await response.json(); const data = await response.json();
allPlayers = data.players; allPlayers = data.players;
// Show update time
if (data.updated_at) {
document.getElementById('stats-updated-at').textContent = '数据更新于 ' + data.updated_at;
}
// Hide loading // Hide loading
document.getElementById('loading-indicator').style.display = 'none'; document.getElementById('loading-indicator').style.display = 'none';

View File

@@ -70,6 +70,7 @@
<!-- Leaderboards --> <!-- Leaderboards -->
<h2 class="section-header">排行榜</h2> <h2 class="section-header">排行榜</h2>
<p class="stats-updated-at" id="stats-updated-at"></p>
<div class="leaderboard-grid" id="leaderboard-container"> <div class="leaderboard-grid" id="leaderboard-container">
<!-- 1. Walker --> <!-- 1. Walker -->
<div class="lb-card gold"> <div class="lb-card gold">