mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
copy dashboard to the output folder and load from the file system, instead of using embedded resources
This commit is contained in:
parent
799eebc9ed
commit
4dd9477bcd
137 changed files with 1424 additions and 1438 deletions
|
@ -1,86 +0,0 @@
|
|||
var LogPage = {
|
||||
|
||||
onPageShow: function () {
|
||||
|
||||
LogPage.startLine = 0;
|
||||
|
||||
$('#logContents', this).html('');
|
||||
|
||||
$(document).on("websocketmessage", LogPage.onWebSocketMessage).on("websocketopen", LogPage.onWebSocketConnectionChange).on("websocketerror", LogPage.onWebSocketConnectionChange).on("websocketclose", LogPage.onWebSocketConnectionChange);
|
||||
|
||||
LogPage.startInterval();
|
||||
|
||||
var autoScroll = localStorage.getItem("autoScrollLogPage");
|
||||
|
||||
if (autoScroll == "true") {
|
||||
LogPage.updateAutoScroll(true);
|
||||
}
|
||||
else if (autoScroll == "false") {
|
||||
LogPage.updateAutoScroll(false);
|
||||
}
|
||||
},
|
||||
|
||||
onPageHide: function () {
|
||||
|
||||
$(document).off("websocketmessage", LogPage.onWebSocketMessage).off("websocketopen", LogPage.onWebSocketConnectionChange).off("websocketerror", LogPage.onWebSocketConnectionChange).off("websocketclose", LogPage.onWebSocketConnectionChange);
|
||||
|
||||
LogPage.stopInterval();
|
||||
},
|
||||
|
||||
startInterval: function () {
|
||||
|
||||
if (Dashboard.isWebSocketOpen()) {
|
||||
Dashboard.sendWebSocketMessage("LogFileStart", "0,2000");
|
||||
}
|
||||
},
|
||||
|
||||
stopInterval: function () {
|
||||
|
||||
if (Dashboard.isWebSocketOpen()) {
|
||||
Dashboard.sendWebSocketMessage("LogFileStop");
|
||||
}
|
||||
},
|
||||
|
||||
onWebSocketConnectionChange: function () {
|
||||
LogPage.stopInterval();
|
||||
LogPage.startInterval();
|
||||
},
|
||||
|
||||
onWebSocketMessage: function (e, msg) {
|
||||
|
||||
if (msg.MessageType == "LogFile") {
|
||||
LogPage.appendLines(msg.Data);
|
||||
}
|
||||
},
|
||||
|
||||
appendLines: function (lines) {
|
||||
|
||||
if (!lines.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
LogPage.startLine += lines.length;
|
||||
|
||||
lines = lines.join('\n') + '\n';
|
||||
|
||||
var elem = $('#logContents', $.mobile.activePage).append(lines)[0];
|
||||
|
||||
elem.style.height = (elem.scrollHeight) + 'px';
|
||||
|
||||
if ($('#chkAutoScroll', $.mobile.activePage).checked()) {
|
||||
$('html, body').animate({ scrollTop: $(document).height() }, 'slow');
|
||||
}
|
||||
},
|
||||
|
||||
updateAutoScroll: function (value) {
|
||||
|
||||
var page = $.mobile.activePage;
|
||||
|
||||
$('#chkAutoScrollBottom', page).checked(value).checkboxradio('refresh');
|
||||
$('#chkAutoScroll', page).checked(value).checkboxradio('refresh');
|
||||
|
||||
localStorage.setItem("autoScrollLogPage", value.toString());
|
||||
}
|
||||
};
|
||||
|
||||
$(document).on('pageshow', "#logPage", LogPage.onPageShow).on('pagehide', "#logPage", LogPage.onPageHide);
|
Loading…
Add table
Add a link
Reference in a new issue