Commit a795da63 authored by Clint Mourlevat's avatar Clint Mourlevat

Fixing some bugs

parent 217691f8
...@@ -25,7 +25,7 @@ namespace Stratis.Guru.Controllers ...@@ -25,7 +25,7 @@ namespace Stratis.Guru.Controllers
_stats = JsonConvert.DeserializeObject(_memoryCache.Get("BlockchainStats").ToString()); _stats = JsonConvert.DeserializeObject(_memoryCache.Get("BlockchainStats").ToString());
} }
[ResponseCache(Duration = 60, NoStore = true)] //[ResponseCache(Duration = 60, NoStore = true)]
public IActionResult Index() public IActionResult Index()
{ {
var latestBlockClient = new RestClient($"{_nakoApiSettings.Endpoint}query/block/Latest/transactions"); var latestBlockClient = new RestClient($"{_nakoApiSettings.Endpoint}query/block/Latest/transactions");
......
...@@ -78,14 +78,18 @@ ...@@ -78,14 +78,18 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@{
double total = 0;
}
@foreach (var transaction in Model.transactions) @foreach (var transaction in Model.transactions)
{ {
total += (double)transaction.value;
<tr> <tr>
<td><a asp-controller="BlockExplorer" asp-action="Transaction" asp-route-transactionId="@transaction.transactionHash">@transaction.transactionHash.ToString().Substring(0, 25)...</a></td> <td><a asp-controller="BlockExplorer" asp-action="Transaction" asp-route-transactionId="@transaction.transactionHash">@transaction.transactionHash.ToString().Substring(0, 25)...</a></td>
<td><a asp-controller="BlockExplorer" asp-action="Block" asp-route-block="@transaction.blockIndex">@transaction.blockIndex</a></td> <td><a asp-controller="BlockExplorer" asp-action="Block" asp-route-block="@transaction.blockIndex">@transaction.blockIndex</a></td>
<td>2018-04-13 10:14:27</td> <td>-</td>
<td><span class="@(transaction.value > 0 ? "green":"red")">@transaction.value.ToString("N8") STRAT</span></td> <td><span class="@(transaction.value > 0 ? "green" : "red")">@transaction.value.ToString("N8") STRAT</span></td>
<td>@Model.balance.ToString("N8") STRAT</td> <td>@total.ToString("N8") STRAT</td>
</tr> </tr>
} }
</tbody> </tbody>
......
...@@ -35,12 +35,16 @@ ...@@ -35,12 +35,16 @@
<td>@Model.blockSize kB</td> <td>@Model.blockSize kB</td>
</tr> </tr>
<tr> <tr>
<td><strong>Total Received</strong></td> <td><strong>Previous Block Hash</strong></td>
<td>@Model.blockIndex</td> <td>
<a asp-controller="BlockExplorer" asp-action="BlockHash" asp-route-hash="@Model.previousBlockHash">@(Model.previousBlockHash??"-")</a>
</td>
</tr> </tr>
<tr> <tr>
<td><strong>Total Sent</strong></td> <td><strong>Next Block Hash</strong></td>
<td>@Model.blockIndex</td> <td>
<a asp-controller="BlockExplorer" asp-action="BlockHash" asp-route-hash="@Model.nextBlockHash">@(Model.nextBlockHash??"-")</a>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
...@@ -60,15 +64,22 @@ ...@@ -60,15 +64,22 @@
<table class="table table-striped table-latests"> <table class="table table-striped table-latests">
<thead> <thead>
<tr> <tr>
<th>Hash</th> <th>Index</th>
<th>Block</th> <th>Transaction ID</th>
<th>Date/Time</th>
<th>Amount</th>
<th>Balance</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@{ int i = 0;}
@foreach (var transaction in Model.transactions)
{
<tr>
<td>@i</td>
<td>
<a asp-controller="BlockExplorer" asp-action="Transaction" asp-route-transactionId="@transaction">@transaction</a>
</td>
</tr>
i++;
}
</tbody> </tbody>
</table> </table>
</div> </div>
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<tr> <tr>
<td><strong>Block Date/Time</strong></td> <td><strong>Block Date/Time</strong></td>
<td>@Model.timestamp</td> <td>@Model.timestamp.ToString("F")</td>
</tr> </tr>
<tr> <tr>
<td><strong>Total Output</strong></td> <td><strong>Total Output</strong></td>
......
...@@ -1351,7 +1351,7 @@ header ...@@ -1351,7 +1351,7 @@ header
*/ */
.header-area.header-sticky { .header-area.header-sticky {
background: rgba(33, 37, 41, 0.90); background: rgba(33, 37, 41, 1);
box-shadow: 0 2px 28px 0 rgba(0, 0, 0, 0.6); box-shadow: 0 2px 28px 0 rgba(0, 0, 0, 0.6);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment