fixed peer formatting

This commit is contained in:
n0mjs710 2018-12-06 12:19:10 -06:00
parent dd472f0ae5
commit 26200dceb8
2 changed files with 7 additions and 6 deletions

View File

@ -83,7 +83,7 @@
<tr>
<td style="font-weight:bold" rowspan="2"> {{ _peer}}</td>
<td rowspan="2">{{ _table['PEERS'][_peer]['RADIO_ID'] }}, {{_table['PEERS'][_peer]['CALLSIGN']}}, {{_table['PEERS'][_peer]['LOCATION']}}<br><div style="font: 8pt arial, sans-serif">Master: {{ _table['PEERS'][_peer]['MASTER_IP'] }}:{{ _table['PEERS'][_peer]['MASTER_PORT'] }}</div></td>
<td rowspan="2"; style={{ 'background-color:#00ff00' if _table['PEERS'][_peer]['STATS']['CONNECTION'] == 'YES' else ';background-color:#ff0000' }}>{{ _table['PEERS'][_peer]['STATS']['CONNECTED'] }}<br>{{ _table['PEERS'][_peer]['STATS']['PINGS_SENT'] }}/{{ _table['PEERS'][_peer]['STATS']['PINGS_ACKD'] }}/{{ _table['PEERS'][_peer]['STATS']['PINGS_SENT'] - _table['PEERS'][_peer]['STATS']['PINGS_ACKD'] }}</td>
<td rowspan="2"; style={{ 'background-color:#00ff00' if _table['PEERS'][_peer]['STATS']['CONNECTION'] == 'YES' else ';background-color:#ff0000' }}>{{ _table['PEERS'][_peer]['STATS']['CONNECTED'] }}<br><div style="font: 8pt arial, sans-serif">{{ _table['PEERS'][_peer]['STATS']['PINGS_SENT'] }} / {{ _table['PEERS'][_peer]['STATS']['PINGS_ACKD'] }} / {{ _table['PEERS'][_peer]['STATS']['PINGS_SENT'] - _table['PEERS'][_peer]['STATS']['PINGS_ACKD'] }}</div></td>
<td rowspan="2"> {{ _table['PEERS'][_peer]['SLOTS'] }}</td>
<td>TS1</td>

View File

@ -199,21 +199,22 @@ def build_hblink_table(_config, _stats_table):
# Proccess Peer Systems
elif _hbp_data['MODE'] == 'PEER':
pprint(_hbp_data)
_stats_table['PEERS'][_hbp] = {}
_stats_table['PEERS'][_hbp]['CALLSIGN'] = _hbp_data['CALLSIGN']
_stats_table['PEERS'][_hbp]['LOCATION'] = _hbp_data['LOCATION']
_stats_table['PEERS'][_hbp]['RADIO_ID'] = int_id(_hbp_data['RADIO_ID'])
_stats_table['PEERS'][_hbp]['MASTER_IP'] = _hbp_data['MASTER_IP']
_stats_table['PEERS'][_hbp]['MASTER_PORT'] = _hbp_data['MASTER_PORT']
_stats_table['PEERS'][_hbp]['CONNECTION'] = 'yes' #_hbp_data['CONNECTION']
_stats_table['PEERS'][_hbp]['CONNECTED'] = time() #since(_hbp_data['CONNECTED'])
_stats_table['PEERS'][_hbp]['STATS'] = _hbp_data['STATS']
_stats_table['PEERS'][_hbp]['STATS']['CONNECTION'] = _hbp_data['STATS']['CONNECTION']
_stats_table['PEERS'][_hbp]['STATS']['CONNECTED'] = since(_hbp_data['STATS']['CONNECTED'])
if _hbp_data['SLOTS'] == 0:
_stats_table['SLOTS'][_hbp]['SLOTS'] = 'NONE'
_stats_table['PEERS'][_hbp]['SLOTS'] = 'NONE'
elif _hbp_data['SLOTS'] <= '2':
_stats_table['SLOTS'][_hbp]['SLOTS'] = _hbp_data['SLOTS']
_stats_table['PEERS'][_hbp]['SLOTS'] = _hbp_data['SLOTS']
elif _hbp_data['SLOTS'] == '3':
_stats_table['SLOTS'][_hbp]['SLOTS'] = 'BOTH'
_stats_table['PEERS'][_hbp]['SLOTS'] = 'BOTH'
else:
_stats_table['SLOTS'][_hbp]['SLOTS'] = 'DMO'