mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-13 00:28:10 -05:00
clean up rcon, fix a bunch of little things
This commit is contained in:
@ -4,8 +4,9 @@ Routes and views for the flask application.
|
||||
|
||||
from datetime import datetime
|
||||
from flask import render_template
|
||||
from master import app
|
||||
from master import app, ctx
|
||||
from master.resources.history_graph import HistoryGraph
|
||||
from collections import defaultdict
|
||||
|
||||
@app.route('/')
|
||||
def home():
|
||||
@ -19,3 +20,16 @@ def home():
|
||||
client_count = _history_graph[0]['client_count'],
|
||||
server_count = _history_graph[0]['server_count']
|
||||
)
|
||||
|
||||
@app.route('/servers')
|
||||
def servers():
|
||||
servers = defaultdict(list)
|
||||
if len(ctx.instance_list.values()) > 0:
|
||||
ungrouped_servers = [server for instance in ctx.instance_list.values() for server in instance.servers]
|
||||
for server in ungrouped_servers:
|
||||
servers[server.game].append(server)
|
||||
return render_template(
|
||||
'serverlist.html',
|
||||
title = 'Server List',
|
||||
games = servers
|
||||
)
|
||||
|
Reference in New Issue
Block a user