Commit 6c3ec9b6 authored by Clint Mourlevat's avatar Clint Mourlevat

Moving models in a directory

parent 352b90cc
......@@ -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
namespace Stratis.Guru.Models
{
public class StratisAddressPayload
{
public string PrivateKey { get; set; }
public string PublicKey { get; set; }
}
}
\ No newline at end of file
namespace Stratis.Guru.Models
{
public class Ticker
{
public double UsdPrice { get; set; }
}
}
\ No newline at end of file
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>();
......
@model Stratis.Guru.Controllers.StratisAddressPayload
@model StratisAddressPayload
@{
ViewBag.Title = "Stratis Address Generator";
Layout = "_Layout";
......
@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");
})
......
@using Stratis.Guru
@using Stratis.Guru.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
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