Update to move age details under the market indicator on the bags list

This commit is contained in:
djbadders 2021-03-01 13:41:33 +00:00
parent 5410da6d15
commit 2efe2cabd0
2 changed files with 17 additions and 14 deletions

View File

@ -448,7 +448,7 @@ namespace Core.Helper
return result;
}
public static string GetProperDurationTime(int durationSeconds, bool includeDays = true)
public static string GetProperDurationTime(int durationSeconds, bool includeDays = true, bool shortOutput = false)
{
string result = "";
@ -476,7 +476,7 @@ namespace Core.Helper
result += minutes.ToString() + "m";
}
if (seconds > 0)
if ((!shortOutput && seconds > 0) || (shortOutput && days == 0))
{
if (minutes > 0 || hours > 0 || days > 0) result += " ";
result += seconds.ToString() + "s";

View File

@ -95,7 +95,6 @@
<thead>
<tr>
<th>Market</th>
<th class="text-left" data-toggle="tooltip" data-placement="top" title="How long the position has been open">Age</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="Total Buy Cost">Cost</th>
<th></th>
@ -114,7 +113,7 @@
mps = Model.Summary.MarketSummary[dcaLogEntry.Market];
}
string bagAgeText = Core.Helper.SystemHelper.GetProperDurationTime((int)Math.Ceiling(Model.DateTimeNow.Subtract(dcaLogEntry.FirstBoughtDate).TotalSeconds));
string bagAgeText = Core.Helper.SystemHelper.GetProperDurationTime((int)Math.Ceiling(Model.DateTimeNow.Subtract(dcaLogEntry.FirstBoughtDate).TotalSeconds), true, true);
bool dcaEnabled = true;
if (mps != null) {
@ -165,16 +164,20 @@
// Render the row
<tr @(lostValue ? "class=errorRow" : "") >
<!-- Market -->
<th class="align-top">
@if (mps == null || mps.ActiveSingleSettings == null || mps.ActiveSingleSettings.Count == 0)
{
<th class="align-top"><a href="@Core.Helper.SystemHelper.GetMarketLink(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform,Model.PTMagicConfiguration.GeneralSettings.Application.Exchange, dcaLogEntry.Market, Model.Summary.MainMarket)" target="_blank">@dcaLogEntry.Market</a></th>
<a href="@Core.Helper.SystemHelper.GetMarketLink(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform,Model.PTMagicConfiguration.GeneralSettings.Application.Exchange, dcaLogEntry.Market, Model.Summary.MainMarket)" target="_blank">@dcaLogEntry.Market</a>
} else
{
<th class="align-top"><a href="@Core.Helper.SystemHelper.GetMarketLink(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform,Model.PTMagicConfiguration.GeneralSettings.Application.Exchange, dcaLogEntry.Market, Model.Summary.MainMarket)" target="_blank">@dcaLogEntry.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>
<a href="@Core.Helper.SystemHelper.GetMarketLink(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform,Model.PTMagicConfiguration.GeneralSettings.Application.Exchange, dcaLogEntry.Market, Model.Summary.MainMarket)" target="_blank">@dcaLogEntry.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>
}
<!-- Age -->
<td>@bagAgeText</td>
<br>
@bagAgeText
</th>
<!-- 24hr change -->
<td class="text-autocolor">@Html.Raw((dcaLogEntry.PercChange * 100).ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")))%</td>
<!-- Cost -->