blockchain.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  7. <link href="/css/fonts.css" rel="stylesheet">
  8. <link rel="stylesheet" href="/css/bulma.min.css" />
  9. <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css" integrity="sha384-DyZ88mC6Up2uqS4h/KRgHuoeGwBcD4Ng9SiP4dIRy0EXTlnuz47vAwmeGwVChigm" crossorigin="anonymous">
  10. <script src="/js/jquery.min.js"></script>
  11. <link rel="stylesheet" type="text/css" href="/css/dt.min.css">
  12. <script type="text/javascript" charset="utf8" src="/js/dt.min.js"></script>
  13. <script src="/js/dt.js"></script>
  14. <script src="/js/common.js"></script>
  15. <link rel="stylesheet" type="text/css" href="/css/style.css">
  16. <title>EdgeVPN - Blockchain index</title>
  17. </head>
  18. <body>
  19. <nav class="navbar is-light is-spaced has-shadow" role="navigation" aria-label="main navigation">
  20. <div class="navbar-brand">
  21. <a class="navbar-item" href="/">
  22. <img src="/images/logo.png" > &nbsp;
  23. EdgeVPN
  24. </a>
  25. <a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="menu">
  26. <span aria-hidden="true"></span>
  27. <span aria-hidden="true"></span>
  28. <span aria-hidden="true"></span>
  29. </a>
  30. </div>
  31. <div id="menu" class="navbar-menu">
  32. <div class="navbar-start">
  33. <a class="navbar-item" href="/machines.html">
  34. <i class="fas fa-server"></i>&nbsp;
  35. Machines
  36. </a>
  37. <a class="navbar-item" href="/services.html">
  38. <i class="fas fa-project-diagram"></i>&nbsp;
  39. Services
  40. </a>
  41. <a class="navbar-item" href="/files.html">
  42. <i class="fas fa-file-upload"></i>&nbsp;
  43. Files
  44. </a>
  45. <a class="navbar-item" href="/users.html">
  46. <i class="fas fa-user-clock"></i>&nbsp;
  47. Users
  48. </a>
  49. <a class="navbar-item" href="/blockchain.html">
  50. <i class="fas fa-dice-d20"></i>&nbsp;
  51. Blockchain
  52. </a>
  53. </div>
  54. <div class="navbar-end">
  55. <div class="navbar-item">
  56. <div class="buttons">
  57. <a class="button is-link" href="https://github.com/mudler/edgevpn" target=_blank>
  58. <strong><i class="fab fa-github-alt"></i> GitHub</strong>
  59. </a>
  60. <a class="button is-light" href="https://github.com/mudler/edgevpn/issues/new" target=_blank>
  61. <i class="fas fa-bug"></i>&nbsp; Report issue
  62. </a>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </nav>
  68. <section class="hero">
  69. <div class="hero-body">
  70. <div class="container">
  71. <h1 class="title">
  72. <i class="fas fa-dice-d20"></i> Blockchain index
  73. </h1>
  74. <h2 class="subtitle">
  75. Accessible via api at <a href="/api/blockchain" target=_blank><code> /api/blockchain </code></a>
  76. </h2>
  77. </div>
  78. </div>
  79. </section>
  80. <section class="section">
  81. <div class="container">
  82. <table data-toggle="table"
  83. data-search="true"
  84. data-show-columns="true"
  85. id="table" >
  86. <thead>
  87. <tr>
  88. <th ><abbr title="Index">Index</abbr></th>
  89. <th >Timestamp</th>
  90. <th ><abbr title="Hash">Hash</abbr></th>
  91. <th><abbr title="PrevHash">PrevHash</abbr></th>
  92. </tr>
  93. </thead>
  94. </table>
  95. </div>
  96. </section>
  97. <script type="text/javascript">
  98. $(document).ready(function() {
  99. var resp
  100. var table = $('#table').DataTable()
  101. sync = function() {
  102. $.ajax({
  103. url: "/api/blockchain",
  104. type: "GET",
  105. cache: false,
  106. async: true,
  107. dataType: "json",
  108. success: function (response) {
  109. // response is JSON
  110. if (resp && response.Index <= resp.Index ) {
  111. return
  112. }
  113. resp = response
  114. table.row.add( [
  115. resp.Index,
  116. resp.Timestamp,
  117. resp.Hash,
  118. resp.PrevHash
  119. ] ).draw( false );
  120. }
  121. });
  122. }
  123. sync()
  124. setInterval( function () {
  125. sync()
  126. }, 5000 );
  127. } );
  128. </script>
  129. <footer class="footer">
  130. <div class="content has-text-centered">
  131. <p>
  132. <strong>EdgeVPN</strong> by <a href="https://github.com/mudler/edgevpn">Ettore Di Giacinto</a>. The source code is licensed
  133. <a href="https://github.com/mudler/edgevpn/blob/master/LICENSE">GPLv3</a>.
  134. Logo originally made by <a href="https://www.flaticon.com/authors/uniconlabs" title="Uniconlabs">Uniconlabs</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>
  135. </p>
  136. </div>
  137. </footer>
  138. </body>
  139. </html>