Skip to content

Commit ba177da

Browse files
authored
index update
1 parent 2a12b75 commit ba177da

File tree

1 file changed

+89
-9
lines changed

1 file changed

+89
-9
lines changed

server.js

Lines changed: 89 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,95 @@ class Server extends EventEmitter {
263263
} else if (req.url === '/stats') {
264264
res.setHeader('Content-Type', 'text/html')
265265
res.end(`
266-
<h1>${stats.torrents} torrents (${stats.activeTorrents} active)</h1>
267-
<h2>Connected Peers: ${stats.peersAll}</h2>
268-
<h3>Peers Seeding Only: ${stats.peersSeederOnly}</h3>
269-
<h3>Peers Leeching Only: ${stats.peersLeecherOnly}</h3>
270-
<h3>Peers Seeding & Leeching: ${stats.peersSeederAndLeecher}</h3>
271-
<h3>IPv4 Peers: ${stats.peersIPv4}</h3>
272-
<h3>IPv6 Peers: ${stats.peersIPv6}</h3>
273-
<h3>Clients:</h3>
274-
${printClients(stats.clients)}
266+
<html>
267+
<head>
268+
<title>Tracker Stats</title>
269+
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
270+
<style>
271+
body{
272+
background-color: #222;
273+
color: #bbbbbb;
274+
}
275+
.center{
276+
margin: auto;
277+
text-align: center;
278+
}
279+
.first {
280+
background-color: #333;
281+
border-radius: 25px;
282+
padding: 20px;
283+
width: 90%;
284+
height: 20px;
285+
text-align: center;
286+
font-family: monospace;
287+
font-size: x-large;
288+
margin: 10px auto;
289+
display: block;
290+
}
291+
.second {
292+
background-color: #444;
293+
border-radius: 25px;
294+
padding: 20px;
295+
width: 27.75%;
296+
height: 20px;
297+
text-align: center;
298+
font-family: monospace;
299+
font-size: x-large;
300+
margin: 10px auto;
301+
display: inline-table;
302+
}
303+
.third {
304+
background-color: #444;
305+
border-radius: 25px;
306+
padding: 20px;
307+
width: 27.75%;
308+
height: 20px;
309+
text-align: center;
310+
font-family: monospace;
311+
font-size: x-large;
312+
margin: 10px auto;
313+
display: inline-table;
314+
}
315+
.fourth {
316+
background-color: #444;
317+
border-radius: 25px;
318+
padding: 20px;
319+
width: 27.75%;
320+
height: 20%;
321+
text-align: left;
322+
font-family: monospace;
323+
font-size: x-large;
324+
margin: 10px auto;
325+
display: inline-table;
326+
}
327+
</style>
328+
</head>
329+
<body>
330+
<div class="center">
331+
<div class="first">Tracker Stats</div>
332+
<div class="first">There are ${stats.torrents} torrents, ${stats.activeTorrents} are active.</div>
333+
<div class="first">Connected Peers: ${stats.peersAll}</div>
334+
</div>
335+
336+
<div class="center">
337+
<div class="second">Peers Seeding Only: ${stats.peersSeederOnly}</div>
338+
<div class="second">Peers Leeching Only: ${stats.peersLeecherOnly}</div>
339+
<div class="second">Peers Seeding &; Leeching: ${stats.peersSeederAndLeecher}</div>
340+
</div>
341+
342+
<div class="center">
343+
<div class="third">IPv4 Peers: ${stats.peersIPv4}</div>
344+
<div class="third">IPv6 Peers: ${stats.peersIPv6}</div>
345+
</div>
346+
347+
<div class="center">
348+
<div class="fourth">
349+
<h4>Clients:</h4>
350+
${printClients(stats.clients)}
351+
</div>
352+
</div>
353+
</body>
354+
</html>
275355
`.replace(/^\s+/gm, '')) // trim left
276356
}
277357
}

0 commit comments

Comments
 (0)