-
Notifications
You must be signed in to change notification settings - Fork 1
/
base.html
45 lines (43 loc) · 2.41 KB
/
base.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{% extends template_base.html %}
{% block title %}TS Analyser - Channels{% end %}
{% block index %}
{% for address,values in pids_new.items() %}
{% set s=0 %}
<div style="float:left"><ul>
<li>{{ escape(address) }}<br>
{% if isinstance(values, dict) %}
{% set total=0 %}
{% for pids,stats in values.items() %}
{% set total=total+stats['packets'] %}
{% end %}
{% for pids,stats in sorted(values.items(), key=lambda x: x[1]['packets']) %}
{% if s==0 %}
{% set s=1 %}
Source IP: {{stats['ip']}}</li><ul>
{% end %}
{% set pct=(stats['packets']/total)*100 %}
<li>
<!--<div style='width:100%;
background: -moz-linear-gradient(left, #1c8e22 0%, #1c8e22 {{pct-10}}%, #ffffff {{pct}}%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#1c8e22), color-stop({{pct-10}}%,#1c8e22), color-stop({{pct}}%,#ffffff)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, #1c8e22 0%,#1c8e22 {{pct-10}}%,#ffffff {{pct}}%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, #1c8e22 0%,#1c8e22 68%,#ffffff 68%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, #1c8e22 0%,#1c8e22 68%,#ffffff 68%); /* IE10+ */
background: linear-gradient(to right, #1c8e22 0%,#1c8e22 68%,#ffffff 68%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1c8e22', endColorstr='#ffffff',GradientType=1 ); /* IE6-9 */
border-radius: 2px;'>--><div>
PID: {{hex(pids)}} Packets [188 bytes] : {{stats['packets']}} Discontinuities: {{stats['error']}} Type: {{stats['type']}}
{% if stats['extra'] %}
<ul>
<li>PID:{{stats['extra']['table_id']}}</li>
<li>Transport stream ID: {{stats['extra']['transportstream_id']}}</li>
<li>SID: {{stats['extra']['program']}}</li>
<li>PMT: {{int(stats['extra']['pmt'],16)}} ({{stats['extra']['pmt']}})</li>
</ul>
{% end %}</div></li>
{% end %}
</ul>
{% end %}
</ul></div>
{% end %}
{% end %}