Skip to content

Commit

Permalink
v2.51
Browse files Browse the repository at this point in the history
Fix Bug #1
  • Loading branch information
pucherot committed Jan 11, 2021
1 parent 2f9ccdd commit 8bf95ae
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 20 deletions.
6 changes: 3 additions & 3 deletions back/pialert.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = '2.50'
VERSION_YEAR = '2020'
VERSION_DATE = '2020-12-30'
VERSION = '2.51'
VERSION_YEAR = '2021'
VERSION_DATE = '2021-01-11'

DB_PATH = '/home/pi/pialert/db/pialert.db'
LOG_PATH = '/home/pi/pialert/log'
Expand Down
17 changes: 12 additions & 5 deletions back/pialert.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Pi.Alert v2.50 / 2020-12-30
# Pi.Alert v2.51 / 2021-01-11
# Puche 2020
# GNU GPLv3

Expand Down Expand Up @@ -486,10 +486,17 @@ def read_DHCP_leases ():
return

# Read DHCP Leases
with open(DHCP_LEASES) as f:
reader = csv.reader(f, delimiter=' ')
data = [(col1, col2, col3, col4, col5)
for col1, col2, col3, col4, col5 in reader]
# Bugfix #1 - dhcp.leases: lines with different number of columns (5 col)
data = []
with open(DHCP_LEASES, 'r') as f:
for line in f:
row = line.rstrip().split()
if len(row) == 5 :
data.append (row)
# with open(DHCP_LEASES) as f:
# reader = csv.reader(f, delimiter=' ')
# data = [(col1, col2, col3, col4, col5)
# for col1, col2, col3, col4, col5 in reader]

# Insert into PiAlert table
sql.execute ("DELETE FROM DHCP_Leases")
Expand Down
6 changes: 3 additions & 3 deletions docs/report_sample_1.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<td>
<table width=100% border=0 bgcolor=#FFD966 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 16px; text-align:center; color:#5F5000">
<tr>
<td width=33%> Report Date: <b>2021-01-02 08:20</b> </td>
<td width=33%> Report Date: <b>2021-01-11 08:00</b> </td>
<td width=34%> Scan Cycle: <b>Internet</b> </td>
<td width=33%> Server: <b>pi4</b> </td>
</tr>
Expand Down Expand Up @@ -58,8 +58,8 @@
<td>
<table width=100% border=0 bgcolor=#70AD47 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 12px; font-weight: bold; color:#385723">
<tr>
<td width=25% style="text-align:Left"> Puche 2020</td>
<td width=50% style="text-align:center"> Pi.Alert 2.50 &nbsp; / &nbsp; 2020-12-30 </td>
<td width=25% style="text-align:Left"> Puche 2021</td>
<td width=50% style="text-align:center"> Pi.Alert 2.51 &nbsp; / &nbsp; 2021-01-11 </td>
<td width=25% style="text-align:right"> GNU GPLv3</td>
</tr>
</table>
Expand Down
6 changes: 3 additions & 3 deletions docs/report_sample_2.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<td>
<table width=100% border=0 bgcolor=#FFD966 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 16px; text-align:center; color:#5F5000">
<tr>
<td width=33%> Report Date: <b>2021-01-02 08:20</b> </td>
<td width=33%> Report Date: <b>2021-01-11 08:00</b> </td>
<td width=34%> Scan Cycle: <b>1</b> </td>
<td width=33%> Server: <b>pi4</b> </td>
</tr>
Expand Down Expand Up @@ -121,8 +121,8 @@
<td>
<table width=100% border=0 bgcolor=#70AD47 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 12px; font-weight: bold; color:#385723">
<tr>
<td width=25% style="text-align:Left"> Puche 2020</td>
<td width=50% style="text-align:center"> Pi.Alert 2.50 &nbsp; / &nbsp; 2020-12-30 </td>
<td width=25% style="text-align:Left"> Puche 2021</td>
<td width=50% style="text-align:center"> Pi.Alert 2.51 &nbsp; / &nbsp; 2021-01-11 </td>
<td width=25% style="text-align:right"> GNU GPLv3</td>
</tr>
</table>
Expand Down
4 changes: 2 additions & 2 deletions front/php/templates/footer.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!-- Main Footer -->
<footer class="main-footer">
<!-- Default to the left -->
&copy; 2020 Puche
&copy; 2021 Puche
<!-- To the right -->
<div class="pull-right no-hidden-xs">
Pi.alert&nbsp&nbsp2.50&nbsp&nbsp<small>(2019-12-30)</small>
Pi.alert&nbsp&nbsp2.51&nbsp&nbsp<small>(2021-01-11)</small>
</div>
</footer>
Expand Down
Binary file modified install/pialert_2.50.tar
Binary file not shown.
Binary file modified install/pialert_latest.tar
Binary file not shown.
4 changes: 2 additions & 2 deletions log/report_output.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<td>
<table width=100% border=0 bgcolor=#70AD47 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 12px; font-weight: bold; color:#385723">
<tr>
<td width=25% style="text-align:Left"> Puche 2020</td>
<td width=50% style="text-align:center"> Pi.Alert DEV 2.50 &nbsp; / &nbsp; 2020-12-30 </td>
<td width=25% style="text-align:Left"> Puche 2021</td>
<td width=50% style="text-align:center"> Pi.Alert DEV 2.51 &nbsp; / &nbsp; 2021-01-11 </td>
<td width=25% style="text-align:right"> GNU GPLv3</td>
</tr>
</table>
Expand Down
4 changes: 2 additions & 2 deletions log/report_output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Pi.Alert Report
========================================

Report Date: 2021-01-01 00:00
Report Date: 2021-01-11 00:00
Scan Cycle: 1
Server: pi4

Expand All @@ -12,4 +12,4 @@ Events


----------------------------------------------------------------------
Puche 2020 Pi.Alert 2.50 / 2020-12-30 GNU GPLv3
Puche 2021 Pi.Alert 2.51 / 2021-01-11 GNU GPLv3

0 comments on commit 8bf95ae

Please sign in to comment.