Merge pull request #212 from djbadders/develop

Exposed new properties data correctly + fixed UI
This commit is contained in:
HojouFotytu 2020-07-24 14:01:11 +09:00 committed by GitHub
commit 3132433e23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 18 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

@ -128,6 +128,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,8 +18,8 @@
<thead> <thead>
<tr> <tr>
<th>Market</th> <th>Market</th>
<th class="text-left" 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-left" 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-left" 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>
@ -61,7 +61,8 @@
} }
<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.Volume24h).ToString())</td> <td class="text">@string.Format("{0}", (buyLogEntry.Volume24h).ToString())</td>
<td class="text-">@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 {