Exposed new properties data correctly + fixed UI

This commit is contained in:
djbadders 2020-07-23 19:25:43 +01:00
parent cf0834a61f
commit 29e1870329
4 changed files with 12 additions and 20 deletions

View File

@ -513,15 +513,6 @@ namespace Core.Main.DataObjects.PTMagicData
public double DustValue { get; set; } public double DustValue { get; set; }
public string Market { 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 #endregion
} }

View File

@ -15,7 +15,7 @@ namespace Core.Main.DataObjects
public class ProfitTrailerData public class ProfitTrailerData
{ {
private SummaryData _summary = null; private SummaryData _summary = null;
private PropertiesData _properties = null; private Properties _properties = null;
private List<SellLogData> _sellLog = new List<SellLogData>(); private List<SellLogData> _sellLog = new List<SellLogData>();
private List<DCALogData> _dcaLog = new List<DCALogData>(); private List<DCALogData> _dcaLog = new List<DCALogData>();
private List<BuyLogData> _buyLog = new List<BuyLogData>(); private List<BuyLogData> _buyLog = new List<BuyLogData>();
@ -76,7 +76,7 @@ namespace Core.Main.DataObjects
return _summary; return _summary;
} }
} }
public PropertiesData Properties public Properties Properties
{ {
get get
{ {
@ -87,7 +87,7 @@ namespace Core.Main.DataObjects
// Thread double locking // Thread double locking
if (_properties == null || (DateTime.UtcNow > _propertiesRefresh)) 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); _propertiesRefresh = DateTime.UtcNow.AddSeconds(_systemConfiguration.GeneralSettings.Monitor.RefreshSeconds - 1);
} }
} }
@ -307,9 +307,9 @@ namespace Core.Main.DataObjects
DustValue = PTData.totalDustCurrentValue DustValue = PTData.totalDustCurrentValue
}; };
} }
private PropertiesData BuildProptertiesData(dynamic PTProperties) private Properties BuildProptertiesData(dynamic PTProperties)
{ {
return new PropertiesData() return new Properties()
{ {
Currency = PTProperties.currency, Currency = PTProperties.currency,
Shorting = PTProperties.shorting, Shorting = PTProperties.shorting,

View File

@ -132,6 +132,7 @@ namespace Monitor.Pages
{ {
int tradeDayIndex = 0; int tradeDayIndex = 0;
string profitPerDayJSON = ""; string profitPerDayJSON = "";
if (PTData.SellLog.Count > 0) if (PTData.SellLog.Count > 0)
{ {
DateTime minSellLogDate = PTData.SellLog.OrderBy(sl => sl.SoldDate).First().SoldDate.Date; DateTime minSellLogDate = PTData.SellLog.OrderBy(sl => sl.SoldDate).First().SoldDate.Date;

View File

@ -18,9 +18,9 @@
<thead> <thead>
<tr> <tr>
<th>Market</th> <th>Market</th>
<th class="text-center" data-toggle="tooltip" data-placement="top" title="24 Hour Trend">24H</th> <th class="text-left" data-toggle="tooltip" data-placement="top" title="24 Hour price trend">24H</th>
<th class="text-center" data-toggle="tooltip" data-placement="top" title="Current Volume">Volume</th> <th class="text-left" data-toggle="tooltip" data-placement="top" title="24 Hour trading volume">Volume</th>
<th class="text-center" data-toggle="tooltip" data-placement="top" title="Current ask price for this market">Ask</th> <th class="text-left" data-toggle="tooltip" data-placement="top" title="Current ask price for this market">Ask</th>
<th>Buy Strategies</th> <th>Buy Strategies</th>
</tr> </tr>
</thead> </thead>
@ -60,8 +60,8 @@
<th class="align-top"><a href="@Core.Helper.SystemHelper.GetMarketLink(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform,Model.PTMagicConfiguration.GeneralSettings.Application.Exchange, buyLogEntry.Market, Model.Summary.MainMarket)" target="_blank">@buyLogEntry.Market</a> <i class="fa fa-exclamation-triangle text-highlight" data-toggle="tooltip" data-placement="top" data-html="true" title="@await Component.InvokeAsync("PairIcon", mps)" data-template="<div class='tooltip' role='tooltip'><div class='tooltip-arrow'></div><div class='tooltip-inner pair-tooltip'></div></div>"></i></th> <th class="align-top"><a href="@Core.Helper.SystemHelper.GetMarketLink(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform,Model.PTMagicConfiguration.GeneralSettings.Application.Exchange, buyLogEntry.Market, Model.Summary.MainMarket)" target="_blank">@buyLogEntry.Market</a> <i class="fa fa-exclamation-triangle text-highlight" data-toggle="tooltip" data-placement="top" data-html="true" title="@await Component.InvokeAsync("PairIcon", mps)" data-template="<div class='tooltip' role='tooltip'><div class='tooltip-arrow'></div><div class='tooltip-inner pair-tooltip'></div></div>"></i></th>
} }
<td class="text-autocolor">@string.Format("{0}%", (buyLogEntry.PercChange * 100).ToString("#,#0.00"))</td> <td class="text-autocolor">@string.Format("{0}%", (buyLogEntry.PercChange * 100).ToString("#,#0.00"))</td>
<td class="text">@string.Format("{0}", (buyLogEntry.Volume24).ToString())</td> <td class="text">@string.Format("{0}", (buyLogEntry.Volume24h).ToString())</td>
<td class="text-right">@buyLogEntry.CurrentPrice.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US"))</td> <td class="text-left">@buyLogEntry.CurrentPrice.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US"))</td>
@if (buyDisabled) { @if (buyDisabled) {
<td>@Html.Raw(buyStrategyText)</td> <td>@Html.Raw(buyStrategyText)</td>
} else { } else {