From 42c2210c16b7d5efd504681eaee8428814a3c667 Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Wed, 9 Sep 2020 15:39:26 +0900 Subject: [PATCH] Manage SMS changes --- Monitor/Pages/ManageSMS.cshtml | 295 ++++++++++++++++-------------- Monitor/Pages/ManageSMS.cshtml.cs | 15 ++ PTMagic/Program.cs | 2 +- 3 files changed, 173 insertions(+), 139 deletions(-) diff --git a/Monitor/Pages/ManageSMS.cshtml b/Monitor/Pages/ManageSMS.cshtml index 9daf170..d9200d3 100644 --- a/Monitor/Pages/ManageSMS.cshtml +++ b/Monitor/Pages/ManageSMS.cshtml @@ -11,157 +11,176 @@
+
Market Name | -Last Price | -Volume | -Active Setting | -Triggered time | -Off Triggers | -Current Values | +Volume | +Last Price | +Active Setting | +Triggered time | +Off Triggers | +Current Value | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
- @if (!lastMarket.Equals(smsSummary.Market)) { - @smsSummary.Market + int activeSeconds = (int)Math.Floor(DateTime.UtcNow.Subtract(smsSummary.ActivationDateTimeUTC).TotalSeconds); + int activeHours = (int)Math.Floor(DateTime.UtcNow.Subtract(smsSummary.ActivationDateTimeUTC).TotalHours); + | |||||||||||||
+ @if (!lastMarket.Equals(smsSummary.Market)) { + @smsSummary.Market + } + | ++ @if (!lastMarket.Equals(smsSummary.Market)) { + @Math.Round(mps.Latest24hVolume, 0).ToString("#,#0", new System.Globalization.CultureInfo("en-US")) @Model.Summary.MainMarket + } + | ++ @if (!lastMarket.Equals(smsSummary.Market)) { + @mps.LatestPrice.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) @Model.Summary.MainMarket + } + | ++ @Core.Helper.SystemHelper.SplitCamelCase(smsSummary.SingleMarketSetting.SettingName) + | ++ @Core.Helper.SystemHelper.GetProperDurationTime(activeSeconds) + | +
+ @if (settingHasOffTriggers) {
+ foreach (Core.Main.DataObjects.PTMagicData.OffTrigger ot in smsSummary.SingleMarketSetting.OffTriggers) {
+ string triggerTextClass = "text-danger";
+ if (ot.HoursSinceTriggered > 0) {
+ triggerTextClass = (activeHours >= ot.HoursSinceTriggered) ? "text-success" : "text-danger";
+ Hours Since Triggered@ot.HoursSinceTriggered } - - | - @if (!lastMarket.Equals(smsSummary.Market)) { - @mps.LatestPrice.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) @Model.Summary.MainMarket - } - | -- @if (!lastMarket.Equals(smsSummary.Market)) { - @Math.Round(mps.Latest24hVolume, 0).ToString("#,#0", new System.Globalization.CultureInfo("en-US")) @Model.Summary.MainMarket - } - | -- @Core.Helper.SystemHelper.SplitCamelCase(smsSummary.SingleMarketSetting.SettingName) - | -- @Core.Helper.SystemHelper.GetProperDurationTime(activeSeconds) - | -
- @if (settingHasOffTriggers) {
- foreach (Core.Main.DataObjects.PTMagicData.OffTrigger ot in smsSummary.SingleMarketSetting.OffTriggers) {
- string triggerTextClass = "text-danger";
- if (ot.HoursSinceTriggered > 0) {
- triggerTextClass = (activeHours >= ot.HoursSinceTriggered) ? "text-success" : "text-danger";
- Hours Since Triggered@ot.HoursSinceTriggered - } - if (ot.Min24hVolume > 0 || ot.Max24hVolume < Core.Main.Constants.Max24hVolume) { - triggerTextClass = (mps.Latest24hVolume >= ot.Min24hVolume && mps.Latest24hVolume <= ot.Max24hVolume) ? "text-success" : "text-danger"; -- Volume - - @if (ot.Min24hVolume > 0) { - @("min: " + ot.Min24hVolume.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) + " " + Model.Summary.MainMarket) - } - @if (ot.Min24hVolume > 0 && ot.Max24hVolume < Core.Main.Constants.Max24hVolume) { - @(", ") - } - @if (ot.Max24hVolume < Core.Main.Constants.Max24hVolume) { - @("max: " + ot.Max24hVolume.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) + " " + Model.Summary.MainMarket) - } - - - } - if (ot.Max24hVolume < Core.Main.Constants.Max24hVolume) { - triggerTextClass = (mps.Latest24hVolume <= ot.Max24hVolume) ? "text-success" : "text-danger"; -Max 24h Volume@ot.Max24hVolume.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) @Model.Summary.MainMarket - } - if (!ot.MarketTrendName.Equals("")) { - double trendChange = Model.GetTrendChange(ot.MarketTrendName, mps, smsSummary.TriggerSnapshot, ot.MarketTrendRelation); - triggerTextClass = (trendChange >= ot.MinChange && trendChange <= ot.MaxChange) ? "text-success" : "text-danger"; -- @Core.Helper.SystemHelper.SplitCamelCase(ot.MarketTrendName) (@Core.Helper.SystemHelper.SplitCamelCase(ot.MarketTrendRelation)) - - @if (ot.MinChange > Core.Main.Constants.MinTrendChange) { - @("min: " + ot.MinChange.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")) + "%") - } - @if (ot.MinChange > Core.Main.Constants.MinTrendChange && ot.MaxChange < Core.Main.Constants.MaxTrendChange) { - @(", ") - } - @if (ot.MaxChange < Core.Main.Constants.MaxTrendChange) { - @("max: " + ot.MaxChange.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")) + "%") - } - - - } - } - } else { - Not specified - } - |
-
- @if (settingHasOffTriggers) {
- foreach (Core.Main.DataObjects.PTMagicData.OffTrigger ot in smsSummary.SingleMarketSetting.OffTriggers) {
- string triggerTextClass = "text-danger";
- if (ot.HoursSinceTriggered > 0) {
- triggerTextClass = (activeHours >= ot.HoursSinceTriggered) ? "text-success" : "text-danger";
- @activeHours.ToString(new System.Globalization.CultureInfo("en-US")) - } - if (ot.Min24hVolume > 0) { - triggerTextClass = (mps.Latest24hVolume >= ot.Min24hVolume) ? "text-success" : "text-danger"; -@Math.Round(mps.Latest24hVolume, 0).ToString("#,#0", new System.Globalization.CultureInfo("en-US")) @Model.Summary.MainMarket - } - if (ot.Max24hVolume < Core.Main.Constants.Max24hVolume) { - triggerTextClass = (mps.Latest24hVolume <= ot.Max24hVolume) ? "text-success" : "text-danger"; -@Math.Round(mps.Latest24hVolume, 0).ToString("#,#0", new System.Globalization.CultureInfo("en-US")) @Model.Summary.MainMarket - } - if (!ot.MarketTrendName.Equals("")) { - if (mps.MarketTrendChanges.ContainsKey(ot.MarketTrendName)) { - double trendChange = Model.GetTrendChange(ot.MarketTrendName, mps, smsSummary.TriggerSnapshot, ot.MarketTrendRelation); - triggerTextClass = (trendChange >= ot.MinChange && trendChange <= ot.MaxChange) ? "text-success" : "text-danger"; - string trendChangeOutput = trendChange.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")); -@trendChangeOutput% + if (ot.Min24hVolume > 0 || ot.Max24hVolume < Core.Main.Constants.Max24hVolume) { + triggerTextClass = (mps.Latest24hVolume >= ot.Min24hVolume && mps.Latest24hVolume <= ot.Max24hVolume) ? "text-success" : "text-danger"; ++ Volume + + @if (ot.Min24hVolume > 0) { + @("min: " + ot.Min24hVolume.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) + " " + Model.Summary.MainMarket) } - } + @if (ot.Min24hVolume > 0 && ot.Max24hVolume < Core.Main.Constants.Max24hVolume) { + @(", ") + } + @if (ot.Max24hVolume < Core.Main.Constants.Max24hVolume) { + @("max: " + ot.Max24hVolume.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) + " " + Model.Summary.MainMarket) + } + + + } + if (ot.Max24hVolume < Core.Main.Constants.Max24hVolume) { + triggerTextClass = (mps.Latest24hVolume <= ot.Max24hVolume) ? "text-success" : "text-danger"; +Max 24h Volume@ot.Max24hVolume.ToString("#,#0.00000000", new System.Globalization.CultureInfo("en-US")) @Model.Summary.MainMarket + } + if (!ot.MarketTrendName.Equals("")) { + double trendChange = Model.GetTrendChange(ot.MarketTrendName, mps, smsSummary.TriggerSnapshot, ot.MarketTrendRelation); + triggerTextClass = (trendChange >= ot.MinChange && trendChange <= ot.MaxChange) ? "text-success" : "text-danger"; ++ @Core.Helper.SystemHelper.SplitCamelCase(ot.MarketTrendName) (@Core.Helper.SystemHelper.SplitCamelCase(ot.MarketTrendRelation)) + + @if (ot.MinChange > Core.Main.Constants.MinTrendChange) { + @("min: " + ot.MinChange.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")) + "%") + } + @if (ot.MinChange > Core.Main.Constants.MinTrendChange && ot.MaxChange < Core.Main.Constants.MaxTrendChange) { + @(", ") + } + @if (ot.MaxChange < Core.Main.Constants.MaxTrendChange) { + @("max: " + ot.MaxChange.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")) + "%") + } + + + } + } + } else { + Not specified + } + |
+
+ @if (settingHasOffTriggers) {
+ foreach (Core.Main.DataObjects.PTMagicData.OffTrigger ot in smsSummary.SingleMarketSetting.OffTriggers) {
+ string triggerTextClass = "text-danger";
+ if (ot.HoursSinceTriggered > 0) {
+ triggerTextClass = (activeHours >= ot.HoursSinceTriggered) ? "text-success" : "text-danger";
+ @activeHours.ToString(new System.Globalization.CultureInfo("en-US")) + } + if (ot.Min24hVolume > 0) { + triggerTextClass = (mps.Latest24hVolume >= ot.Min24hVolume) ? "text-success" : "text-danger"; +@Math.Round(mps.Latest24hVolume, 0).ToString("#,#0", new System.Globalization.CultureInfo("en-US")) @Model.Summary.MainMarket + } + if (ot.Max24hVolume < Core.Main.Constants.Max24hVolume) { + triggerTextClass = (mps.Latest24hVolume <= ot.Max24hVolume) ? "text-success" : "text-danger"; +@Math.Round(mps.Latest24hVolume, 0).ToString("#,#0", new System.Globalization.CultureInfo("en-US")) @Model.Summary.MainMarket + } + if (!ot.MarketTrendName.Equals("")) { + if (mps.MarketTrendChanges.ContainsKey(ot.MarketTrendName)) { + double trendChange = Model.GetTrendChange(ot.MarketTrendName, mps, smsSummary.TriggerSnapshot, ot.MarketTrendRelation); + triggerTextClass = (trendChange >= ot.MinChange && trendChange <= ot.MaxChange) ? "text-success" : "text-danger"; + string trendChangeOutput = trendChange.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US")); +@trendChangeOutput% } } - |
- - @if (settingHasOffTriggers) { - @if (Model.PTMagicConfiguration.GeneralSettings.Monitor.IsPasswordProtected) { - Reset - } else { - Reset - } - } - | -