pool.dero.io Dero pool source for mining Dero.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

262 lines
6.5KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head lang="en">
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
  7. <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.4.0/jquery.timeago.min.js"></script>
  8. <script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.min.js"></script>
  9. <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
  10. <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
  11. <link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
  12. <link href="custom.css" rel="stylesheet">
  13. <script src="custom.js"></script>
  14. <style>
  15. #statsHolder {
  16. margin-bottom: 0;
  17. }
  18. .luckGood {
  19. color: #03a678;
  20. }
  21. .luckBad {
  22. color: #e66b6b;
  23. }
  24. body {
  25. padding-top: 65px;
  26. padding-bottom: 80px;
  27. overflow-y: scroll;
  28. }
  29. .navbar {
  30. font-size: 1.2em;
  31. }
  32. .layout {
  33. position: relative;
  34. }
  35. #loading {
  36. font-size: 2em;
  37. position: absolute;
  38. width: 100%;
  39. text-align: center;
  40. top: 10%;
  41. }
  42. footer {
  43. position: fixed;
  44. bottom: 0;
  45. width: 100%;
  46. background-color: #f5f5f5;
  47. }
  48. footer > div {
  49. margin: 10px auto;
  50. text-align: center;
  51. }
  52. </style>
  53. <script src="config.js"></script>
  54. <script>
  55. lastStats = {};
  56. $(function() {
  57. $.get(api + '/stats', function(data) {
  58. lastStats = data;
  59. routePage();
  60. });
  61. });
  62. var docCookies = {
  63. getItem: function(sKey) {
  64. return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null;
  65. },
  66. setItem: function(sKey, sValue, vEnd, sPath, sDomain, bSecure) {
  67. if(!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) {
  68. return false;
  69. }
  70. var sExpires = "";
  71. if(vEnd) {
  72. switch(vEnd.constructor) {
  73. case Number:
  74. sExpires = vEnd === Infinity ? "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : "; max-age=" + vEnd;
  75. break;
  76. case String:
  77. sExpires = "; expires=" + vEnd;
  78. break;
  79. case Date:
  80. sExpires = "; expires=" + vEnd.toUTCString();
  81. break;
  82. }
  83. }
  84. document.cookie = encodeURIComponent(sKey) + "=" + encodeURIComponent(sValue) + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : "");
  85. return true;
  86. },
  87. removeItem: function(sKey, sPath, sDomain) {
  88. if(!sKey || !this.hasItem(sKey)) {
  89. return false;
  90. }
  91. document.cookie = encodeURIComponent(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + ( sDomain ? "; domain=" + sDomain : "") + ( sPath ? "; path=" + sPath : "");
  92. return true;
  93. },
  94. hasItem: function(sKey) {
  95. return (new RegExp("(?:^|;\\s*)" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie);
  96. }
  97. };
  98. function getReadableCoins(coins) {
  99. return (parseInt(coins || 0) / lastStats.config.coinUnits).toFixed(lastStats.config.coinUnits.toString().length - 1);
  100. }
  101. function getReadableHashRateString(hashrate) {
  102. hashrate = hashrate || 0;
  103. var i = 0;
  104. var byteUnits = [' H', ' KH', ' MH', ' GH', ' TH', ' PH' ];
  105. while(hashrate > 1000) {
  106. hashrate = hashrate / 1000;
  107. i++;
  108. }
  109. return parseInt(hashrate).toFixed(2) + byteUnits[i];
  110. }
  111. window.onhashchange = function() {
  112. routePage();
  113. };
  114. function fetchLiveStats() {
  115. $.ajax({
  116. url: api + '/live_stats',
  117. dataType: 'json',
  118. cache: 'false'
  119. }).done(function(data) {
  120. //pulseLiveUpdate();
  121. //lastStats = data;
  122. //updateIndex();
  123. if(currentPage.update) {
  124. currentPage.update();
  125. }
  126. }).always(function() {
  127. fetchLiveStats();
  128. });
  129. }
  130. // init Handlebars template
  131. function renderTemplate(usersData, templateId, view) {
  132. var source = $(templateId).html(),
  133. template = Handlebars.compile(source),
  134. context = usersData,
  135. html = template(context);
  136. $(view).html(html);
  137. }
  138. function sortTable() {
  139. var table = $(this).parents('table').eq(0),
  140. rows = table.find('tr:gt(0)').toArray().sort(comparer($(this).index()));
  141. this.asc = !this.asc;
  142. if(!this.asc) {
  143. rows = rows.reverse()
  144. }
  145. for(var i = 0; i < rows.length; i++) {
  146. table.append(rows[i])
  147. }
  148. }
  149. function comparer(index) {
  150. return function(a, b) {
  151. var valA = getCellValue(a, index), valB = getCellValue(b, index);
  152. return $.isNumeric(valA) && $.isNumeric(valB) ? valA - valB : valA.localeCompare(valB)
  153. }
  154. }
  155. function getCellValue(row, index) {
  156. return $(row).children('td').eq(index).data("sort")
  157. }
  158. var currentPage;
  159. var xhrPageLoading;
  160. function routePage(loadedCallback) {
  161. if(currentPage && currentPage.destroy) {
  162. currentPage.destroy();
  163. }
  164. $('#page').html('');
  165. $('#loading').show();
  166. if(xhrPageLoading) {
  167. xhrPageLoading.abort();
  168. }
  169. $('.hot_link').removeClass('active');
  170. var $link = $('a.hot_link[href="' + (window.location.hash || '#') + '"]');
  171. $link.addClass('active');
  172. var page = $link.data('page');
  173. xhrPageLoading = $.ajax({
  174. url: 'pages/' + page,
  175. cache: false,
  176. success: function(data) {
  177. $('#loading').hide();
  178. $('#page').show().html(data);
  179. currentPage && currentPage.update && currentPage.update();
  180. if(loadedCallback) {
  181. loadedCallback();
  182. }
  183. }
  184. });
  185. }
  186. </script>
  187. </head>
  188. <body>
  189. <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
  190. <div class="container">
  191. <div class="navbar-header">
  192. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
  193. <span class="sr-only">Toggle navigation</span>
  194. <span class="icon-bar"></span>
  195. <span class="icon-bar"></span>
  196. <span class="icon-bar"></span>
  197. </button>
  198. <a class="navbar-brand" href="#">Admin Center</a>
  199. </div>
  200. <div class="collapse navbar-collapse">
  201. <!-- <div class="navbar-form navbar-right">
  202. <a href="" class="btn btn-primary"><i class="fa fa-sign-out"></i> Sign out</a>
  203. </div> -->
  204. </div>
  205. </div>
  206. </div>
  207. <div class="container">
  208. <div class="row">
  209. <div class="col-sm-3">
  210. <div class="list-group">
  211. <a data-page="admin/statistics.html" href="#" class="list-group-item hot_link active"> <i class="fa fa-bar-chart-o"></i> Statistics </a> <a data-page="admin/monitoring.html" href="#monitoring" class="hot_link list-group-item"> <i class="fa fa-eye"></i> Monitoring </a> <a data-page="admin/userslist.html" href="#users_list" class=" hot_link list-group-item"> <i class="fa fa-users"></i> Users List </a>
  212. </div>
  213. </div>
  214. <div class="col-sm-9 layout">
  215. <p id="loading" class="text-center"><i class="fa fa-circle-o-notch fa-spin"></i></p>
  216. <div id="page"></div>
  217. </div>
  218. </div>
  219. </div>
  220. </body>
  221. </html>