Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
guru
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
guru
Commits
8befcf9c
Commit
8befcf9c
authored
Oct 20, 2018
by
Clint Mourlevat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some minor edit
parent
052284f2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
255 deletions
+13
-255
BlockExplorerController.cs
Controllers/BlockExplorerController.cs
+11
-2
Address.cshtml
Views/BlockExplorer/Address.cshtml
+0
-5
Index.cshtml
Views/BlockExplorer/Index.cshtml
+0
-247
SearchBlock.cshtml
Views/BlockExplorer/SearchBlock.cshtml
+1
-1
default.css
wwwroot/css/default.css
+1
-0
No files found.
Controllers/BlockExplorerController.cs
View file @
8befcf9c
using
System
;
using
System.IO
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.Extensions.Caching.Memory
;
using
Microsoft.Extensions.Options
;
using
Newtonsoft.Json
;
using
RestSharp
;
...
...
@@ -13,14 +14,19 @@ namespace Stratis.Guru.Controllers
public
class
BlockExplorerController
:
Controller
{
private
readonly
NakoApiSettings
_nakoApiSettings
;
private
readonly
IMemoryCache
_memoryCache
;
private
readonly
dynamic
_stats
;
public
BlockExplorerController
(
IOptions
<
NakoApiSettings
>
nakoApiSettings
)
public
BlockExplorerController
(
I
MemoryCache
memoryCache
,
I
Options
<
NakoApiSettings
>
nakoApiSettings
)
{
_nakoApiSettings
=
nakoApiSettings
.
Value
;
_memoryCache
=
memoryCache
;
_stats
=
JsonConvert
.
DeserializeObject
(
_memoryCache
.
Get
(
"BlockchainStats"
).
ToString
());
}
public
IActionResult
Index
()
{
ViewBag
.
BlockchainHeight
=
_stats
.
syncBlockIndex
;
return
View
();
}
...
...
@@ -35,18 +41,20 @@ namespace Stratis.Guru.Controllers
{
return
RedirectToAction
(
"Transaction"
,
new
{
transactionId
=
searchBlockExplorer
.
Query
});
}
return
Content
(
"oh yeay
"
);
return
RedirectToAction
(
"Index
"
);
}
[
Route
(
"block/{block}"
)]
public
IActionResult
Block
(
string
block
)
{
ViewBag
.
BlockchainHeight
=
_stats
.
syncBlockIndex
;
return
View
();
}
[
Route
(
"address/{address}"
)]
public
IActionResult
Address
(
string
address
)
{
ViewBag
.
BlockchainHeight
=
_stats
.
syncBlockIndex
;
var
endpointClient
=
new
RestClient
(
$"
{
_nakoApiSettings
.
Endpoint
}
query/address/
{
address
}
/transactions"
);
var
enpointRequest
=
new
RestRequest
(
Method
.
GET
);
var
endpointResponse
=
endpointClient
.
Execute
(
enpointRequest
);
...
...
@@ -56,6 +64,7 @@ namespace Stratis.Guru.Controllers
[
Route
(
"transaction/{transactionId}"
)]
public
IActionResult
Transaction
(
string
transactionId
)
{
ViewBag
.
BlockchainHeight
=
_stats
.
syncBlockIndex
;
var
endpointClient
=
new
RestClient
(
$"
{
_nakoApiSettings
.
Endpoint
}
query/transaction/
{
transactionId
}
"
);
var
enpointRequest
=
new
RestRequest
(
Method
.
GET
);
var
endpointResponse
=
endpointClient
.
Execute
(
enpointRequest
);
...
...
Views/BlockExplorer/Address.cshtml
View file @
8befcf9c
...
...
@@ -13,11 +13,6 @@
<h2 class="section-title">Details for Address</h2>
</div>
</div>
@*<div class="offset-lg-3 col-lg-6">
<div class="center-text">
<p>Fusce placerat pretium mauris, vel sollicitudin elit lacinia vitae. Quisque sit amet nisi erat.</p>
</div>
</div>*@
</div>
<div class="row m-bottom-70">
<div class="col-lg-9 col-md-9 col-sm-12">
...
...
Views/BlockExplorer/Index.cshtml
View file @
8befcf9c
This diff is collapsed.
Click to expand it.
Views/BlockExplorer/SearchBlock.cshtml
View file @
8befcf9c
...
...
@@ -7,7 +7,7 @@
<h1>Stratis Blockchain Explorer</h1>
</div>
<div class="offset-lg-3 col-lg-6">
<p>Actual Stratis Blocks Height:
1039459
</p>
<p>Actual Stratis Blocks Height:
@(ViewBag.BlockchainHeight??"Loading...") <i class="fa fa-info-circle"></i>
</p>
</div>
</div>
</div>
...
...
wwwroot/css/default.css
View file @
8befcf9c
...
...
@@ -64,6 +64,7 @@ html, body {
background
:
#1b1d20
url("/images/prodnews-hero.png")
fixed
;
background-size
:
cover
;
box-shadow
:
inset
0px
0px
10em
rgba
(
0
,
0
,
0
,
0.6
);
height
:
100vh
;
}
a
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment