mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
added dashboard info page
This commit is contained in:
parent
0073dc3476
commit
1fa7dcdb2b
8 changed files with 125 additions and 63 deletions
40
dashboard-ui/scripts/dashboardinfo.js
Normal file
40
dashboard-ui/scripts/dashboardinfo.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
(function ($, document, window) {
|
||||
|
||||
function loadPage(page, systemInfo) {
|
||||
|
||||
$('#cachePath', page).html(systemInfo.CachePath);
|
||||
$('#logPath', page).html(systemInfo.LogPath);
|
||||
$('#imagesByNamePath', page).html(systemInfo.ItemsByNamePath);
|
||||
$('#transcodingTemporaryPath', page).html(systemInfo.TranscodingTempPath);
|
||||
|
||||
var url = ApiClient.serverAddress() + "/mediabrowser";
|
||||
|
||||
$('#bookmarkUrl', page).html(url).attr("href", url);
|
||||
|
||||
if (systemInfo.WanAddress) {
|
||||
|
||||
var externalUrl = systemInfo.WanAddress + "/mediabrowser";
|
||||
|
||||
$('.externalUrl', page).html('External url: <a href="' + externalUrl + '" target="_blank">' + externalUrl + '</a>').show().trigger('create');
|
||||
} else {
|
||||
$('.externalUrl', page).hide();
|
||||
}
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#dashboardInfoPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getSystemInfo().done(function (systemInfo) {
|
||||
|
||||
loadPage(page, systemInfo);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})(jQuery, document, window);
|
|
@ -347,15 +347,6 @@
|
|||
$('#ports', page).html('Running on ports <b>' + port + '</b> and <b>' + dashboardInfo.SystemInfo.WebSocketPortNumber + '</b>');
|
||||
}
|
||||
|
||||
$('#logPath', page).html(dashboardInfo.SystemInfo.LogPath);
|
||||
$('#imagesByNamePath', page).html(dashboardInfo.SystemInfo.ItemsByNamePath);
|
||||
|
||||
var host = ApiClient.serverHostName();
|
||||
|
||||
var url = "http://" + host + ":" + port + "/mediabrowser";
|
||||
|
||||
$('#bookmarkUrl', page).html(url).attr("href", url);
|
||||
|
||||
if (dashboardInfo.RunningTasks.filter(function (task) {
|
||||
|
||||
return task.Id == dashboardInfo.ApplicationUpdateTaskId;
|
||||
|
@ -373,15 +364,6 @@
|
|||
$('.btnRestartContainer', page).addClass('hide');
|
||||
}
|
||||
|
||||
if (dashboardInfo.SystemInfo.WanAddress) {
|
||||
|
||||
var externalUrl = dashboardInfo.SystemInfo.WanAddress + "/mediabrowser";
|
||||
|
||||
$('.externalUrl', page).html('External url: <a href="' + externalUrl + '" target="_blank">' + externalUrl + '</a>').show().trigger('create');
|
||||
} else {
|
||||
$('.externalUrl', page).hide();
|
||||
}
|
||||
|
||||
DashboardPage.renderApplicationUpdateInfo(dashboardInfo);
|
||||
DashboardPage.renderPluginUpdateInfo(dashboardInfo);
|
||||
DashboardPage.renderPendingInstallations(dashboardInfo.SystemInfo);
|
||||
|
|
|
@ -888,16 +888,16 @@
|
|||
|
||||
var attributes = [];
|
||||
|
||||
if (stream.Language) {
|
||||
if (stream.Language && stream.Type != "Video") {
|
||||
attributes.push('<span class="mediaInfoAttribute">' + stream.Language + '</span>');
|
||||
}
|
||||
|
||||
if (stream.Codec && stream.Codec != "dca") {
|
||||
attributes.push('<span class="mediaInfoAttribute">' + stream.Codec + '</span>');
|
||||
attributes.push('<span class="mediaInfoAttribute">' + stream.Codec.toUpperCase() + '</span>');
|
||||
}
|
||||
|
||||
if (stream.Profile && stream.Codec == "dca") {
|
||||
attributes.push('<span class="mediaInfoAttribute">' + stream.Profile + '</span>');
|
||||
attributes.push('<span class="mediaInfoAttribute">' + stream.Profile.toUpperCase() + '</span>');
|
||||
}
|
||||
|
||||
if (stream.Width || stream.Height) {
|
||||
|
@ -919,7 +919,7 @@
|
|||
attributes.push('<span class="mediaInfoAttribute">' + (parseInt(stream.BitRate / 1000)) + ' kbps</span>');
|
||||
}
|
||||
|
||||
if (stream.IsDefault) {
|
||||
if (stream.IsDefault && stream.Type != "Video") {
|
||||
attributes.push('<span class="mediaInfoAttribute">Default</span>');
|
||||
}
|
||||
if (stream.IsForced) {
|
||||
|
|
|
@ -797,7 +797,21 @@ var Dashboard = {
|
|||
|
||||
systemInfo = systemInfo || Dashboard.lastSystemInfo;
|
||||
|
||||
ApiClient.openWebSocket(systemInfo.WebSocketPortNumber);
|
||||
var location = window.location;
|
||||
|
||||
var webSocketUrl = "ws://" + location.hostname;
|
||||
|
||||
if (systemInfo.HttpServerPortNumber != systemInfo.WebSocketPortNumber) {
|
||||
|
||||
if (location.port) {
|
||||
webSocketUrl += ':' + location.port;
|
||||
}
|
||||
|
||||
} else {
|
||||
webSocketUrl += ':' + systemInfo.WebSocketPortNumber;
|
||||
}
|
||||
|
||||
ApiClient.openWebSocket(webSocketUrl);
|
||||
},
|
||||
|
||||
onWebSocketMessageReceived: function (e, data) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue