From c02b16b948e71d629ac07f59c8e9d4fa46624925 Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Wed, 21 Apr 2021 15:33:07 +0900 Subject: [PATCH] Settings GUI changes --- Core/Main/PTMagic.cs | 19 +++++++------ Monitor/Pages/SettingsGeneral.cshtml | 37 ++++++++++++------------- Monitor/Pages/SettingsGeneral.cshtml.cs | 10 +++---- PTMagic/Program.cs | 2 +- 4 files changed, 35 insertions(+), 33 deletions(-) diff --git a/Core/Main/PTMagic.cs b/Core/Main/PTMagic.cs index 7001425..29b198d 100644 --- a/Core/Main/PTMagic.cs +++ b/Core/Main/PTMagic.cs @@ -701,13 +701,13 @@ namespace Core.Main // Check if the program is enabled if (this.PTMagicConfiguration.GeneralSettings.Application.IsEnabled) { + result = RunProfitTrailerSettingsAPIChecks(); try { if (this.PTMagicConfiguration.GeneralSettings.Application.TestMode) { - this.Log.DoLogInfo("TESTMODE ENABLED - No files will be changed!"); + this.Log.DoLogWarn("TESTMODE ENABLED - No PT settings will be changed!"); } - result = RunProfitTrailerSettingsAPIChecks(); // Check for CoinMarketCap API Key if (!String.IsNullOrEmpty(this.PTMagicConfiguration.GeneralSettings.Application.CoinMarketCapAPIKey)) @@ -731,7 +731,7 @@ namespace Core.Main } catch (System.NullReferenceException) { - this.Log.DoLogError("PTM failed to read the Config File. That means something in the File is either missing or incorrect. If this happend after an update please take a look at the release notes at: https://github.com/PTMagicians/PTMagic/releases"); + this.Log.DoLogError("PTM failed to read the General Settings file. That means something in the file is either missing or incorrect. If this happend after an update please take a look at the release notes at: https://github.com/PTMagicians/PTMagic/releases"); Console.WriteLine("Press enter to close the Application..."); Console.ReadLine(); Environment.Exit(0); @@ -739,7 +739,7 @@ namespace Core.Main } else { - this.Log.DoLogWarn("PTMagic disabled, shutting down..."); + this.Log.DoLogWarn("PTMagic is disabled. The scheduled raid was skipped."); result = false; } @@ -952,7 +952,7 @@ namespace Core.Main this.Log.DoLogInfo("+ Active setting: " + this.LastRuntimeSummary.CurrentGlobalSetting.SettingName); this.Log.DoLogInfo("+ Global setting changed: " + ((this.LastRuntimeSummary.LastGlobalSettingSwitch == this.LastRuntimeSummary.LastRuntime) ? "Yes" : "No") + " " + ((this.LastRuntimeSummary.FloodProtectedSetting != null) ? "(Flood protection!)" : "")); this.Log.DoLogInfo("+ Single Market Settings changed: " + (this.SingleMarketSettingChanged ? "Yes" : "No")); - this.Log.DoLogInfo("+ PT Config updated: " + (((this.GlobalSettingWritten || this.SingleMarketSettingChanged) && !this.PTMagicConfiguration.GeneralSettings.Application.TestMode) ? "Yes" : "No")); + this.Log.DoLogInfo("+ PT Config updated: " + (((this.GlobalSettingWritten || this.SingleMarketSettingChanged) && !this.PTMagicConfiguration.GeneralSettings.Application.TestMode) ? "Yes" : "No") + ((this.PTMagicConfiguration.GeneralSettings.Application.TestMode) ? " - TESTMODE active" : "")); this.Log.DoLogInfo("+ Markets with active single market settings: " + this.TriggeredSingleMarketSettings.Count.ToString()); foreach (string activeSMS in this.SingleMarketSettingsCount.Keys) { @@ -969,7 +969,7 @@ namespace Core.Main else { this.State = Constants.PTMagicBotState_Idle; - Log.DoLogWarn("PTMagic disabled, shutting down until next raid..."); + Log.DoLogWarn("PTMagic is disabled. The scheduled raid was skipped."); } } catch (Exception ex) @@ -2194,9 +2194,12 @@ namespace Core.Main if (!this.PTMagicConfiguration.GeneralSettings.Application.TestMode) { SettingsAPI.SendPropertyLinesToAPI(this.PairsLines, this.DCALines, this.IndicatorsLines, this.PTMagicConfiguration, this.Log); + this.Log.DoLogInfo("Settings updates sent to PT!"); + } + else + { + this.Log.DoLogWarn("TESTMODE enabled -- no updates sent to PT!"); } - - this.Log.DoLogInfo("Properties saved!"); } else { diff --git a/Monitor/Pages/SettingsGeneral.cshtml b/Monitor/Pages/SettingsGeneral.cshtml index bd8a46a..20f0d27 100644 --- a/Monitor/Pages/SettingsGeneral.cshtml +++ b/Monitor/Pages/SettingsGeneral.cshtml @@ -48,24 +48,30 @@