From aa9467daa4e794884837e6345505dbb5a5af21a8 Mon Sep 17 00:00:00 2001 From: n0mjs710 Date: Tue, 11 Dec 2018 16:29:10 -0600 Subject: [PATCH] improve formatting and output --- templates/hblink_table.html | 34 +++---- templates/hblink_table.html.source_peer | 123 ++++++++++++++++++++++++ web_tables.py | 4 +- 3 files changed, 138 insertions(+), 23 deletions(-) create mode 100755 templates/hblink_table.html.source_peer diff --git a/templates/hblink_table.html b/templates/hblink_table.html index a15c582..f6bb328 100755 --- a/templates/hblink_table.html +++ b/templates/hblink_table.html @@ -1,15 +1,14 @@

HBlink Status Tables:

+ + - - - - - - - + + + + @@ -19,7 +18,6 @@ - @@ -37,13 +35,11 @@ - - @@ -54,25 +50,23 @@
Homebrew Protocol
Master Systems
Slot Call
Type
Source
Subscriber
Source
Peer
Destination
TS1 {{ _cdata[1]['TYPE'] }} {{ _cdata[1]['SUB'] }}{{ _cdata[1]['SRC'] }} {{ _cdata[1]['DEST'] }}
TS2 {{ _cdata[2]['TYPE'] }} {{ _cdata[2]['SUB'] }}{{ _cdata[2]['SRC'] }} {{ _cdata[2]['DEST'] }}
+ + - - - - - - - + + + + - + - @@ -86,13 +80,11 @@ - - diff --git a/templates/hblink_table.html.source_peer b/templates/hblink_table.html.source_peer new file mode 100755 index 0000000..ee2fe17 --- /dev/null +++ b/templates/hblink_table.html.source_peer @@ -0,0 +1,123 @@ +

HBlink Status Tables:

+
Homebrew Protocol
Peer Systems
ID/Callsign/Location
Master IP:Port
Connected
Sent/Ack/Missed
Connected
TX/RX/Lost
LinkedTS Slot Call
Type
Source
Subscriber
Source
Peer
Destination
TS1 {{ _pdata[1]['TYPE'] }} {{ _pdata[1]['SUB'] }}{{ _pdata[1]['SRC'] }} {{ _pdata[1]['DEST'] }}
TS2 {{ _pdata[2]['TYPE'] }} {{ _pdata[2]['SUB'] }}{{ _pdata[2]['SRC'] }} {{ _pdata[2]['DEST'] }}
+ + + + + + + + + + + + + + + + + + + + + + + + {% for _master in _table['MASTERS'] %} + + + + + {% for _client, _cdata in _table['MASTERS'][_master]['PEERS'].iteritems() %} + + + + + + + + + + + + + + + + + + + + {% endfor %} +{% endfor %} +
Homebrew Protocol
Master Systems
ID/Callsign/Location
IP:Port/Time Connected
FrequencyColorCode
LinkedTS
SlotCall
Type
Source
Subscriber
Source
Peer
Destination
{{_master}}
{{_table['MASTERS'][_master]['REPEAT']}}
{{ _client }}, {{ _cdata['CALLSIGN'] }}, {{ _cdata['LOCATION'] }}
{{ _cdata['IP'] }}:{{ _cdata['PORT'] }} / {{ _cdata['CONNECTED'] }}
{{ _cdata['RX_FREQ'] }}
{{ _cdata['TX_FREQ'] }}
{{ _cdata['COLORCODE'] }}
{{ _cdata['SLOTS'] }}
TS1{{ _cdata[1]['TYPE'] }}{{ _cdata[1]['SUB'] }}{{ _cdata[1]['SRC'] }}{{ _cdata[1]['DEST'] }}
TS2{{ _cdata[2]['TYPE'] }}{{ _cdata[2]['SUB'] }}{{ _cdata[2]['SRC'] }}{{ _cdata[2]['DEST'] }}
+
+ + + + + + + + + + + + + + + + + + + + + + + + + {% for _peer, _pdata in _table['PEERS'].iteritems() %} + + + + + + + + + + + + + + + + + + + + {% endfor %} +
Homebrew Protocol
Peer Systems
ID/Callsign/Location
Master IP:Port
Connected
Sent/Ack/Missed
LinkedTSSlotCall
Type
Source
Subscriber
Source
Peer
Destination
{{ _peer}}{{ _table['PEERS'][_peer]['RADIO_ID'] }}, {{_table['PEERS'][_peer]['CALLSIGN']}}, {{_table['PEERS'][_peer]['LOCATION']}}
Master: {{ _table['PEERS'][_peer]['MASTER_IP'] }}:{{ _table['PEERS'][_peer]['MASTER_PORT'] }}
{{ _table['PEERS'][_peer]['STATS']['CONNECTED'] }}
{{ _table['PEERS'][_peer]['STATS']['PINGS_SENT'] }} / {{ _table['PEERS'][_peer]['STATS']['PINGS_ACKD'] }} / {{ _table['PEERS'][_peer]['STATS']['PINGS_SENT'] - _table['PEERS'][_peer]['STATS']['PINGS_ACKD'] }}
{{ _table['PEERS'][_peer]['SLOTS'] }}TS1{{ _pdata[1]['TYPE'] }}{{ _pdata[1]['SUB'] }}{{ _pdata[1]['SRC'] }}{{ _pdata[1]['DEST'] }}
TS2{{ _pdata[2]['TYPE'] }}{{ _pdata[2]['SUB'] }}{{ _pdata[2]['SRC'] }}{{ _pdata[2]['DEST'] }}
+
+ + + + + + + + + + + + + {% for _openbridge in _table['OPENBRIDGES'] %} + + + + + + + + {% endfor %} +
OpenBridge SystemsNetwork ID
Target IP:Port
Active Calls
{{ _openbridge}} {{ _table['OPENBRIDGES'][_openbridge]['NETWORK_ID'] }}
{{ _table['OPENBRIDGES'][_openbridge]['TARGET_IP'] }}:{{ _table['OPENBRIDGES'][_openbridge]['TARGET_PORT'] }}
{% for entry in _table['OPENBRIDGES'][_openbridge]['STREAMS'] %}({{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][0] }} >> {{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][1] }}) {% endfor %}
diff --git a/web_tables.py b/web_tables.py index 22cdf25..c50fc92 100755 --- a/web_tables.py +++ b/web_tables.py @@ -367,7 +367,7 @@ def rts_update(p): CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['COLOR'] = color CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['BGCOLOR'] = bgcolor CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['TYPE'] = callType - CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['SUB'] = sourceSub + CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['SUB'] = '{} ({})'.format(alias_call(sourceSub, subscriber_ids), sourceSub) CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['SRC'] = peer CTABLE['MASTERS'][system]['PEERS'][peer][timeSlot]['DEST'] = destination if action == 'END': @@ -403,7 +403,7 @@ def rts_update(p): CTABLE['PEERS'][system][timeSlot]['COLOR'] = color CTABLE['PEERS'][system][timeSlot]['BGCOLOR'] = bgcolor CTABLE['PEERS'][system][timeSlot]['TYPE'] = callType - CTABLE['PEERS'][system][timeSlot]['SUB'] = sourceSub + CTABLE['PEERS'][system][timeSlot]['SUB'] = '{} ({})'.format(alias_call(sourceSub, subscriber_ids), sourceSub) CTABLE['PEERS'][system][timeSlot]['SRC'] = sourcePeer CTABLE['PEERS'][system][timeSlot]['DEST'] = destination if action == 'END':