From 29e1870329740199cc48accc4141f8502af66d8f Mon Sep 17 00:00:00 2001 From: djbadders <34887832+djbadders@users.noreply.github.com> Date: Thu, 23 Jul 2020 19:25:43 +0100 Subject: [PATCH] Exposed new properties data correctly + fixed UI --- Core/DataObjects/PTMagicData.cs | 11 +---------- Core/DataObjects/ProfitTrailerData.cs | 10 +++++----- Monitor/Pages/_get/DashboardBottom.cshtml.cs | 1 + Monitor/Pages/_get/DashboardTop.cshtml | 10 +++++----- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/Core/DataObjects/PTMagicData.cs b/Core/DataObjects/PTMagicData.cs index 202b77b..c05e084 100644 --- a/Core/DataObjects/PTMagicData.cs +++ b/Core/DataObjects/PTMagicData.cs @@ -513,15 +513,6 @@ namespace Core.Main.DataObjects.PTMagicData public double DustValue { get; set; } public string Market { get; set; } } - public class PropertiesData - { - public string Currency { get; set; } - public bool Shorting { get; set; } - public bool Margin { get; set; } - public string UpTime { get; set; } - public int Port { get; set; } - public bool IsLeverageExchange { get; set; } - public string BaseUrl { get; set; } - } + #endregion } diff --git a/Core/DataObjects/ProfitTrailerData.cs b/Core/DataObjects/ProfitTrailerData.cs index 9cfa063..1beedc4 100644 --- a/Core/DataObjects/ProfitTrailerData.cs +++ b/Core/DataObjects/ProfitTrailerData.cs @@ -15,7 +15,7 @@ namespace Core.Main.DataObjects public class ProfitTrailerData { private SummaryData _summary = null; - private PropertiesData _properties = null; + private Properties _properties = null; private List _sellLog = new List(); private List _dcaLog = new List(); private List _buyLog = new List(); @@ -76,7 +76,7 @@ namespace Core.Main.DataObjects return _summary; } } - public PropertiesData Properties + public Properties Properties { get { @@ -87,7 +87,7 @@ namespace Core.Main.DataObjects // Thread double locking if (_properties == null || (DateTime.UtcNow > _propertiesRefresh)) { - _properties = BuildSummaryData(GetDataFromProfitTrailer("api/v2/data/properties")); + _properties = BuildProptertiesData(GetDataFromProfitTrailer("api/v2/data/properties")); _propertiesRefresh = DateTime.UtcNow.AddSeconds(_systemConfiguration.GeneralSettings.Monitor.RefreshSeconds - 1); } } @@ -307,9 +307,9 @@ namespace Core.Main.DataObjects DustValue = PTData.totalDustCurrentValue }; } - private PropertiesData BuildProptertiesData(dynamic PTProperties) + private Properties BuildProptertiesData(dynamic PTProperties) { - return new PropertiesData() + return new Properties() { Currency = PTProperties.currency, Shorting = PTProperties.shorting, diff --git a/Monitor/Pages/_get/DashboardBottom.cshtml.cs b/Monitor/Pages/_get/DashboardBottom.cshtml.cs index 1d86478..2622f93 100644 --- a/Monitor/Pages/_get/DashboardBottom.cshtml.cs +++ b/Monitor/Pages/_get/DashboardBottom.cshtml.cs @@ -132,6 +132,7 @@ namespace Monitor.Pages { int tradeDayIndex = 0; string profitPerDayJSON = ""; + if (PTData.SellLog.Count > 0) { DateTime minSellLogDate = PTData.SellLog.OrderBy(sl => sl.SoldDate).First().SoldDate.Date; diff --git a/Monitor/Pages/_get/DashboardTop.cshtml b/Monitor/Pages/_get/DashboardTop.cshtml index b1e0c91..be56fab 100644 --- a/Monitor/Pages/_get/DashboardTop.cshtml +++ b/Monitor/Pages/_get/DashboardTop.cshtml @@ -18,9 +18,9 @@ Market - 24H - Volume - Ask + 24H + Volume + Ask Buy Strategies @@ -60,8 +60,8 @@ @buyLogEntry.Market } @string.Format("{0}%", (buyLogEntry.PercChange * 100).ToString("#,#0.00")) - @string.Format("{0}", (buyLogEntry.Volume24).ToString()) - @buyLogEntry.CurrentPrice.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) + @string.Format("{0}", (buyLogEntry.Volume24h).ToString()) + @buyLogEntry.CurrentPrice.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) @if (buyDisabled) { @Html.Raw(buyStrategyText) } else {