mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
support opening remote control menu from dashboard
This commit is contained in:
parent
6e4a7594fc
commit
80df2d3d84
3 changed files with 26 additions and 12 deletions
|
@ -610,7 +610,8 @@ form, .readOnlyContent {
|
||||||
|
|
||||||
/* Dashboard home */
|
/* Dashboard home */
|
||||||
.tblConnections td {
|
.tblConnections td {
|
||||||
padding: .5em 0 .5em 1.25em;
|
padding: 1em 0 1em 1.5em;
|
||||||
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tblConnections td:first-child {
|
.tblConnections td:first-child {
|
||||||
|
@ -618,7 +619,7 @@ form, .readOnlyContent {
|
||||||
}
|
}
|
||||||
|
|
||||||
.tblConnections img {
|
.tblConnections img {
|
||||||
height: 54px;
|
height: 48px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.clientNowPlayingImage {
|
.clientNowPlayingImage {
|
||||||
|
|
|
@ -86,6 +86,8 @@
|
||||||
|
|
||||||
$('.trSession', table).addClass('deadSession');
|
$('.trSession', table).addClass('deadSession');
|
||||||
|
|
||||||
|
var deviceId = ApiClient.deviceId();
|
||||||
|
|
||||||
for (var i = 0, length = dashboardInfo.ActiveConnections.length; i < length; i++) {
|
for (var i = 0, length = dashboardInfo.ActiveConnections.length; i < length; i++) {
|
||||||
|
|
||||||
var connection = dashboardInfo.ActiveConnections[i];
|
var connection = dashboardInfo.ActiveConnections[i];
|
||||||
|
@ -106,7 +108,16 @@
|
||||||
html += '</td>';
|
html += '</td>';
|
||||||
|
|
||||||
html += '<td>';
|
html += '<td>';
|
||||||
html += '<div>' + connection.Client + '</div>';
|
|
||||||
|
html += '<div>';
|
||||||
|
|
||||||
|
if (deviceId == connection.DeviceId) {
|
||||||
|
html += connection.Client;
|
||||||
|
} else {
|
||||||
|
html += '<a href="#" onclick="RemoteControl.showMenu({sessionId:\'' + connection.Id + '\'});">' + connection.Client + '</a>';
|
||||||
|
}
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
html += '<div>' + connection.ApplicationVersion + '</div>';
|
html += '<div>' + connection.ApplicationVersion + '</div>';
|
||||||
html += '<div>' + connection.DeviceName + '</div>';
|
html += '<div>' + connection.DeviceName + '</div>';
|
||||||
html += '</td>';
|
html += '</td>';
|
||||||
|
|
|
@ -653,7 +653,7 @@
|
||||||
$('.chkSelectItem:first', elem).checked(true);
|
$('.chkSelectItem:first', elem).checked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function showMenu(sessions) {
|
function showMenu(sessions, options) {
|
||||||
|
|
||||||
var html = '<div data-role="popup" id="remoteControlFlyout" data-theme="a">';
|
var html = '<div data-role="popup" id="remoteControlFlyout" data-theme="a">';
|
||||||
|
|
||||||
|
@ -700,9 +700,9 @@
|
||||||
|
|
||||||
html += '<div><label for="txtMessage">Message text</label></div>';
|
html += '<div><label for="txtMessage">Message text</label></div>';
|
||||||
|
|
||||||
html += '<div style="display:inline-block;width:80%;"><input id="txtMessage" name="txtMessage" type="text" /></div>';
|
html += '<input id="txtMessage" name="txtMessage" type="text" />';
|
||||||
|
|
||||||
html += '<button type="button" data-icon="mail" class="btnSendMessage" data-mini="true" data-inline="true">Send</button>';
|
html += '<button type="button" data-icon="mail" class="btnSendMessage" data-mini="true">Send</button>';
|
||||||
|
|
||||||
html += '</p>';
|
html += '</p>';
|
||||||
|
|
||||||
|
@ -726,8 +726,8 @@
|
||||||
$(this).off("popupafterclose").remove();
|
$(this).off("popupafterclose").remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
renderSessionsInControlMenu(popup, sessions);
|
renderSessionsInControlMenu(popup, sessions, options);
|
||||||
updateSessionInfo(popup, sessions);
|
updateSessionInfo(popup, sessions, options);
|
||||||
|
|
||||||
if (ApiClient.isWebSocketOpen()) {
|
if (ApiClient.isWebSocketOpen()) {
|
||||||
ApiClient.sendWebSocketMessage("SessionsStart", "1000,1000");
|
ApiClient.sendWebSocketMessage("SessionsStart", "1000,1000");
|
||||||
|
@ -983,7 +983,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderSessionsInControlMenu(popup, sessions) {
|
function renderSessionsInControlMenu(popup, sessions, options) {
|
||||||
|
|
||||||
|
options = options || {};
|
||||||
|
|
||||||
var deviceId = ApiClient.deviceId();
|
var deviceId = ApiClient.deviceId();
|
||||||
|
|
||||||
|
@ -994,7 +996,7 @@
|
||||||
|
|
||||||
var elem = $('#selectSession', popup);
|
var elem = $('#selectSession', popup);
|
||||||
|
|
||||||
var currentValue = elem.val();
|
var currentValue = options.sessionId || elem.val();
|
||||||
|
|
||||||
if (currentValue) {
|
if (currentValue) {
|
||||||
|
|
||||||
|
@ -1044,10 +1046,10 @@
|
||||||
showMenuForItem(options, ApiClient.getSessions(sessionQuery));
|
showMenuForItem(options, ApiClient.getSessions(sessionQuery));
|
||||||
};
|
};
|
||||||
|
|
||||||
self.showMenu = function () {
|
self.showMenu = function (options) {
|
||||||
ApiClient.getSessions(sessionQuery).done(function (sessions) {
|
ApiClient.getSessions(sessionQuery).done(function (sessions) {
|
||||||
|
|
||||||
showMenu(sessions);
|
showMenu(sessions, options);
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue