index.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. {% extends 'base.html' %}
  2. {% block title %} URLTeam Tracker {% end %}
  3. {% block body %}
  4. <div class="pull-right">
  5. <a href="{{ reverse_url('admin.overview') }}">Tracker admin</a>
  6. </div>
  7. <div class="container">
  8. <div class="hero">
  9. <h1>URLTeam Tracker</h1>
  10. <h2>The Terror of Tiny Town</h2>
  11. </div>
  12. <div role="main" ng-app="stats">
  13. <nav>
  14. <a class="index-nav-item"
  15. href="{{ reverse_url('index') }}">Status</a>
  16. <a class="index-nav-item"
  17. href="{{ reverse_url('index.status') }}">Projects</a>
  18. <a class="index-nav-item"
  19. href="http://archiveteam.org/index.php?title=Warrior">How to help</a>
  20. <a class="index-nav-item"
  21. href="http://archiveteam.org/index.php?title=URLTeam">About</a>
  22. <a class="index-nav-item"
  23. href="https://github.com/ArchiveTeam/terroroftinytown">
  24. Source code</a>
  25. <a class="index-nav-item"
  26. href="{{ reverse_url('index.calculator') }}">Calculator</a>
  27. </nav>
  28. {% block main %}
  29. <div id="stats" ng-controller="StatsController">
  30. <div id="globalstats">
  31. <div id="mainstats">
  32. <strong ng-bind="stats.global[1]|number">{{ stats['global'][1] }}</strong> URLs scanned, <strong ng-bind="stats.global[0]|number">{{ stats['global'][0] }}</strong> saved<br>
  33. </div>
  34. <div id="extrastats" ng-if="::stats">
  35. <span ng-bind="stats.currentScanRate|number:0">--</span> scans per second
  36. </div>
  37. </div>
  38. <div id="leaderboard" class="row">
  39. <div class="col-md-6">
  40. <div class="panel panel-default">
  41. <div class="panel-heading">
  42. <div class="pull-right">
  43. Limit: <input type="number" ng-model="totalLimit" class="input">
  44. </div>
  45. Totals
  46. </div>
  47. <table class="table table-bordered table-striped" id="leaderboard-totals">
  48. <colgroup>
  49. <col style="width: 40%;">
  50. <col style="width: 30%;">
  51. <col style="width: 30%;">
  52. </colgroup>
  53. <thead>
  54. <tr>
  55. <th>Username</th>
  56. <th>Found</th>
  57. <th>Scanned</th>
  58. </tr>
  59. </thead>
  60. <tbody>
  61. <tr ng-repeat="item in lifetime|orderBy:getScanned:true|limitTo:totalLimit">
  62. <td class="table-string" ng-class="'nick-color-' + (item[0].charCodeAt(0) + item[0].length) % 8;" ng-bind="item[0]"></td>
  63. <td class="table-number" ng-bind="item[1][0]|number"></td>
  64. <td class="table-number" ng-bind="item[1][1]|number"></td>
  65. </tr>
  66. <noscript>
  67. {% for username, found, scanned in stats['lifetime'] %}
  68. <tr>
  69. <td class="table-string">{{ username }}</td>
  70. <td class="table-number">{{ found }}</td>
  71. <td class="table-number">{{ scanned }}</td>
  72. </tr>
  73. {% end %}
  74. </noscript>
  75. </tbody>
  76. </table>
  77. </div>
  78. </div>
  79. <div class="col-md-6">
  80. <div class="panel panel-default">
  81. <div class="panel-heading">
  82. <div class="pull-right">
  83. Limit: <input type="number" ng-model="recentLimit">
  84. </div>
  85. Recent
  86. </div>
  87. <table class="table table-bordered table-striped" id="leaderboard-recent">
  88. <colgroup>
  89. <col style="width: 40%; overflow:hidden;">
  90. <col style="width: 15%;">
  91. <col style="width: 15%;">
  92. <col style="width: 30%;">
  93. </colgroup>
  94. <thead>
  95. <tr>
  96. <th>Username</th>
  97. <th>Found</th>
  98. <th>Scanned</th>
  99. <th>Service</th>
  100. </tr>
  101. </thead>
  102. <tbody>
  103. <tr ng-repeat="item in stats.live">
  104. <td class="table-string" ng-class="'nick-color-' + (item.username.charCodeAt(0) + item.username.length) % 8;" ng-bind="item.username"></td>
  105. <td class="table-number" ng-bind="item.found|number"></td>
  106. <td class="table-number" ng-bind="item.scanned|number"></td>
  107. <td class="table-string" ng-bind="item.project"></td>
  108. </tr>
  109. <noscript>
  110. {% for item in stats['live'] %}
  111. <tr>
  112. <td class="table-string">{{ item['username'] }}</td>
  113. <td class="table-number">{{ item['found'] }}</td>
  114. <td class="table-number">{{ item['scanned'] }}</td>
  115. <td class="table-string">{{ item['project'] }}</td>
  116. </tr>
  117. {% end %}
  118. </noscript>
  119. </tbody>
  120. </table>
  121. </div>
  122. </div>
  123. </div>
  124. <noscript>
  125. <div class="bg-info">
  126. <p>This dashboard is best experienced with JavaScript.</p>
  127. </div>
  128. </noscript>
  129. </div>
  130. {% end %}
  131. </div>
  132. </div>
  133. {% block index_scripts %}
  134. <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.19/angular.min.js"></script>
  135. <script src="{{ static_url('stats.js') }}"></script>
  136. {% end %}
  137. {% end %}