diff --git a/gaseous-server/Controllers/V1.0/SystemController.cs b/gaseous-server/Controllers/V1.0/SystemController.cs index 4cba7ff..09657fc 100644 --- a/gaseous-server/Controllers/V1.0/SystemController.cs +++ b/gaseous-server/Controllers/V1.0/SystemController.cs @@ -106,7 +106,8 @@ namespace gaseous_server.Controllers }) + ";" + Environment.NewLine + "var AgeRatingGroups = " + JsonSerializer.Serialize(AgeGroups.AgeGroupingsFlat, new JsonSerializerOptions{ WriteIndented = true - }) + ";"; + }) + ";" + Environment.NewLine + + "var emulatorDebugMode = " + Config.ReadSetting("emulatorDebugMode", false.ToString()).ToLower() + ";"; byte[] bytes = Encoding.UTF8.GetBytes(ver); return File(bytes, "text/javascript"); } @@ -251,7 +252,8 @@ namespace gaseous_server.Controllers { SystemSettingsModel systemSettingsModel = new SystemSettingsModel{ AlwaysLogToDisk = Config.LoggingConfiguration.AlwaysLogToDisk, - MinimumLogRetentionPeriod = Config.LoggingConfiguration.LogRetention + MinimumLogRetentionPeriod = Config.LoggingConfiguration.LogRetention, + EmulatorDebugMode = Boolean.Parse(Config.ReadSetting("emulatorDebugMode", false.ToString())) }; return Ok(systemSettingsModel); @@ -269,6 +271,7 @@ namespace gaseous_server.Controllers { Config.LoggingConfiguration.AlwaysLogToDisk = model.AlwaysLogToDisk; Config.LoggingConfiguration.LogRetention = model.MinimumLogRetentionPeriod; + Config.SetSetting("emulatorDebugMode", model.EmulatorDebugMode.ToString()); Config.UpdateConfig(); } @@ -705,5 +708,6 @@ namespace gaseous_server.Controllers { public bool AlwaysLogToDisk { get; set; } public int MinimumLogRetentionPeriod { get; set; } + public bool EmulatorDebugMode { get; set; } } } \ No newline at end of file diff --git a/gaseous-server/wwwroot/emulators/EmulatorJS.html b/gaseous-server/wwwroot/emulators/EmulatorJS.html index e4ef871..7baa7fc 100644 --- a/gaseous-server/wwwroot/emulators/EmulatorJS.html +++ b/gaseous-server/wwwroot/emulators/EmulatorJS.html @@ -28,7 +28,7 @@ // Path to the data directory EJS_pathtodata = '/emulators/EmulatorJS/data/'; - EJS_DEBUG_XX = false; + EJS_DEBUG_XX = emulatorDebugMode; console.log("Debug enabled: " + EJS_DEBUG_XX); EJS_backgroundImage = emuBackground; diff --git a/gaseous-server/wwwroot/pages/settings/settings.html b/gaseous-server/wwwroot/pages/settings/settings.html index 4d42d63..6e0a9d9 100644 --- a/gaseous-server/wwwroot/pages/settings/settings.html +++ b/gaseous-server/wwwroot/pages/settings/settings.html @@ -16,8 +16,11 @@
-

Logging

+

System Settings

+ + + + + + + + + +
Logging
Write logs @@ -43,9 +46,16 @@
Emulator
Enable debug mode
- +
@@ -379,7 +389,7 @@ saveTaskTimers(); } - function getLoggingSettings() { + function getSystemSettings() { ajaxCall( '/api/v1/System/Settings/System', 'GET', @@ -391,11 +401,13 @@ document.getElementById(optionToSelect).checked = true; document.getElementById('settings_logs_retention').value = result.minimumLogRetentionPeriod; + + document.getElementById('settings_emulator_debug').checked = result.emulatorDebugMode; } ); } - function setLoggingSettings() { + function setSystemSettings() { var alwaysLogToDisk = false; if ($("input[type='radio'][name='settings_logs_write']:checked").val() == "true") { alwaysLogToDisk = true; @@ -411,17 +423,18 @@ var model = { "alwaysLogToDisk": alwaysLogToDisk, - "minimumLogRetentionPeriod": retentionValue + "minimumLogRetentionPeriod": retentionValue, + "emulatorDebugMode": document.getElementById('settings_emulator_debug').checked }; ajaxCall( '/api/v1/System/Settings/System', 'POST', function(result) { - getLoggingSettings(); + getSystemSettings(); }, function(error) { - getLoggingSettings(); + getSystemSettings(); }, JSON.stringify(model) ); @@ -429,5 +442,5 @@ drawLibrary(); getBackgroundTaskTimers(); - getLoggingSettings(); + getSystemSettings(); \ No newline at end of file