mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-15 09:42:57 -07:00
Add hidden raw stream info
This commit is contained in:
parent
b6a634ea6f
commit
7047829943
3 changed files with 43 additions and 3 deletions
|
@ -151,7 +151,7 @@ DOCUMENTATION :: END
|
|||
</ul>
|
||||
<ul class="list-unstyled dashboard-activity-info-list">
|
||||
<li class="dashboard-activity-info-item">
|
||||
<div class="sub-heading">Stream</div>
|
||||
<div class="sub-heading"><span class="raw-stream-info-modal" data-toggle="modal" data-target="#raw-stream-info-modal" data-key="${data['session_key']}">Stream</span></div>
|
||||
<div class="sub-value" id="transcode_decision-${data['session_key']}">
|
||||
% if data['transcode_decision'] == 'transcode':
|
||||
Transcode
|
||||
|
|
|
@ -181,6 +181,22 @@
|
|||
|
||||
<div class="modal fade" id="ip-info-modal" tabindex="-1" role="dialog" aria-labelledby="ip-info-modal">
|
||||
</div>
|
||||
<div class="modal fade wide" id="raw-stream-info-modal" tabindex="-1" role="dialog" aria-labelledby="raw-stream-info-modal">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-remove"></i></button>
|
||||
<h4 class="modal-title">Raw Stream Info: <strong><span id="raw-stream-info-title"></span> (<span id="raw-stream-info-user"></span>)</strong></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<pre id="raw-stream-info"></pre>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<input type="button" class="btn btn-bright" data-dismiss="modal" value="Close">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</%def>
|
||||
|
||||
|
@ -469,6 +485,27 @@
|
|||
});
|
||||
});
|
||||
|
||||
$('#currentActivity').on('click', '.raw-stream-info-modal', function () {
|
||||
$.ajax({
|
||||
url: 'get_activity',
|
||||
type: 'GET',
|
||||
cache: false,
|
||||
async: true,
|
||||
data: {
|
||||
session_key: $(this).data('key')
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.log(status + ': ' + error);
|
||||
},
|
||||
complete: function (xhr, status) {
|
||||
var session = $.parseJSON(xhr.responseText);
|
||||
$('#raw-stream-info-title').text(session.full_title);
|
||||
$('#raw-stream-info-user').text(session.friendly_name);
|
||||
$('#raw-stream-info').text(JSON.stringify(session, null, '\t'));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
% if _session['user_group'] == 'admin':
|
||||
// Terminate session
|
||||
$('#currentActivity').on('click', '.dashboard-activity-terminate-session', function (e) {
|
||||
|
|
|
@ -4332,7 +4332,7 @@ class WebInterface(object):
|
|||
@cherrypy.tools.json_out()
|
||||
@requireAuth()
|
||||
@addtoapi()
|
||||
def get_activity(self, **kwargs):
|
||||
def get_activity(self, session_key=None, **kwargs):
|
||||
""" Get the current activity on the PMS.
|
||||
|
||||
```
|
||||
|
@ -4345,7 +4345,7 @@ class WebInterface(object):
|
|||
Returns:
|
||||
json:
|
||||
{"stream_count": 3,
|
||||
"session":
|
||||
"sessions":
|
||||
[{"art": "/library/metadata/1219/art/1462175063",
|
||||
"aspect_ratio": "1.78",
|
||||
"audio_channels": "6",
|
||||
|
@ -4419,6 +4419,9 @@ class WebInterface(object):
|
|||
ip_address = data_factory.get_session_ip(session['session_key'])
|
||||
session['ip_address'] = ip_address
|
||||
|
||||
if session_key:
|
||||
return next((s for s in result['sessions'] if s['session_key'] == session_key), {})
|
||||
|
||||
return result
|
||||
else:
|
||||
logger.warn(u"Unable to retrieve data for get_activity.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue