Add secure/insecure icon to activity card

This commit is contained in:
JonnyWong16 2019-03-05 21:55:13 -08:00
commit 6e9f299c19
2 changed files with 19 additions and 5 deletions

View file

@ -283,10 +283,17 @@ DOCUMENTATION :: END
<li class="dashboard-activity-info-item">
<div class="sub-heading">Location</div>
<div class="sub-value time-right">
% if data['secure'] is not None:
% if data['secure']:
<span data-toggle="tooltip" title="Secure Connection"><i class="fa fa-lock"></i></span>
% else:
<span data-toggle="tooltip" title="Insecure Connection"><i class="fa fa-unlock"></i></span>
% endif
% endif
<span id="location-${sk}">${data['location'].upper()}</span>:
% if data['ip_address'] != 'N/A':
<span class="ip-container"><span class="ip-address">${data['ip_address']}</span></span>
% if data['relay']:
% if data['relayed']:
<span data-toggle="tooltip" title="Plex Relay"><i class="fa fa-exclamation-circle"></i></span>
% else:
<a href="#" class="external_ip-modal" data-toggle="modal" data-target="#ip-info-modal" data-ip="${data['ip_address']}">

View file

@ -1510,7 +1510,9 @@ class PmsConnect(object):
'player': helpers.get_xml_attr(player_info, 'title') or helpers.get_xml_attr(player_info, 'product'),
'machine_id': helpers.get_xml_attr(player_info, 'machineIdentifier'),
'state': helpers.get_xml_attr(player_info, 'state'),
'local': helpers.get_xml_attr(player_info, 'local')
'local': int(helpers.get_xml_attr(player_info, 'local') == '1'),
'relayed': helpers.get_xml_attr(player_info, 'relayed', default_return=None),
'secure': helpers.get_xml_attr(player_info, 'secure', default_return=None)
}
# Get the session details
@ -1524,12 +1526,17 @@ class PmsConnect(object):
else:
session_details = {'session_id': '',
'bandwidth': '',
'location': 'wan' if player_details['local'] == '0' else 'lan'
'location': 'lan' if player_details['local'] else 'wan'
}
# Check if using Plex Relay
session_details['relay'] = int(session_details['location'] != 'lan'
and player_details['ip_address_public'] == '127.0.0.1')
if player_details['relayed'] is None:
player_details['relayed'] = int(session_details['location'] != 'lan' and
player_details['ip_address_public'] == '127.0.0.1')
# Check if secure connection
if player_details['secure'] is not None:
player_details['secure'] = int(player_details['secure'] == '1')
# Get the transcode details
if session.getElementsByTagName('TranscodeSession'):