mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
commit
7cec3dfb53
12 changed files with 256 additions and 110 deletions
|
@ -1,33 +0,0 @@
|
|||
<div id="logPage" data-role="page" class="page type-interior" data-title="${TabLogs}">
|
||||
<div>
|
||||
<div class="content-primary">
|
||||
<form class="logsForm">
|
||||
<div class="verticalSection">
|
||||
<div class="sectionTitleContainer flex align-items-center">
|
||||
<h2 class="sectionTitle">${TabLogs}</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="verticalSection">
|
||||
<div class="checkboxContainer checkboxContainer-withDescription">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" id="chkSlowResponseWarning" />
|
||||
<span>${LabelSlowResponseEnabled}</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="inputContainer">
|
||||
<input is="emby-input" type="number" id="txtSlowResponseWarning" label="${LabelSlowResponseTime}" />
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<button is="emby-button" type="submit" class="raised button-submit block">
|
||||
<span>${Save}</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="serverLogs readOnlyContent">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,63 +0,0 @@
|
|||
import datetime from '../../scripts/datetime';
|
||||
import loading from '../../components/loading/loading';
|
||||
import globalize from '../../lib/globalize';
|
||||
import '../../elements/emby-button/emby-button';
|
||||
import '../../components/listview/listview.scss';
|
||||
import '../../styles/flexstyles.scss';
|
||||
import Dashboard from '../../utils/dashboard';
|
||||
import alert from '../../components/alert';
|
||||
|
||||
function onSubmit(event) {
|
||||
event.preventDefault();
|
||||
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;
|
||||
apiClient.getJSON(apiClient.getUrl('System/Logs')).then(function(logs) {
|
||||
let html = '';
|
||||
html += '<div class="paperList">';
|
||||
html += logs.map(function(log) {
|
||||
let logUrl = apiClient.getUrl('System/Logs/Log', {
|
||||
name: log.Name
|
||||
});
|
||||
logUrl += '&api_key=' + apiClient.accessToken();
|
||||
let 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' dir='ltr' style='text-align: left'>" + log.Name + '</h3>';
|
||||
const date = datetime.parseISO8601Date(log.DateModified, true);
|
||||
let text = datetime.toLocaleDateString(date);
|
||||
text += ' ' + datetime.getDisplayTime(date);
|
||||
logHtml += '<div class="listItemBodyText secondary">' + text + '</div>';
|
||||
logHtml += '</div>';
|
||||
logHtml += '</a>';
|
||||
return logHtml;
|
||||
}).join('');
|
||||
html += '</div>';
|
||||
view.querySelector('.serverLogs').innerHTML = html;
|
||||
});
|
||||
|
||||
apiClient.getServerConfiguration().then(function (config) {
|
||||
view.querySelector('#chkSlowResponseWarning').checked = config.EnableSlowResponseWarning;
|
||||
view.querySelector('#txtSlowResponseWarning').value = config.SlowResponseThresholdMs;
|
||||
});
|
||||
|
||||
loading.hide();
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue