From e098fffea8a3ced41a18d20bdb9097d47925f357 Mon Sep 17 00:00:00 2001 From: dkanada Date: Wed, 24 Apr 2019 23:59:44 -0700 Subject: [PATCH 1/2] deminify log page --- src/controllers/logpage.js | 39 ++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/src/controllers/logpage.js b/src/controllers/logpage.js index 4b288b288f..77274c62b7 100644 --- a/src/controllers/logpage.js +++ b/src/controllers/logpage.js @@ -3,27 +3,42 @@ define(["datetime", "loading", "apphost", "listViewStyle", "emby-button", "flexS return function(view, params) { view.querySelector("#chkDebugLog").addEventListener("change", function() { ApiClient.getServerConfiguration().then(function(config) { - config.EnableDebugLevelLogging = view.querySelector("#chkDebugLog").checked, ApiClient.updateServerConfiguration(config) + config.EnableDebugLevelLogging = view.querySelector("#chkDebugLog").checked; + ApiClient.updateServerConfiguration(config); }) - }), view.addEventListener("viewbeforeshow", function() { + }); + + view.addEventListener("viewbeforeshow", function() { loading.show(); var apiClient = ApiClient; apiClient.getJSON(apiClient.getUrl("System/Logs")).then(function(logs) { var html = ""; - html += '
', html += logs.map(function(log) { + html += '
'; + html += logs.map(function(log) { var logUrl = apiClient.getUrl("System/Logs/Log", { name: log.Name }); logUrl += "&api_key=" + apiClient.accessToken(); var logHtml = ""; - logHtml += '', logHtml += '
', logHtml += "

" + log.Name + "

"; - var date = datetime.parseISO8601Date(log.DateModified, !0), - text = datetime.toLocaleDateString(date); - return text += " " + datetime.getDisplayTime(date), logHtml += '
' + text + "
", logHtml += "
", logHtml += "
" - }).join(""), html += "
", view.querySelector(".serverLogs").innerHTML = html, loading.hide() - }), apiClient.getServerConfiguration().then(function(config) { - view.querySelector("#chkDebugLog").checked = config.EnableDebugLevelLogging - }) - }) + logHtml += ''; + logHtml += '
'; + logHtml += "

" + log.Name + "

"; + var date = datetime.parseISO8601Date(log.DateModified, true); + var text = datetime.toLocaleDateString(date); + text += " " + datetime.getDisplayTime(date); + logHtml += '
' + text + "
"; + logHtml += "
"; + logHtml += "
"; + return logHtml; + }).join(""); + html += "
"; + view.querySelector(".serverLogs").innerHTML = html; + loading.hide(); + }); + + apiClient.getServerConfiguration().then(function(config) { + view.querySelector("#chkDebugLog").checked = config.EnableDebugLevelLogging; + }); + }); } }); \ No newline at end of file From e5885dfd020db0aa72a68963893569e5abb540dd Mon Sep 17 00:00:00 2001 From: dkanada Date: Thu, 25 Apr 2019 00:02:06 -0700 Subject: [PATCH 2/2] remove option to enable debug logging --- src/controllers/logpage.js | 11 ----------- src/log.html | 13 ------------- 2 files changed, 24 deletions(-) diff --git a/src/controllers/logpage.js b/src/controllers/logpage.js index 77274c62b7..f5866f344c 100644 --- a/src/controllers/logpage.js +++ b/src/controllers/logpage.js @@ -1,13 +1,6 @@ define(["datetime", "loading", "apphost", "listViewStyle", "emby-button", "flexStyles"], function(datetime, loading, appHost) { "use strict"; return function(view, params) { - view.querySelector("#chkDebugLog").addEventListener("change", function() { - ApiClient.getServerConfiguration().then(function(config) { - config.EnableDebugLevelLogging = view.querySelector("#chkDebugLog").checked; - ApiClient.updateServerConfiguration(config); - }) - }); - view.addEventListener("viewbeforeshow", function() { loading.show(); var apiClient = ApiClient; @@ -35,10 +28,6 @@ define(["datetime", "loading", "apphost", "listViewStyle", "emby-button", "flexS view.querySelector(".serverLogs").innerHTML = html; loading.hide(); }); - - apiClient.getServerConfiguration().then(function(config) { - view.querySelector("#chkDebugLog").checked = config.EnableDebugLevelLogging; - }); }); } }); \ No newline at end of file diff --git a/src/log.html b/src/log.html index 7e76ea3c58..dd98b0d333 100644 --- a/src/log.html +++ b/src/log.html @@ -1,20 +1,7 @@
-
-
-
-
- -
${EnableDebugLoggingHelp}
-
-
-
-