Refactor server data handling to use new API response structure and update UI components accordingly
Some checks failed
CI - Build and Push / Build and Push Docker Image (push) Failing after 14s

This commit is contained in:
2025-10-06 18:35:36 +08:00
parent 3dd30bb53f
commit ec5ea81b87
2 changed files with 40 additions and 82 deletions

View File

@@ -238,7 +238,7 @@ function Servers() {
fontSize: '0.9rem',
color: 'var(--text-secondary)'
}}>
<span>🗺 {server.a2sData?.mapName || 'Loading...'}</span>
<span>🗺 {server.mapName || 'Loading...'}</span>
<span></span>
<span>{server.category}</span>
</div>
@@ -264,7 +264,7 @@ function Servers() {
fontWeight: 'bold',
color: 'var(--text-primary)'
}}>
{server.a2sData ? `${server.a2sData.playerCount - server.a2sData.botCount}/${server.a2sData.maxPlayers}` : 'Loading...'}
{server.status === 'online' ? `${server.playerCount - server.botCount}/${server.maxPlayers}` : 'Loading...'}
</div>
</div>
<div>
@@ -380,7 +380,7 @@ function Servers() {
color: 'var(--accent-primary)',
marginBottom: '0.5rem'
}}>
{servers.reduce((sum, s) => sum + (s.a2sData ? (s.a2sData.playerCount - s.a2sData.botCount) : 0), 0)}
{servers.reduce((sum, s) => sum + (s.status === 'online' ? (s.playerCount - s.botCount) : 0), 0)}
</div>
<div style={{
color: 'var(--text-secondary)',