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
|
```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
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -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));
|
||||||
|
|||||||
@@ -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';
|
||||||
|
|
||||||
|
|||||||
@@ -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">
|
||||||
|
|||||||
Reference in New Issue
Block a user