MediaDash/templates/remote/index.html

166 lines
7.1 KiB
HTML
Raw Permalink Normal View History

2021-08-29 13:03:28 +00:00
{% extends "base.html" %}
{% from 'utils.html' import custom_render_form_row,make_tabs %}
{% from 'bootstrap/utils.html' import render_icon %}
{% from 'bootstrap/form.html' import render_form, render_field, render_form_row %}
{% block app_content %}
<h1>
2021-12-13 18:11:43 +00:00
Remote access <a href={{url_for("remote.add")}}>{{render_icon("person-plus-fill")}}</a>
2021-08-29 13:03:28 +00:00
</h1>
<div class="row">
<div class="col-lg">
<h4>SSH</h4>
2021-12-13 18:11:43 +00:00
<table class="table table-sm table-bordered">
2021-08-29 13:03:28 +00:00
<tr>
<th></th>
<th>Type</th>
<th>Key fingerprint</th>
<th>Name</th>
</tr>
{% for key in ssh %}
<tr {{ {"class":"text-muted" if key.disabled else none}|xmlattr }}>
<td>
{% if key.disabled %}
2021-12-13 18:11:43 +00:00
<a href="{{url_for("remote.index",enabled=True,key=key.key)}}">{{render_icon("person-x-fill",color='danger')}}</a>
2021-08-29 13:03:28 +00:00
{% else %}
2021-12-13 18:11:43 +00:00
<a href="{{url_for("remote.index",enabled=False,key=key.key)}}">{{render_icon("person-check-fill",color='success')}}</a>
2021-08-29 13:03:28 +00:00
{% endif %}
</td>
<td>{{key.type}}</td>
<td title="{{key.key}}">{{key.fingerprint}}</td>
<td>{{key.name}}</td>
</tr>
{% endfor %}
</table>
</div>
</div>
2021-12-13 18:11:43 +00:00
<div class="row">
<div class="col-lg">
<h4>Active Streams</h4>
<table class="table table-sm table-bordered">
<tr>
<th>Episode</th>
<th>Show</th>
<th>Language</th>
<th>User</th>
<th>Device</th>
<th>Mode</th>
</tr>
{% for session in jellyfin.sessions %}
{% if "NowPlayingItem" in session %}
{% with np=session.NowPlayingItem, ps=session.PlayState%}
<tr>
<td>
{% if session.SupportsMediaControl %}
<a href="{{url_for('remote.stop',session=session.Id)}}">
{{render_icon("stop-circle")}}
</a>
{% endif %}
<a title="{{ps.MediaSourceId}}" href="{{cfg().jellyfin_url}}web/index.html#!/details?id={{np.Id}}">
{{np.Name}}
</a>
({{(ps.PositionTicks/10_000_000)|timedelta(digits=0)}}/{{(np.RunTimeTicks/10_000_000)|timedelta(digits=0)}})
{% if ps.IsPaused %}
(Paused)
{% endif %}
</td>
<td>
<a href="{{cfg().jellyfin_url}}web/index.html#!/details?id={{np.SeriesId}}">
{{np.SeriesName}}
</a>
<a href="{{cfg().jellyfin_url}}web/index.html#!/details?id={{np.SeasonId}}">
({{np.SeasonName}})
</a>
</td>
<td>
{% if ("AudioStreamIndex" in ps) and ("SubtitleStreamIndex" in ps) %}
{% if ps.AudioStreamIndex == -1 %}
{% set audio_lang = "-" %}
{% else %}
{% set audio_lang = np.MediaStreams[ps.AudioStreamIndex].Language or "?" %}
{% endif %}
{% if ps.SubtitleStreamIndex == -1 %}
{% set subtitle_lang = "-" %}
{% else %}
{% set subtitle_lang = np.MediaStreams[ps.AudioStreamIndex].Language or "?" %}
{% endif %}
{{audio_lang}}/{{subtitle_lang}}
{% else %}
?/?
{% endif %}
</td>
<td>
<a href="{{cfg().jellyfin_url}}web/index.html#!/useredit.html?userId={{session.UserId}}">
{{session.UserName}}
</a>
</td>
<td>
{{session.DeviceName}}
</td>
<td>
{% if ps.PlayMethod =="Transcode" %}
<p title="{{session.TranscodingInfo.Bitrate|filesizeformat(binary=False)}}/s | {{session.TranscodingInfo.CompletionPercentage|round(2)}}%">
{{ps.PlayMethod}}
</p>
{% else %}
<p>
{{ps.PlayMethod}}
</p>
{% endif %}
</td>
</tr>
{% endwith %}
{% endif %}
{% endfor %}
</table>
</div>
</div>
2021-08-29 13:03:28 +00:00
<div class="row">
<div class="col-lg">
<h4><a href="{{cfg().jellyfin_url}}web/index.html#!/userprofiles.html">Jellyfin</a></h4>
2021-12-13 18:11:43 +00:00
<table class="table table-sm table-bordered">
2021-08-29 13:03:28 +00:00
<tr>
<th>Name</th>
<th>Last Login</th>
<th>Last Active</th>
<th>Bandwidth Limit</th>
</tr>
2021-12-13 18:11:43 +00:00
{% for user in jellyfin.users|defaultattr("LastLoginDate","")|sort(attribute="LastLoginDate",reverse=True) %}
2021-08-29 13:03:28 +00:00
<tr>
<td>
<a href="{{cfg().jellyfin_url}}web/index.html#!/useredit.html?userId={{user.Id}}">
{{user.Name}}
</a>
</td>
<td>
2021-12-13 18:11:43 +00:00
{% if user.LastLoginDate %}
2021-08-29 13:03:28 +00:00
{{user.LastLoginDate|fromiso|ago_dt_utc(2)}} ago
{% else %}
Never
{% endif %}
</td>
<td>
2021-12-13 18:11:43 +00:00
{% if user.LastActivityDate %}
2021-08-29 13:03:28 +00:00
{{user.LastActivityDate|fromiso|ago_dt_utc(2)}} ago
{% else %}
Never
{% endif %}
</td>
2021-12-13 18:11:43 +00:00
<td>
{% if user.Policy.RemoteClientBitrateLimit!=0 %}
{{user.Policy.RemoteClientBitrateLimit|filesizeformat(binary=False)}}/s
{% else %}
None
{% endif %}
</td>
2021-08-29 13:03:28 +00:00
</tr>
{% endfor %}
</table>
</div>
</div>
{% endblock %}