From 092935fd60669c26bb5da01552ddf4f00777ac28 Mon Sep 17 00:00:00 2001 From: zhangyuheng Date: Tue, 10 Mar 2026 11:10:10 +0800 Subject: [PATCH] feat: Add last updated timestamp to stats page and style adjustments --- README.md | 1 + css/pages/stats.css | 8 ++++++++ js/stats_script.js | 5 +++++ stats.html | 1 + 4 files changed, 15 insertions(+) diff --git a/README.md b/README.md index 980e588..e0f64ff 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,7 @@ pip install requests tqdm 源接口需要配置认证,再设置环境变量: ```bash +export STATS_BASE_URL=http://your-server/stats export STATS_USER=your_username export STATS_PASS=your_password ``` diff --git a/css/pages/stats.css b/css/pages/stats.css index e9f6362..f53c81b 100644 --- a/css/pages/stats.css +++ b/css/pages/stats.css @@ -12,6 +12,14 @@ 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 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); diff --git a/js/stats_script.js b/js/stats_script.js index 29b9ae7..2cd9f59 100644 --- a/js/stats_script.js +++ b/js/stats_script.js @@ -20,6 +20,11 @@ async function fetchStats() { const data = await response.json(); allPlayers = data.players; + // Show update time + if (data.updated_at) { + document.getElementById('stats-updated-at').textContent = '数据更新于 ' + data.updated_at; + } + // Hide loading document.getElementById('loading-indicator').style.display = 'none'; diff --git a/stats.html b/stats.html index c74dac9..7cba148 100644 --- a/stats.html +++ b/stats.html @@ -70,6 +70,7 @@

排行榜

+