-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
65 lines (63 loc) · 4.58 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta property="og:locale" content="en-us">
<meta property="og:type" content="website">
<meta property="og:url" content="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="./favicon.ico">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/font-awesome.min.css">
<link rel="stylesheet" href="./static/css/status.css" >
<link rel="stylesheet" href="./static/css/index.css">
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
<script type="text/javascript" src="./static/js/config.js"></script>
<title>Tamers Union BitTorrent Tracker</title>
</head>
<body style="background-image:url(./static/img/background.png);width:100%;height:100vh">
<section class="section has-text-centered">
<div class="container">
<p><img class="logo" src="./static/img/logo_tamersunion.png"><br></p>
<h1 class="title is-3">
Public BitTorrent Tracker
</h1> Tracker URL<br><br>
<div class="input-group">
<input id="tracker" type="text" value="https://tracker.tamersunion.org:443/announce">
<span class="input-group-button">
<button class="btn" type="button" data-clipboard="" data-clipboard-target="#tracker">
<img class="clippy" src="./static/img/clippy.svg" alt="Copy to clipboard">
</button>
</span>
</div>
<a href="./stats" class="button is-info">Stats</a>
<!--<a href="./metrics" class="button is-danger">Metrics</a>-->
<a href="./incidents" class="button is-danger">Incidents</a>
<a href="https://docs.tamersunion.org/terms/tracker.html" class="button is-success">About</a>
<br><br>
<table style="margin:auto;margin-bottom:30px;" class="table is-bordered">
<thead>
<tr>
<th>Leechers</th>
<th>Seeders</th>
<th>Peers</th>
<th>Torrents</th>
</tr>
</thead>
<tbody>
<tr>
<td id="leechers"><i class="fa fa-spinner fa-spin"></i></td>
<td id="seeders"><i class="fa fa-spinner fa-spin"></i></td>
<td id="peers"><i class="fa fa-spinner fa-spin"></i></td>
<td id="torrents"><i class="fa fa-spinner fa-spin"></i></td>
</tr>
</tbody>
</table>
<div id="app"></div>
</div>
</section>
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js"></script>
<script src="./static/js/status.js"></script>
<script>
var clipboardS=new ClipboardJS("[data-clipboard]");clipboardS.on("success",function(e){e.clearSelection();console.info("Action:",e.action);console.info("Text:",e.text);console.info("Trigger:",e.trigger);showTooltip(e.trigger,"Copied")});clipboardS.on("error",function(e){console.error("Action:",e.action);console.error("Trigger:",e.trigger);showTooltip(e.trigger,fallbackMessage(e.action))});var btns=document.querySelectorAll(".btn");var snippets=document.querySelectorAll(".snippet");[].forEach.call(snippets,function(snippet){snippet.firstChild.insertAdjacentHTML("beforebegin",'<button class="btn" data-clipboard-snippet><img class="clippy" src="assets/images/clippy.svg" alt="Copy to clipboard"></button>')});var clipboardSnippets=new ClipboardJS("[data-clipboard-snippet]",{target:function(trigger){return trigger.nextElementSibling}});clipboardSnippets.on("success",function(e){e.clearSelection();showTooltip(e.trigger,"Copied!")});clipboardSnippets.on("error",function(e){showTooltip(e.trigger,fallbackMessage(e.action))});for(var i=0;i<btns.length;i++){btns[i].addEventListener("mouseleave",clearTooltip);btns[i].addEventListener("blur",clearTooltip)}function clearTooltip(e){e.currentTarget.setAttribute("class","btn");e.currentTarget.removeAttribute("aria-label")}function showTooltip(elem,msg){elem.setAttribute("class","btn tooltipped tooltipped-s");elem.setAttribute("aria-label",msg)};
var getStats=function(){$.ajax({url:"./prometheus/api/v1/query?query=chihaya_storage_seeders_count",success:function(result){$("#seeders").text(result.data.result[0].value[1])}});$.ajax({url:"./prometheus/api/v1/query?query=chihaya_storage_leechers_count",success:function(result){$("#leechers").text(result.data.result[0].value[1])}});$.ajax({url:"./prometheus/api/v1/query?query=chihaya_storage_seeders_count%2Bchihaya_storage_leechers_count",success:function(result){$("#peers").text(result.data.result[0].value[1])}});$.ajax({url:"./prometheus/api/v1/query?query=chihaya_storage_infohashes_count",success:function(result){$("#torrents").text(result.data.result[0].value[1])}});};getStats();setInterval(function(){getStats();},15000);
</script>
</body></html>