Commit f7452c5a authored by Clint Mourlevat's avatar Clint Mourlevat

Testing deployment

parent 577fa9d3
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;
......@@ -24,10 +25,30 @@ namespace Stratis.Guru.Controllers
_stats = JsonConvert.DeserializeObject(_memoryCache.Get("BlockchainStats").ToString());
}
[ResponseCache(Duration = 60)]
public IActionResult Index()
{
ViewBag.BlockchainHeight = _stats.syncBlockIndex;
var latestBlockClient = new RestClient($"{_nakoApiSettings.Endpoint}query/block/Latest/transactions");
var latestBlockRequest = new RestRequest(Method.GET);
var latestBlockResponse = latestBlockClient.Execute(latestBlockRequest);
ViewBag.LatestBlock = JsonConvert.DeserializeObject(latestBlockResponse.Content);
ViewBag.BlockchainHeight = ViewBag.LatestBlock.blockIndex;
var x = new List<dynamic>();
for (int i = (int)ViewBag.LatestBlock.blockIndex; i >= (int)ViewBag.LatestBlock.blockIndex-5; i--)
{
var endpointClient = new RestClient($"{_nakoApiSettings.Endpoint}query/block/index/{i}/transactions");
var enpointRequest = new RestRequest(Method.GET);
var endpointResponse = endpointClient.Execute(enpointRequest);
x.Add(JsonConvert.DeserializeObject(endpointResponse.Content));
}
ViewBag.Blocks = x;
return View();
}
[Route("search")]
......@@ -41,6 +62,10 @@ namespace Stratis.Guru.Controllers
{
return RedirectToAction("Transaction", new {transactionId = searchBlockExplorer.Query});
}
else if (searchBlockExplorer.Query.Length <= 8)
{
return RedirectToAction("Block", new {block = searchBlockExplorer.Query});
}
return RedirectToAction("Index");
}
......@@ -48,7 +73,20 @@ namespace Stratis.Guru.Controllers
public IActionResult Block(string block)
{
ViewBag.BlockchainHeight = _stats.syncBlockIndex;
return View();
var endpointClient = new RestClient($"{_nakoApiSettings.Endpoint}query/block/index/{block}/transactions");
var enpointRequest = new RestRequest(Method.GET);
var endpointResponse = endpointClient.Execute(enpointRequest);
return View(JsonConvert.DeserializeObject(endpointResponse.Content));
}
[Route("block/hash/{hash}")]
public IActionResult BlockHash(string hash)
{
ViewBag.BlockchainHeight = _stats.syncBlockIndex;
var endpointClient = new RestClient($"{_nakoApiSettings.Endpoint}query/block/{hash}/transactions");
var enpointRequest = new RestRequest(Method.GET);
var endpointResponse = endpointClient.Execute(enpointRequest);
return View("Block", JsonConvert.DeserializeObject(endpointResponse.Content));
}
[Route("address/{address}")]
......
......@@ -22,7 +22,7 @@
<tr>
<td><strong>Address</strong></td>
<td>
<a asp-controller="BlockExplorer" asp-action="Address" asp-route-address="@Model.address">@Model.address</a>
<a class="to-copy" asp-controller="BlockExplorer" asp-action="Address" asp-route-address="@Model.address">@Model.address</a>
<a href="#" class="copy-me"><i class="fa fa-copy"></i></a>
</td>
</tr>
......
@model object
@model dynamic
@{
ViewBag.Title = "title";
ViewBag.Title = $"Block {5}";
Layout = "_Layout";
ViewBag.Query = Model.blockHash;
}
<h2>title</h2>
<partial name="SearchBlock" model="@(new SearchBlockExplorer())" />
<section class="block-explorer-section">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="center-heading">
<h2 class="section-title">Details for Block #@Model.blockIndex</h2>
</div>
</div>
</div>
<div class="row m-bottom-70">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="table-responsive">
<table class="table table-striped table-latests table-detail">
<tbody>
<tr>
<td><strong>Address</strong></td>
<td>
<a asp-controller="BlockExplorer" asp-action="Address" asp-route-address="@Model.blockHash">@Model.blockHash</a>
<a href="#" class="copy-me"><i class="fa fa-copy"></i></a>
</td>
</tr>
<tr>
<td><strong>Date/Time</strong></td>
<td>@DateTimeOffset.FromUnixTimeSeconds((long)Model.blockTime).ToString("F")</td>
</tr>
<tr>
<td><strong>Block Size</strong></td>
<td>@Model.blockSize</td>
</tr>
<tr>
<td><strong>Total Received</strong></td>
<td>@Model.blockIndex</td>
</tr>
<tr>
<td><strong>Total Sent</strong></td>
<td>@Model.blockIndex</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="center-heading">
<h2 class="section-title">Transactions</h2>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="table-responsive">
<table class="table table-striped table-latests">
<thead>
<tr>
<th>Hash</th>
<th>Block</th>
<th>Date/Time</th>
<th>Amount</th>
<th>Balance</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
@model dynamic
@{
ViewBag.Title = "Stratis Block Explorer";
Layout = "_Layout";
}
<partial name="SearchBlock" />
<section class="block-explorer-section section">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="center-heading">
<h2 class="section-title">Latest Blocks</h2>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="table-responsive">
<table class="table table-striped table-latests">
<thead>
<tr>
<td>Block Height</td>
<td>Age</td>
<td>Transactions</td>
<td>Value Out</td>
<td>Difficulty</td>
<td>Extracted by</td>
</tr>
</thead>
<tbody>
<tr>
<td><a href="green-block-explorer-address-detail.html">1883451</a></td>
<td>26 minutes</td>
<td>1 - 0.3 kB</td>
<td>4.00000000 ARD</td>
<td>2487.2 </td>
<td><a href="green-block-explorer-address-detail.html">EKnqTC9XEuucZEhD3miDGnbJxBptcxhByA</a></td>
</tr>
<tr>
<td><a href="green-block-explorer-address-detail.html">1883450</a></td>
<td>26 minutes</td>
<td>1 - 0.3 kB</td>
<td>78.56148997 ARD</td>
<td>2487.2 </td>
<td><a href="green-block-explorer-address-detail.html">EKnqTC9XEuucZEhD3miDGnbJxBptcxhByA</a></td>
</tr>
<tr>
<td><a href="green-block-explorer-address-detail.html">1883449</a></td>
<td>26 minutes</td>
<td>1 - 0.3 kB</td>
<td>16.26147900 ARD</td>
<td>2487.2 </td>
<td><a href="green-block-explorer-address-detail.html">EKnqTC9XEuucZEhD3miDGnbJxBptcxhByA</a></td>
</tr>
<tr>
<td><a href="green-block-explorer-address-detail.html">1883448</a></td>
<td>32 minutes</td>
<td>1 - 0.3 kB</td>
<td>1.00000000 ARD</td>
<td>2487.2 </td>
<td><a href="green-block-explorer-address-detail.html">EKnqTC9XEuucZEhD3miDGnbJxBptcxhByA</a></td>
</tr>
<tr>
<td><a href="green-block-explorer-address-detail.html">1883447</a></td>
<td>32 minutes</td>
<td>1 - 0.3 kB</td>
<td>8.12343216 ARD</td>
<td>2487.2 </td>
<td><a href="green-block-explorer-address-detail.html">EKnqTC9XEuucZEhD3miDGnbJxBptcxhByA</a></td>
</tr>
<tr>
<td><a href="green-block-explorer-address-detail.html">1883446</a></td>
<td>32 minutes</td>
<td>1 - 0.3 kB</td>
<td>32.94581285 ARD</td>
<td>2487.2 </td>
<td><a href="green-block-explorer-address-detail.html">EKnqTC9XEuucZEhD3miDGnbJxBptcxhByA</a></td>
</tr>
<tr>
<td><a href="green-block-explorer-address-detail.html">1883445</a></td>
<td>53 minutes</td>
<td>1 - 0.3 kB</td>
<td>0.27650932 ARD</td>
<td>2487.2 </td>
<td><a href="green-block-explorer-address-detail.html">EKnqTC9XEuucZEhD3miDGnbJxBptcxhByA</a></td>
</tr>
<tr>
<td><a href="green-block-explorer-address-detail.html">1883444</a></td>
<td>53 minutes</td>
<td>1 - 0.3 kB</td>
<td>2.16841398 ARD</td>
<td>2487.2 </td>
<td><a href="green-block-explorer-address-detail.html">EKnqTC9XEuucZEhD3miDGnbJxBptcxhByA</a></td>
</tr>
<tr>
<td><a href="green-block-explorer-address-detail.html">1883443</a></td>
<td>53 minutes</td>
<td>1 - 0.3 kB</td>
<td>43.06734912 ARD</td>
<td>2487.2 </td>
<td><a href="green-block-explorer-address-detail.html">EKnqTC9XEuucZEhD3miDGnbJxBptcxhByA</a></td>
</tr>
<tr>
<td><a href="green-block-explorer-address-detail.html">1883442</a></td>
<td>58 minutes</td>
<td>1 - 0.3 kB</td>
<td>1.6590157 ARD</td>
<td>2487.2 </td>
<td><a href="green-block-explorer-address-detail.html">EKnqTC9XEuucZEhD3miDGnbJxBptcxhByA</a></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
\ No newline at end of file
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="center-heading">
<h2 class="section-title">Latest Blocks</h2>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="table-responsive">
<table class="table table-striped table-latests">
<thead>
<tr>
<td>Block Height</td>
<td>Age</td>
<td>No. Transactions</td>
<td>Block Size</td>
<td>Block Hash</td>
</tr>
</thead>
<tbody>
@foreach(var block in ViewBag.Blocks)
{
<tr>
<td><a asp-controller="BlockExplorer" asp-action="Block" asp-route-block="@block.blockIndex">@block.blockIndex</a></td>
<td>@((DateTime.Now - DateTimeOffset.FromUnixTimeSeconds((long)block.blockTime)).TotalMinutes.ToString("N0")) Minutes</td>
<td>@block.transactionCount</td>
<td>@block.blockSize Kb</td>
<td><a asp-controller="BlockExplorer" asp-action="BlockHash" asp-route-hash="@block.blockHash">@block.blockHash</a></td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
\ No newline at end of file
......@@ -10,7 +10,10 @@
<h1>About <strong>Stratis.Guru</strong> v2.0.</h1>
<p>Stratis.guru reborn from the first version developed in ASP.Net MVC, the new version is made with Microsoft<sup>&reg;</sup> .Net Core and use the NStratis Library.</p>
<p class="small text-warning">Disclaimer: Please DO NOT use the generated addresses except for test or training purposes,<br />if the server is backdoored or anything other you will loose your funds.</p>
<a href="https://github.com/clintnetwork/stratis-guru-v2" target="_blank" class="btn-secondary-box"><i class="fa fa-github"></i> Browse Source on Github</a>
<p class="small extra">If you need to contact me or report a bug please PM me on twitter or send a mail at <a href="mailto:stratis-guru@volto.io">stratis-guru@volto.io</a>.</p>
<a href="https://github.com/clintnetwork/stratis-guru-v2" target="_blank" class="btn-white-line"><i class="fa fa-github"></i> Browse Source on Github</a>
&nbsp;
<a href="https://twitter.com/clint_network" target="_blank" class="btn-white-line"><i class="fa fa-twitter"></i> Follow me on Twitter</a>
</div>
</div>
</div>
......
@{
ViewBag.Title = "Contact Me";
Layout = "_Layout";
}
<section class="welcome-area pb-4" id="welcome-1">
<div class="header-token">
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 pb-4 align-self-center text-center">
<h1><i class="fa fa-envelope-o"></i> Contact Me</h1>
<p>If you need to contact me, don't hesitate to send me a mail at <a href="mailto:stratis-guru@volto.io">stratis-guru@volto.io</a>.</p>
<a href="https://twitter.com/clint_network" target="_blank" class="btn-secondary-box"><i class="fa fa-twitter"></i> Follow me on Twitter</a>
</div>
</div>
</div>
</div>
</section>
\ No newline at end of file
......@@ -15,7 +15,7 @@
<span class="align-middle display-1 font-weight-bold" id="amount">@(Model.UsdPrice.ToString("C2"))</span>
<span id="lastchange" class="d-block d-lg-inline-block change-@(Model.Last24Change > 0 ? "success":"danger") font-weight-bold"><sup> <span class="d-none d-lg-inline-block">@((Model.Last24Change > 0 ? "+":""))</span> @(Model.Last24Change.ToString("P2"))</sup></span>
</h1>
<a asp-controller="Home" asp-action="Generator" class="btn-secondary-box"><i class="fa fa-paper-plane"></i> Get a Stratis Address</a>
<a asp-controller="BlockExplorer" asp-action="Index" class="btn-secondary-box"><i class="fa fa-cube"></i> Go to Block Explorer</a>
</div>
</div>
</div>
......@@ -50,7 +50,7 @@
}).click(function() {
$(this).prop('contenteditable', true).focus().select();
}).on("blur", function() {
if ($.isNumeric($(this).text())) {
if ($.isNumeric($(this).text()) && parseFloat($(this).text()) > 1) {
stratisAmount = $(this).text();
UpdateTicker();
} else {
......
......@@ -1333,7 +1333,7 @@ header
.header-area.header-sticky .nav li a.btn-nav-box:hover {
background: none;
color: #0EB8D9;
}*/
}
.header-area.header-sticky .lang {
margin-top: 22px !important;
......@@ -1348,6 +1348,12 @@ header
font-weight: 600;
font-size: 12px;
}
*/
.header-area.header-sticky {
background: rgba(33, 37, 41, 0.90);
box-shadow: 0 2px 28px 0 rgba(0, 0, 0, 0.6);
}
@media (max-width: 1200px) {
.header-area .main-nav .nav li {
......@@ -1360,11 +1366,6 @@ header
}
.header-area.header-sticky {
background: rgb(33, 37, 41);
height: 80px;
box-shadow: 0 2px 28px 0 rgba(0, 0, 0, 0.6);
}
#crafted {
height: 80px;
......
This diff is collapsed.
......@@ -3,6 +3,10 @@
_0x2f2ex1(document)['ready'](function () {
NProgress.start();
$('[data-toggle="tooltip"]').tooltip();
$(".copy-me").click(function () {
$(this).parent().find(".to-copy").select();
document.execCommand("copy");
});
_0x2f2exe();
if (_0x2f2ex1('.menu-trigger')['length']) {
_0x2f2ex1('.menu-trigger')['click'](function () {
......@@ -136,7 +140,7 @@
});
_0x2f2ex1(window)['scroll'](function () {
var _0x2f2exa = _0x2f2ex1(window)['width']();
if (_0x2f2exa < 991) {
if (_0x2f2exa < 9910) {
var _0x2f2exd = _0x2f2ex1(window)['scrollTop']();
if (_0x2f2exd >= 30) {
_0x2f2ex1('.header-area')['addClass']('header-sticky');
......
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