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
6c3ec9b6
Commit
6c3ec9b6
authored
Oct 17, 2018
by
Clint Mourlevat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving models in a directory
parent
352b90cc
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
15 deletions
+28
-15
HomeController.cs
Controllers/HomeController.cs
+2
-12
StratisAddressPayload.cs
Models/StratisAddressPayload.cs
+8
-0
Ticker.cs
Models/Ticker.cs
+7
-0
Startup.cs
Startup.cs
+5
-0
Generator.cshtml
Views/Home/Generator.cshtml
+1
-1
Index.cshtml
Views/Home/Index.cshtml
+4
-2
_ViewImports.cshtml
Views/_ViewImports.cshtml
+1
-0
No files found.
Controllers/HomeController.cs
View file @
6c3ec9b6
...
...
@@ -13,6 +13,7 @@ using NBitcoin;
using
Newtonsoft.Json
;
using
QRCoder
;
using
Stratis.Bitcoin.Networks
;
using
Stratis.Guru.Models
;
namespace
Stratis.Guru.Controllers
{
...
...
@@ -28,7 +29,7 @@ namespace Stratis.Guru.Controllers
public
IActionResult
Index
()
{
dynamic
coinmarketcap
=
JsonConvert
.
DeserializeObject
(
_memoryCache
.
Get
(
"Coinmarketcap"
).
ToString
());
return
View
(
new
Ticker
()
return
View
(
new
Ticker
{
UsdPrice
=
coinmarketcap
.
data
.
quotes
.
USD
.
price
});
...
...
@@ -74,15 +75,4 @@ namespace Stratis.Guru.Controllers
return
File
(
memoryStream
.
ToArray
(),
"image/png"
);
}
}
public
class
Ticker
{
public
double
UsdPrice
{
get
;
set
;
}
}
public
class
StratisAddressPayload
{
public
string
PrivateKey
{
get
;
set
;
}
public
string
PublicKey
{
get
;
set
;
}
}
}
\ No newline at end of file
Models/StratisAddressPayload.cs
0 → 100644
View file @
6c3ec9b6
namespace
Stratis.Guru.Models
{
public
class
StratisAddressPayload
{
public
string
PrivateKey
{
get
;
set
;
}
public
string
PublicKey
{
get
;
set
;
}
}
}
\ No newline at end of file
Models/Ticker.cs
0 → 100644
View file @
6c3ec9b6
namespace
Stratis.Guru.Models
{
public
class
Ticker
{
public
double
UsdPrice
{
get
;
set
;
}
}
}
\ No newline at end of file
Startup.cs
View file @
6c3ec9b6
using
System
;
using
System.Collections.Generic
;
using
System.Globalization
;
using
System.IO
;
using
System.Linq
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
Microsoft.AspNetCore.Builder
;
using
Microsoft.AspNetCore.Hosting
;
...
...
@@ -34,6 +36,9 @@ namespace Stratis.Guru
options
.
MinimumSameSitePolicy
=
SameSiteMode
.
None
;
});
Thread
.
CurrentThread
.
CurrentCulture
=
new
CultureInfo
(
"en-US"
);
Thread
.
CurrentThread
.
CurrentUICulture
=
new
CultureInfo
(
"en-US"
);
services
.
AddMemoryCache
();
services
.
AddHostedService
<
TickerService
>();
...
...
Views/Home/Generator.cshtml
View file @
6c3ec9b6
@model Stratis
.Guru.Controllers.Stratis
AddressPayload
@model StratisAddressPayload
@{
ViewBag.Title = "Stratis Address Generator";
Layout = "_Layout";
...
...
Views/Home/Index.cshtml
View file @
6c3ec9b6
@model
Stratis.Guru.Controllers.
Ticker
@model Ticker
@{
ViewBag.Title = "Online ticker for Stratis";
ViewData["Title"] = "Home Page";
...
...
@@ -10,7 +10,7 @@
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 align-self-center text-center">
<h1>The <strong>$STRAT</strong> price in realtime.</h1>
<h1 class="align-middle">
<div>
<div
class="d-block"
>
<span class="click-edit">1 STRAT</span> =
</div>
<span class="display-1 font-weight-bold">@(Model.UsdPrice.ToString("C2"))</span>
...
...
@@ -25,6 +25,8 @@
{
<script type="text/javascript">
$(document).ready(function() {
var stratisPrice = @Model.UsdPrice;
$(".click-edit").click(function() {
alert("ok");
})
...
...
Views/_ViewImports.cshtml
View file @
6c3ec9b6
@using Stratis.Guru
@using Stratis.Guru.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
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