mirror of
https://github.com/Coldsmiles/infstarweb.git
synced 2026-04-23 02:30:41 +08:00
feat: Add last updated timestamp to stats page and style adjustments
This commit is contained in:
@@ -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
|
||||
```
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
|
||||
<!-- Leaderboards -->
|
||||
<h2 class="section-header">排行榜</h2>
|
||||
<p class="stats-updated-at" id="stats-updated-at"></p>
|
||||
<div class="leaderboard-grid" id="leaderboard-container">
|
||||
<!-- 1. Walker -->
|
||||
<div class="lb-card gold">
|
||||
|
||||
Reference in New Issue
Block a user