servername,captca,timestamp,reserve resources
This commit is contained in:
@@ -14,12 +14,16 @@ dashboard = Blueprint('dashboard', __name__)
|
||||
def index():
|
||||
conn = get_db()
|
||||
rows = conn.execute('''
|
||||
SELECT player, player_id, MAX(updated_at) as last_seen
|
||||
SELECT player, player_id, MAX(updated_at) as last_seen, MAX(world_id) as world_id
|
||||
FROM town_state
|
||||
WHERE player IS NOT NULL
|
||||
GROUP BY player, player_id
|
||||
ORDER BY player ASC
|
||||
''').fetchall()
|
||||
|
||||
# Pre-fetch all active captchas
|
||||
captcha_rows = conn.execute("SELECT key, value FROM kv_store WHERE key LIKE 'captcha_active_%'").fetchall()
|
||||
active_captchas = {r['key'].replace('captcha_active_', ''): True for r in captcha_rows if r['value'] == '1'}
|
||||
conn.close()
|
||||
|
||||
players = []
|
||||
@@ -37,7 +41,9 @@ def index():
|
||||
players.append({
|
||||
'player': r['player'],
|
||||
'player_id': r['player_id'],
|
||||
'is_online': is_online
|
||||
'world_id': r['world_id'] or 'Unknown',
|
||||
'is_online': is_online,
|
||||
'captcha_active': active_captchas.get(r['player_id'], False)
|
||||
})
|
||||
|
||||
return render_template('index.html', players=players)
|
||||
|
||||
Reference in New Issue
Block a user