Compare commits

...

12 Commits

Author SHA1 Message Date
Waldek 16a317951a
Update requirements.txt 2022-03-02 12:46:01 +01:00
Waldek 708c2eaa61
fixed html code 2022-02-20 19:38:36 +01:00
Waldek 2ecdea2236
Update main_table.html 2021-05-25 07:00:24 +02:00
Waldek 1da8548d8f
Update styles.css 2021-05-25 06:46:50 +02:00
Waldek 929c88dd86
Update monitor.py 2021-05-25 06:45:51 +02:00
Waldek 4b0854d4db
Update main_table.html 2021-05-25 06:43:20 +02:00
Waldek 143942386c
remove TimeSlot info from lastheard 2021-05-22 12:16:57 +02:00
Waldek 3b3678925b
remove TimeSlot info 2021-05-22 12:14:59 +02:00
Waldek ccc2d7291c
Update README.md 2021-05-18 18:05:13 +02:00
Waldek b15a64360d
Delete talkgroup_ids_freedmr.json 2021-05-16 18:18:11 +02:00
Waldek 80d33c18bf
Delete talkgroup_ids_bm.json 2021-05-16 18:18:04 +02:00
Waldek 82bf9b9f0a
Update requirements.txt 2021-05-16 11:48:33 +02:00
7 changed files with 15 additions and 8969 deletions

View File

@ -16,6 +16,7 @@ This is version HBMonitor V2
cd /opt
git clone https://github.com/sp2ong/HBMonv2.git
cd HBMonv2
git checkout webserver-python
chmod +x install.sh
./install.sh
cp config-SAMPLE.py config.py

View File

@ -1,3 +1,4 @@
tr:nth-child(even).log {background-color: #fafafa;text-align: center;}
a:link {
color: #0066ff;

View File

@ -754,8 +754,8 @@ def process_message(_bmessage):
f = open(PATH+"templates/lastheard.html", "w")
f.write("<br><fieldset style=\"border-radius: 8px; background-color:#f0f0f0f0;margin-left:15px;margin-right:15px;font-size:14px;border-top-left-radius: 10px; border-top-right-radius: 10px;border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;\">\n")
f.write("<legend><b><font color=\"#000\">&nbsp;.: Lastheard :.&nbsp;</font></b></legend>\n")
f.write("<table style=\"width:100%; font: 10pt arial, sans-serif\">\n")
f.write("<TR style=\" height: 32px;font: 10pt arial, sans-serif;"+THEME_COLOR+"\"><TH>Date</TH><TH>Time</TH><TH>Callsign (DMR-Id)</TH><TH>Name</TH><TH>TG#</TH><TH>TG Name</TH><TH>TX (s)</TH><TH>Slot</TH><TH>System</TH></TR>\n")
f.write("<table style=\"width:100%; font: 10pt arial, sans-serif;background-color:#f1f1f1;\">\n")
f.write("<TR style=\"height: 32px;font: 10pt arial, sans-serif;"+THEME_COLOR+"\"><TH>Date</TH><TH>Time</TH><TH>Callsign (DMR-Id)</TH><TH>Name</TH><TH>TG#</TH><TH>TG Name</TH><TH>TX (s)</TH><TH>System</TH></TR>\n")
with open(LOG_PATH+"lastheard.log", "r") as textfile:
for row in islice(reversed(list(csv.reader(textfile))),200):
duration=row[1]
@ -766,11 +766,11 @@ def process_message(_bmessage):
else:
qrz = "<a style=\"font: 9pt arial,sans-serif;font-weight:bold;color:#0066ff;\" target=\"_blank\" href=https://qrz.com/db/"+row[11]+">"+row[11]+"</a></b><span style=\"font: 7pt arial,sans-serif\"> ("+row[10]+")</span>"
if len(row) < 13:
hline="<TR style=\"background-color:#f9f9f9f9;\"><TD>"+row[0][:10]+"</TD><TD>"+row[0][11:16]+"</TD><TD>"+qrz+"</TD><TD><font color=#002d62><b></b></font></TD><TD><font color=#b5651d><b>"+row[8][2:]+"</b></font></TD><TD><font color=green><b>"+row[9]+"</b></font></TD><TD>"+dur+"</TD><TD>"+row[7][2:]+"</TD><TD>"+row[4]+"</TD></TR>"
hline="<TR class=\"log\"><TD>"+row[0][:10]+"</TD><TD>"+row[0][11:16]+"</TD><TD>"+qrz+"</TD><TD><font color=#002d62><b></b></font></TD><TD><font color=#b5651d><b>"+row[8][2:]+"</b></font></TD><TD><font color=green><b>"+row[9]+"</b></font></TD><TD>"+dur+"</TD><TD>"+row[4]+"</TD></TR>"
my_list.append(row[10])
n += 1
else:
hline="<TR style=\"background-color:#f9f9f9f9;\"><TD>"+row[0][:10]+"</TD><TD>"+row[0][11:16]+"</TD><TD>"+qrz+"</TD><TD><font color=#002d62><b>"+row[12]+"</b></font></TD><TD><font color=#b5651d><b>"+row[8][2:]+"</b></font></TD><TD><font color=green><b>"+row[9]+"</b></font></TD><TD>"+dur+"</TD><TD>"+row[7][2:]+"</TD><TD>"+row[4]+"</TD></TR>"
hline="<TR class=\"log\"><TD>"+row[0][:10]+"</TD><TD>"+row[0][11:16]+"</TD><TD>"+qrz+"</TD><TD><font color=#002d62><b>"+row[12]+"</b></font></TD><TD><font color=#b5651d><b>"+row[8][2:]+"</b></font></TD><TD><font color=green><b>"+row[9]+"</b></font></TD><TD>"+dur+"</TD><TD>"+row[4]+"</TD></TR>"
my_list.append(row[10])
n += 1
f.write(hline+"\n")

View File

@ -2,4 +2,6 @@ Twisted
dmr_utils3
bitstring
autobahn
jinja2
jinja2==2.11.3
markupsafe==2.0.1

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -14,12 +14,12 @@
<tr style="background-color:#f9f9f9f9;line-height:1.4;">
{% if _cdata[1]['TRX'] == "RX" %}
<td style="font-weight:bold; padding-left: 20px; text-align:left;color:#464646;">M: {{_master}}</td>
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#0d1a81;">{{ _cdata[1]['SUB']|safe }} [<span style="align-items: center;justify-content:center;font-size: 8pt;font-weight:600;color:brown;">TS {{ 1 if _cdata[1]['TS'] == True else 2 }}</span>]</td>
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#0d1a81;">{{ _cdata[1]['SUB']|safe }}</td>
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#b5651d;">{{ _cdata[1]['DEST']|safe }}</td>
{% endif %}
{% if _cdata[2]['TRX'] == "RX" %}
<td style="font-weight:bold; padding-left: 20px; text-align:left;color:#464646">M: {{_master}}</td>
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#0d1a81;">{{ _cdata[2]['SUB']|safe }} [<span style="align-items: center;justify-content:center;font-size: 8pt;font-weight:600;color:brown;">TS {{ 1 if _cdata[1]['TS'] == True else 2 }}</span>]</td>
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#0d1a81;">{{ _cdata[2]['SUB']|safe }}</td>
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#b5651d;">{{ _cdata[2]['DEST']|safe }}</td>
{% endif %}
</tr>
@ -39,12 +39,12 @@
<tr style="background-color:#f9f9f9f9;line-height:1.4;">
{% if _pdata[1]['TRX'] == "RX" %}
<td style="font-weight:bold; padding-left: 20px; text-align:left;color:#464646;">P: {{_peer}} </td>
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#0d1a81;">{{ _pdata[1]['SUB']|safe }} [<span style="align-items: center;justify-content:center;font-size: 8pt;font-weight:600;color:brown;">TS {{ 1 if _pdata[1]['TS'] == True else 2 }}</span>]</td>
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#0d1a81;">{{ _pdata[1]['SUB']|safe }}</td>
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#b5651d;">{{ _pdata[1]['DEST']|safe }}</td>
{% endif %}
{% if _pdata[2]['TRX'] == "RX" %}
<td style="font-weight:bold; padding-left: 20px; text-align:left;color:#464646;">P: {{_peer}} </td>
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#0d1a81;">{{ _pdata[2]['SUB']|safe }} [<span style="align-items: center;justify-content:center;font-size: 8pt;font-weight:600;color:brown;">TS {{ 1 if _pdata[1]['TS'] == True else 2 }}</span>]</td>
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#0d1a81;">{{ _pdata[2]['SUB']|safe }}</td>
<td style="font: 9.5pt arial, sans-serif;font-weight: 600;color:#b5651d;">{{ _pdata[2]['DEST']|safe }}</td>
{% endif %}
</tr>
@ -66,7 +66,7 @@
<tr style="background-color:#f9f9f9f9;line-height:1.6;">
<td style="font-weight:bold; padding-left: 20px; text-align:left;"> {{ _openbridge}} </td>
<td colspan=2 style="background-color:#f9f9f9f9; font: 9pt arial, sans-serif; font-weight: 600; color:#464646;">
{% for entry in _table['OPENBRIDGES'][_openbridge]['STREAMS'] if _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][0] == 'RX' %}[<span style="color:#008000;">{{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][0] }}</span>: <font color=#0065ff> {{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][1] }}</font> >> <font color=#b5651d> {{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][2] }}</font>]&nbsp; {% endfor %}
{% for entry in _table['OPENBRIDGES'][_openbridge]['STREAMS'] if _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][0] == 'RX' %}[<font color=#0065ff> {{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][1] }}</font> >> <font color=#b5651d> {{ _table['OPENBRIDGES'][_openbridge]['STREAMS'][entry][2] }}</font>]&nbsp; {% endfor %}
</td>
</tr>
{% endif %}
@ -114,7 +114,7 @@
<div style="text-align:left;"><span style="color:#464646;font-weight:600;line-height:1.8;">&nbsp;&nbsp;PEERS:</span></div>
<div style="text-align:left;font:9.5pt arial, sans-serif;font-weight:bold;margin-left:25px; margin-right:25px;line-height:1.6;white-space:normal;">
{% for _peer, _pdata in _table['PEERS'].items() %}
<span class="tooltip" style="border-bottom: 1px dotted white;{{'background-color:#8ecfb4; color:#464646;' if _table['PEERS'][_peer]['STATS']['CONNECTION'] == 'YES' else 'background-color:#ff0000; color:white;'}}"><b>&nbsp;&nbsp;{{_peer}}&nbsp;&nbsp;</b>
<span class="tooltip" style="bmargin-bottom:6px;order-bottom: 1px dotted white;{{'background-color:#8ecfb4; color:#464646;' if _table['PEERS'][_peer]['STATS']['CONNECTION'] == 'YES' else 'background-color:#ff0000; color:white;'}}"><b>&nbsp;&nbsp;{{_peer}}&nbsp;&nbsp;</b>
{% if _table['PEERS'][_peer]['STATS']['CONNECTION'] == 'YES' %}
<span class="tooltiptext" style="top:120%;left:50%;margin-left:-70%;width:100px;padding: 2px 0;">
<center><font color=white>Connected</font></center>