1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #272 from dkanada/log

Remove option to enable debug logging
This commit is contained in:
Anthony Lavado 2019-04-29 23:59:31 -04:00 committed by GitHub
commit d5200f78b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 28 deletions

View file

@ -1,29 +1,33 @@
define(["datetime", "loading", "apphost", "listViewStyle", "emby-button", "flexStyles"], function(datetime, loading, appHost) { define(["datetime", "loading", "apphost", "listViewStyle", "emby-button", "flexStyles"], function(datetime, loading, appHost) {
"use strict"; "use strict";
return function(view, params) { return function(view, params) {
view.querySelector("#chkDebugLog").addEventListener("change", function() { view.addEventListener("viewbeforeshow", function() {
ApiClient.getServerConfiguration().then(function(config) {
config.EnableDebugLevelLogging = view.querySelector("#chkDebugLog").checked, ApiClient.updateServerConfiguration(config)
})
}), view.addEventListener("viewbeforeshow", function() {
loading.show(); loading.show();
var apiClient = ApiClient; var apiClient = ApiClient;
apiClient.getJSON(apiClient.getUrl("System/Logs")).then(function(logs) { apiClient.getJSON(apiClient.getUrl("System/Logs")).then(function(logs) {
var html = ""; var html = "";
html += '<div class="paperList">', html += logs.map(function(log) { html += '<div class="paperList">';
html += logs.map(function(log) {
var logUrl = apiClient.getUrl("System/Logs/Log", { var logUrl = apiClient.getUrl("System/Logs/Log", {
name: log.Name name: log.Name
}); });
logUrl += "&api_key=" + apiClient.accessToken(); logUrl += "&api_key=" + apiClient.accessToken();
var logHtml = ""; var logHtml = "";
logHtml += '<a is="emby-linkbutton" href="' + logUrl + '" target="_blank" class="listItem listItem-border" style="color:inherit;">', logHtml += '<div class="listItemBody two-line">', logHtml += "<h3 class='listItemBodyText'>" + log.Name + "</h3>"; logHtml += '<a is="emby-linkbutton" href="' + logUrl + '" target="_blank" class="listItem listItem-border" style="color:inherit;">';
var date = datetime.parseISO8601Date(log.DateModified, !0), logHtml += '<div class="listItemBody two-line">';
text = datetime.toLocaleDateString(date); logHtml += "<h3 class='listItemBodyText'>" + log.Name + "</h3>";
return text += " " + datetime.getDisplayTime(date), logHtml += '<div class="listItemBodyText secondary">' + text + "</div>", logHtml += "</div>", logHtml += "</a>" var date = datetime.parseISO8601Date(log.DateModified, true);
}).join(""), html += "</div>", view.querySelector(".serverLogs").innerHTML = html, loading.hide() var text = datetime.toLocaleDateString(date);
}), apiClient.getServerConfiguration().then(function(config) { text += " " + datetime.getDisplayTime(date);
view.querySelector("#chkDebugLog").checked = config.EnableDebugLevelLogging logHtml += '<div class="listItemBodyText secondary">' + text + "</div>";
}) logHtml += "</div>";
}) logHtml += "</a>";
return logHtml;
}).join("");
html += "</div>";
view.querySelector(".serverLogs").innerHTML = html;
loading.hide();
});
});
} }
}); });

View file

@ -1,20 +1,7 @@
<div id="logPage" data-role="page" class="page type-interior"> <div id="logPage" data-role="page" class="page type-interior">
<div> <div>
<div class="content-primary"> <div class="content-primary">
<div class="readOnlyContent">
<div class="flex padded-top">
<div class="checkboxContainer checkboxContainer-withDescription">
<label style="width:auto;">
<input type="checkbox" is="emby-checkbox" id="chkDebugLog" />
<span>${LabelEnableDebugLogging}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${EnableDebugLoggingHelp}</div>
</div>
</div>
</div>
<div class="serverLogs readOnlyContent"> <div class="serverLogs readOnlyContent">
</div> </div>
</div> </div>
</div> </div>