diff --git a/src/controllers/dashboard/logs.html b/src/controllers/dashboard/logs.html index 5943f5dc08..c0ab76d9a4 100644 --- a/src/controllers/dashboard/logs.html +++ b/src/controllers/dashboard/logs.html @@ -1,6 +1,31 @@
+
+
+
+

${TabLogs}

+
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
diff --git a/src/controllers/dashboard/logs.js b/src/controllers/dashboard/logs.js index 2f9882c228..8d2602fa99 100644 --- a/src/controllers/dashboard/logs.js +++ b/src/controllers/dashboard/logs.js @@ -1,12 +1,32 @@ import datetime from '../../scripts/datetime'; import loading from '../../components/loading/loading'; +import globalize from '../../scripts/globalize'; import '../../elements/emby-button/emby-button'; import '../../components/listview/listview.scss'; import '../../assets/css/flexstyles.scss'; +import Dashboard from '../../scripts/clientUtils'; +import alert from '../../components/alert'; /* eslint-disable indent */ + function onSubmit() { + loading.show(); + const form = this; + ApiClient.getServerConfiguration().then(function (config) { + config.EnableSlowResponseWarning = form.querySelector('#chkSlowResponseWarning').checked; + config.SlowResponseThresholdMs = form.querySelector('#txtSlowResponseWarning').value; + ApiClient.updateServerConfiguration(config).then(function() { + Dashboard.processServerConfigurationUpdateResult(); + }, function () { + alert(globalize.translate('ErrorDefault')); + Dashboard.processServerConfigurationUpdateResult(); + }); + }); + return false; + } + export default function(view) { + view.querySelector('.logsForm').addEventListener('submit', onSubmit); view.addEventListener('viewbeforeshow', function() { loading.show(); const apiClient = ApiClient; @@ -32,8 +52,14 @@ import '../../assets/css/flexstyles.scss'; }).join(''); html += '
'; view.querySelector('.serverLogs').innerHTML = html; - loading.hide(); }); + + apiClient.getServerConfiguration().then(function (config) { + view.querySelector('#chkSlowResponseWarning').checked = config.EnableSlowResponseWarning; + view.querySelector('#txtSlowResponseWarning').value = config.SlowResponseThresholdMs; + }); + + loading.hide(); }); } diff --git a/src/strings/en-us.json b/src/strings/en-us.json index d58e3cd94e..9e4132e586 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -823,6 +823,8 @@ "LabelSkipIfAudioTrackPresentHelp": "Uncheck this to ensure all videos have subtitles, regardless of audio language.", "LabelSkipIfGraphicalSubsPresent": "Skip if the video already contains embedded subtitles", "LabelSkipIfGraphicalSubsPresentHelp": "Keeping text versions of subtitles will result in more efficient delivery and decrease the likelihood of video transcoding.", + "LabelSlowResponseEnabled": "Log warning if server response was slow", + "LabelSlowResponseTime": "Time in ms after which a response is considered slow", "LabelSonyAggregationFlags": "Sony aggregation flags:", "LabelSonyAggregationFlagsHelp": "Determines the content of the aggregationFlags element in the urn:schemas-sonycom:av namespace.", "LabelSortBy": "Sort by:",