Merge pull request #283 from djbadders/develop

Added age column to bags
This commit is contained in:
HojouFotytu 2021-03-03 13:04:01 +09:00 committed by GitHub
commit 2626de0e4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 10 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

@ -94,7 +94,7 @@
<table class="table table-sm m-b-0">
<thead>
<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="Total Buy Cost">Cost</th>
<th></th>
@ -113,6 +113,8 @@
mps = Model.Summary.MarketSummary[dcaLogEntry.Market];
}
string bagAgeText = Core.Helper.SystemHelper.GetProperDurationTime((int)Math.Ceiling(Model.DateTimeNow.Subtract(dcaLogEntry.FirstBoughtDate).TotalSeconds), true, true);
bool dcaEnabled = true;
if (mps != null) {
dcaEnabled = mps.IsDCAEnabled;
@ -162,14 +164,22 @@
// Render the row
<tr @(lostValue ? "class=errorRow" : "") >
<!-- Market -->
@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>
} 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>
}
<td class="align-top">
<b>
@if (mps == null || mps.ActiveSingleSettings == null || mps.ActiveSingleSettings.Count == 0)
{
<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
{
<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>
}
</b>
<br>
@bagAgeText
</td>
<!-- 24hr change -->
<td class="text-autocolor">@Html.Raw((dcaLogEntry.PercChange * 100).ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")))%</td>
<!-- Cost -->