Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
|
@@ -131,75 +131,78 @@ async def websocket_endpoint(websocket: WebSocket, elo: str):
|
|
| 131 |
|
| 132 |
@app.get("/")
|
| 133 |
async def root(request: Request):
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
<
|
| 137 |
-
<
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
</
|
| 187 |
-
|
| 188 |
-
<
|
| 189 |
-
<
|
| 190 |
-
|
| 191 |
-
<
|
| 192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
</div>
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
<label>Maia Users:</label>
|
| 200 |
-
<span id="maia-users">""" + user_playing["maia"] + """</span>
|
| 201 |
-
</div>
|
| 202 |
-
</div>
|
| 203 |
-
</body>
|
| 204 |
-
</html>
|
| 205 |
-
""")
|
|
|
|
| 131 |
|
| 132 |
@app.get("/")
|
| 133 |
async def root(request: Request):
|
| 134 |
+
html_content = """
|
| 135 |
+
<!DOCTYPE html>
|
| 136 |
+
<html lang="en">
|
| 137 |
+
<head>
|
| 138 |
+
<meta charset="UTF-8">
|
| 139 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 140 |
+
<title>Users playing now</title>
|
| 141 |
+
<style>
|
| 142 |
+
body {
|
| 143 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| 144 |
+
background-color: #1f1f1f;
|
| 145 |
+
color: #f0f0f0;
|
| 146 |
+
margin: 0;
|
| 147 |
+
padding: 0;
|
| 148 |
+
display: flex;
|
| 149 |
+
justify-content: center;
|
| 150 |
+
align-items: center;
|
| 151 |
+
height: 100vh;
|
| 152 |
+
text-align: center;
|
| 153 |
+
}
|
| 154 |
+
.container {
|
| 155 |
+
background-color: #2d2d2d;
|
| 156 |
+
padding: 20px;
|
| 157 |
+
border-radius: 10px;
|
| 158 |
+
box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
|
| 159 |
+
max-width: 400px;
|
| 160 |
+
width: 100%;
|
| 161 |
+
margin: 20px;
|
| 162 |
+
}
|
| 163 |
+
h1 {
|
| 164 |
+
color: #f0f0f0;
|
| 165 |
+
font-size: 2.5rem;
|
| 166 |
+
margin-bottom: 20px;
|
| 167 |
+
}
|
| 168 |
+
.stat {
|
| 169 |
+
margin-bottom: 10px;
|
| 170 |
+
display: flex;
|
| 171 |
+
justify-content: space-between;
|
| 172 |
+
align-items: center;
|
| 173 |
+
padding: 10px;
|
| 174 |
+
border-bottom: 1px solid #444;
|
| 175 |
+
}
|
| 176 |
+
.stat:last-child {
|
| 177 |
+
border-bottom: none;
|
| 178 |
+
}
|
| 179 |
+
.stat label {
|
| 180 |
+
font-weight: bold;
|
| 181 |
+
font-size: 1.2rem;
|
| 182 |
+
}
|
| 183 |
+
.stat span {
|
| 184 |
+
font-size: 1.2rem;
|
| 185 |
+
}
|
| 186 |
+
</style>
|
| 187 |
+
</head>
|
| 188 |
+
<body>
|
| 189 |
+
<div class="container">
|
| 190 |
+
<h1>Users playing now</h1>
|
| 191 |
+
<div class="stat">
|
| 192 |
+
<label>Total Users:</label>
|
| 193 |
+
<span id="total-users">{}</span>
|
| 194 |
+
</div>
|
| 195 |
+
<div class="stat">
|
| 196 |
+
<label>Stockfish Users:</label>
|
| 197 |
+
<span id="stockfish-users">{}</span>
|
| 198 |
+
</div>
|
| 199 |
+
<div class="stat">
|
| 200 |
+
<label>Maia Users:</label>
|
| 201 |
+
<span id="maia-users">{}</span>
|
| 202 |
+
</div>
|
| 203 |
</div>
|
| 204 |
+
</body>
|
| 205 |
+
</html>
|
| 206 |
+
""".format(user_playing["total"], user_playing["stockfish"], user_playing["maia"])
|
| 207 |
+
|
| 208 |
+
return HTMLResponse(content=html_content)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|