Manage SMS changes

This commit is contained in:
HojouFotytu 2020-09-09 15:39:26 +09:00
parent 5feb9ca06f
commit 42c2210c16
3 changed files with 173 additions and 139 deletions

View File

@ -11,23 +11,43 @@
<div class="row">
<div class="col-sm-12">
<div class="card-box">
<h4 class="m-t-0 header-title"><b>Applied Single Market Setting Details</b></h4>
<h4 class="m-t-0 header-title"><b>Applied Single Market Settings</b></h4>
<tbody>
<p style="text-align: center;"><br>
<tr>
@{
Model.CreateSmsList();
foreach (string sms in Model.smsList)
{
int smsCount = 0;
foreach (Core.Main.DataObjects.PTMagicData.SingleMarketSettingSummary smsSummary in Model.SingleMarketSettingSummaries)
{
if (smsSummary.SingleMarketSetting.SettingName == sms)
{
smsCount = smsCount + 1;
}
}
<td><a href="@Html.Raw(Model.PTMagicConfiguration.GeneralSettings.Monitor.RootUrl)SettingsAnalyzer#SingleMarketSetting_@sms">@sms</a>:&nbsp;@smsCount &emsp; &emsp;</td>
}
}
</tr>
</p>
</tbody>
<br>
<table class="table table-striped table-sm m-b-0" h>
<thead>
<tr>
<th>Market Name</th>
<th class="text-right">Last Price</th>
<th class="text-right">Volume</th>
<th>Active Setting</th>
<th>Volume</th>
<th>Last Price</th>
<th class="text-right">Active Setting </th>
<th> Triggered time</th>
<th>Off Triggers</th>
<th class="text-right">Current Values</th>
<th class="text-center">Off Triggers</th>
<th class="text-center">Current Value</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
@{
string lastMarket = "";
}
@ -52,17 +72,17 @@
<a href="@Core.Helper.SystemHelper.GetMarketLink(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform, Model.PTMagicConfiguration.GeneralSettings.Application.Exchange, smsSummary.Market, Model.Summary.MainMarket)" target="_blank">@smsSummary.Market</a>
}
</th>
<td class="text-right">
@if (!lastMarket.Equals(smsSummary.Market)) {
<span>@mps.LatestPrice.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) @Model.Summary.MainMarket</span>
}
</td>
<td class="text-right">
<td>
@if (!lastMarket.Equals(smsSummary.Market)) {
<span>@Math.Round(mps.Latest24hVolume, 0).ToString("#,#0", new System.Globalization.CultureInfo("en-US")) @Model.Summary.MainMarket</span>
}
</td>
<td>
@if (!lastMarket.Equals(smsSummary.Market)) {
<span>@mps.LatestPrice.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) @Model.Summary.MainMarket</span>
}
</td>
<td class="text-right">
@Core.Helper.SystemHelper.SplitCamelCase(smsSummary.SingleMarketSetting.SettingName)
</td>
<td>
@ -120,7 +140,7 @@
<i class="text-warning">Not specified</i> <i class="fa fa-info-circle text-muted" data-toggle="tooltip" data-placement="top" title="This setting has no Off Triggers so it will stay active until its triggers are no longer matched."></i>
}
</td>
<td class="text-right">
<td class="text-center">
@if (settingHasOffTriggers) {
foreach (Core.Main.DataObjects.PTMagicData.OffTrigger ot in smsSummary.SingleMarketSetting.OffTriggers) {
string triggerTextClass = "text-danger";
@ -161,7 +181,6 @@
}
</tbody>
</table>
</div>
</div>
</div>

View File

@ -1,4 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@ -20,6 +21,20 @@ namespace Monitor.Pages
BindData();
}
public List<string> smsList = new List<string>();
public void CreateSmsList ()
{
foreach (Core.Main.DataObjects.PTMagicData.SingleMarketSettingSummary smsSummary in SingleMarketSettingSummaries)
{
if (!smsList.Contains(smsSummary.SingleMarketSetting.SettingName))
{
smsList.Add(smsSummary.SingleMarketSetting.SettingName);
}
}
}
private void BindData()
{
if (System.IO.File.Exists(PTMagicBasePath + Constants.PTMagicPathData + Path.DirectorySeparatorChar + "SingleMarketSettingSummary.json"))

View File

@ -6,7 +6,7 @@ using Core.Helper;
using Microsoft.Extensions.DependencyInjection;
[assembly: AssemblyVersion("2.4.5")]
[assembly: AssemblyVersion("2.4.6")]
[assembly: AssemblyProduct("PT Magic")]
namespace PTMagic