Skip to content

Commit 6b390b6

Browse files
author
jokob-sk
committed
report cleanup + #960
1 parent af1e9b9 commit 6b390b6

12 files changed

+105
-390
lines changed

docker-compose.yml

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ services:
3838
- ${DEV_LOCATION}/back/update_vendors.sh:/app/back/update_vendors.sh
3939
- ${DEV_LOCATION}/front/lib:/app/front/lib
4040
- ${DEV_LOCATION}/front/js:/app/front/js
41-
- ${DEV_LOCATION}/front/report_templates:/front/report_templates
4241
- ${DEV_LOCATION}/front/php:/app/front/php
4342
- ${DEV_LOCATION}/front/deviceDetails.php:/app/front/deviceDetails.php
4443
- ${DEV_LOCATION}/front/deviceDetailsEdit.php:/app/front/deviceDetailsEdit.php

front/js/db_methods.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function renderList(
3232
// remove first item containing the SQL query
3333
options.shift();
3434

35-
const apiUrl = `php/server/dbHelper.php?action=read&rawSql=${encodeURIComponent(sqlQuery)}`;
35+
const apiUrl = `php/server/dbHelper.php?action=read&rawSql=${btoa(encodeURIComponent(sqlQuery))}`;
3636

3737
$.get(apiUrl, function (sqlOptionsData) {
3838

front/php/server/dbHelper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
}
6464

6565
if (isset ($_REQUEST['rawSql'])) {
66-
$rawSql = $_REQUEST['rawSql'];
66+
$rawSql = urldecode(base64_decode($_REQUEST['rawSql']));
6767
}
6868

6969
if (isset ($_REQUEST['dbtable'])) {

front/php/templates/language/ca_ca.json

100644100755
File mode changed.

front/report_templates/report_sample.html

-178
This file was deleted.
+30-34
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,46 @@
1-
Report Date: 2021-12-08 12:30
2-
Server: Synology-NAS
3-
41
New Devices
52
----------------------
63
Name: (name not found)
7-
MAC: 2c:2c:2c:2c:2c:2c
8-
IP: 192.168.1.121
9-
Time: 2021-12-08 12:30
10-
More Info: Micro-Star INTL CO., LTD.
4+
MAC: 2c:2c:2c:2c:2c:2c
5+
IP: 192.168.1.121
6+
Time: 2021-12-08 12:30
7+
More Info: Micro-Star INTL CO., LTD.
118

129
Name: (name not found)
13-
MAC: 2c:2c:2c:2c:2c:2c
14-
IP: 192.168.1.151
15-
Time: 2021-12-08 12:30
16-
More Info: Espressif Inc.
17-
18-
10+
MAC: 2c:2c:2c:2c:2c:2c
11+
IP: 192.168.1.151
12+
Time: 2021-12-08 12:30
13+
More Info: Espressif Inc.
1914

2015
Events
2116
----------------------
2217
Name: Samsung
23-
MAC: 2c:2c:2c:2c:2c:2c
24-
IP: 192.168.1.27
25-
Time: 2021-12-08 12:30
26-
Event: Connected
27-
More Info:
18+
MAC: 2c:2c:2c:2c:2c:2c
19+
IP: 192.168.1.27
20+
Time: 2021-12-08 12:30
21+
Event: Connected
22+
More Info:
2823

2924
Name: (name not found)
30-
MAC: 2c:2c:2c:2c:2c:2c
31-
IP: 192.168.1.6
32-
Time: 2021-12-08 12:30
33-
Event: Disconnected
34-
More Info:
25+
MAC: 2c:2c:2c:2c:2c:2c
26+
IP: 192.168.1.6
27+
Time: 2021-12-08 12:30
28+
Event: Disconnected
29+
More Info:
3530

3631
Name: Google-Home-Mini
37-
MAC: 2c:2c:2c:2c:2c:2c
38-
IP: 192.168.1.16
39-
Time: 2021-12-08 12:30
40-
Event: Disconnected
41-
More Info:
32+
MAC: 2c:2c:2c:2c:2c:2c
33+
IP: 192.168.1.16
34+
Time: 2021-12-08 12:30
35+
Event: Disconnected
36+
More Info:
4237

4338
Name: (name not found)
44-
MAC: 2c:2c:2c:2c:2c:2c
45-
IP: 192.168.1.119
46-
Time: 2021-12-08 12:30
47-
Event: Disconnected
48-
More Info:
49-
39+
MAC: 2c:2c:2c:2c:2c:2c
40+
IP: 192.168.1.119
41+
Time: 2021-12-08 12:30
42+
Event: Disconnected
43+
More Info:
5044

45+
Report Date: 2021-12-08 12:30
46+
Server: Synology-NAS

front/report_templates/report_template.html

+10-27
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,18 @@
88
-->
99

1010
<html>
11-
12-
<head>
13-
</head>
14-
11+
<head></head>
1512
<body>
1613
<font face=sans-serif>
1714
<table align=center width=100% cellpadding=0 cellspacing=0 style="border-radius: 5px;">
1815
<tr>
1916
<td bgcolor=#3c8dbc align=center style="padding: 20px 10px 10px 10px; font-size: 20px; color:#ffffff; border-top-right-radius: 5px; border-top-left-radius: 5px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2)">
20-
<img src="https://netalertx.com/favicon.ico" alt="NetAlertX Logo" style="vertical-align: middle;" width="32" height="32" />
21-
Net<b>Alert</b><sup>x</sup>
22-
</td>
23-
</tr>
24-
25-
<tr>
26-
<td>
27-
<table width=100% border=0 bgcolor=#4b99d3 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 15px; text-align:center; color:#ffffff"> <tr>
28-
<td width=100% bgcolor="#3c8dbc"> Report Date: <b><REPORT_DATE></b> </td>
29-
</tr>
30-
</table>
17+
<img src="https://netalertx.com/NetAlertX_logo.png" alt="NetAlertX Logo" style="vertical-align: middle;" width="32" height="32" />
18+
Net<b>Alert</b><sup>x</sup>
3119
</td>
3220
</tr>
33-
3421
<tr>
3522
<td height=200 valign=top style="padding: 10px">
36-
37-
3823
<NEW_DEVICES_TABLE>
3924
<DOWN_DEVICES_TABLE>
4025
<DOWN_RECONNECTED_TABLE>
@@ -46,16 +31,14 @@
4631

4732
<tr>
4833
<td>
49-
<table width=100% bgcolor=#3c8dbc cellpadding=5px cellspacing=0 style="font-size: 13px; font-weight: bold; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px;">
50-
<tr>
34+
<table width=100% bgcolor=#3c8dbc cellpadding=5px cellspacing=0 style="font-size: 10px; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px;">
35+
<tr>
5136
<td width=50% style="text-align:center;color: white;" bgcolor="#3c8dbc">
52-
<a href="https://github.com/jokob-sk/NetAlertX" target="_blank" style="color: white">NetAlertX</a>
53-
<a href=".." target="_blank" style="color: white"> (<SERVER_NAME>)</a>
54-
<br><span style="display:inline-block;color: white; transform: rotate(180deg)">&copy;</span>2022
55-
<a style="color: white" href="mailto:[email protected]?subject=NetAlertX">jokob-sk</a> | <b>Built on: <BUILD_DATE> </b> | <b> Version: <BUILD_VERSION> </b> |
56-
<a href="https://github.com/jokob-sk/NetAlertX/tree/main/docs" target="_blank" style="color: white">
57-
<span>Docs <i class="fa fa-circle-question"></i>
58-
</a><span>
37+
<NEW_VERSION>
38+
| Sent: <REPORT_DATE>
39+
| Server: <SERVER_NAME>
40+
| Built: <BUILD_DATE>
41+
| Version: <BUILD_VERSION>
5942
</td>
6043
</tr>
6144
</table>
+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
Report Date: <REPORT_DATE>
2-
Server: <SERVER_NAME>
3-
41
<NEW_DEVICES_TABLE>
52
<DOWN_DEVICES_TABLE>
63
<DOWN_RECONNECTED_TABLE>
74
<EVENTS_TABLE>
85
<PLUGINS_TABLE>
6+
7+
Report Date: <REPORT_DATE>
8+
Server: <SERVER_NAME>
9+
<NEW_VERSION>

0 commit comments

Comments
 (0)