index.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <!--
  2. This file is part of DarkFi (https://dark.fi)
  3. Copyright (C) 2020-2026 Dyne.org foundation
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU Affero General Public License as
  6. published by the Free Software Foundation, either version 3 of the
  7. License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Affero General Public License for more details.
  12. You should have received a copy of the GNU Affero General Public License
  13. along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. -->
  15. {% extends "base.html" %}
  16. {% block title %}Explorer{% endblock %}
  17. {% block content %}
  18. <div class="content-container">
  19. <!-- Explorer Search -->
  20. <div class="search-container">
  21. <h1>Explore</h1>
  22. <form action="/search">
  23. <input class="search-input" type="text" placeholder="Search for a block or transaction.." name="search_hash">
  24. </form>
  25. </div>
  26. <!--Network Summary -->
  27. <div class="content-section" style="padding-bottom: 0px;">
  28. <h2 class="content-section-header">Network Summary</h2>
  29. <ul>
  30. <li>Height: {{ basic_stats[0] }}</li>
  31. <li>Epoch: {{ basic_stats[1] }}</li>
  32. <li>Last block: <a href="block/{{ basic_stats[2] }}">{{ basic_stats[2] }}</a></li>
  33. <li>Total blocks: {{ basic_stats[3] }}</li>
  34. <li>Total transactions: {{ basic_stats[4] }}</li>
  35. </ul>
  36. </div>
  37. <!--Latest Blocks -->
  38. <div class="content-section">
  39. <h2 class="content-section-header">Latest Blocks</h2>
  40. <table class="table">
  41. <thead>
  42. <tr>
  43. <th>Height</th>
  44. <th>Hash</th>
  45. <th>Timestamp</th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. {% for block in blocks %}
  50. <tr>
  51. <td>{{ block[3] }}</td>
  52. <td><a href="block/{{ block[0] }}">{{ block[0] }}</a></td>
  53. <td>{{ block[4] }}</td>
  54. </tr>
  55. {% endfor %}
  56. </tbody>
  57. </table>
  58. </div>
  59. <!--Total Network Gas Consumption -->
  60. <div class="content-section">
  61. <h2 class="content-section-header">Total Network Gas Consumption</h2>
  62. {% if metric_stats %}
  63. <table class="table">
  64. <thead>
  65. <tr>
  66. <th></th>
  67. <th>Average</th>
  68. <th>Minimum</th>
  69. <th>Maximum</th>
  70. </tr>
  71. </thead>
  72. <tbody>
  73. <tr>
  74. <td>Total</td>
  75. <td>{{ metric_stats[0] }}</td>
  76. <td>{{ metric_stats[1] }}</td>
  77. <td>{{ metric_stats[2] }}</td>
  78. </tr>
  79. <tr>
  80. <td>WASM</td>
  81. <td>{{ metric_stats[3] }}</td>
  82. <td>{{ metric_stats[4] }}</td>
  83. <td>{{ metric_stats[5] }}</td>
  84. </tr>
  85. <tr>
  86. <td>ZK Circuits</td>
  87. <td>{{ metric_stats[6] }}</td>
  88. <td>{{ metric_stats[7] }}</td>
  89. <td>{{ metric_stats[8] }}</td>
  90. </tr>
  91. <tr>
  92. <td>Signatures</td>
  93. <td>{{ metric_stats[9] }}</td>
  94. <td>{{ metric_stats[10] }}</td>
  95. <td>{{ metric_stats[11] }}</td>
  96. </tr>
  97. <tr>
  98. <td>Deployments</td>
  99. <td>{{ metric_stats[12] }}</td>
  100. <td>{{ metric_stats[13] }}</td>
  101. <td>{{ metric_stats[14] }}</td>
  102. </tr>
  103. </tbody>
  104. </table>
  105. {% else %}
  106. Gas consumption details are not available.
  107. {% endif %}
  108. </div>
  109. <!--Native Contracts -->
  110. <div class="content-section">
  111. <h2 class="content-section-header">Native Contracts</h2>
  112. <table class="table">
  113. <thead>
  114. <tr class="table-header">
  115. <th class="contract-id">Contract Id</th>
  116. <th class="contract-name text-center">Name</th>
  117. <th class="contract-description">Description</th>
  118. </tr>
  119. </thead>
  120. <tbody>
  121. {% for contract in native_contracts %}
  122. <tr class="table-row">
  123. <td class="contract-id">
  124. <a href="contract/{{ contract[0] }}?name={{ contract[1]|urlencode }}">{{ contract[0] }}</a>
  125. </td>
  126. <td class="contract-name text-center">{{ contract[1] }}</td>
  127. <td class="contract-description">{{ contract[2] }}</td>
  128. </tr>
  129. {% endfor %}
  130. </tbody>
  131. </table>
  132. </div>
  133. </div>
  134. {% endblock %}