Create and update reporting.py

Added creator banner
Added import const
Changed color in headerProps variable (color:blue --> color:white)
Modified bgcolor in headerProps variable (bgcolor=#909090 --> bgcolor=#64a0d6)
Modified bgcolor in the thProps variable (bgcolor=#909090 --> bgcolor=#64a0d6)
This commit is contained in:
Carlos V
2023-08-06 10:18:32 +02:00
committed by GitHub
parent 42ebb687f8
commit 6c166908a1

View File

@@ -1,4 +1,14 @@
#---------------------------------------------------------------------------------#
# Pi.Alert #
# Open Source Network Guard / WIFI & LAN intrusion detector #
# #
# reporting.py - Pialert Back module. Template to email reporting in HTML format #
#---------------------------------------------------------------------------------#
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 #
# jokob-sk 2022 jokob.sk@gmail.com GNU GPLv3 #
# leiweibau 2022 https://github.com/leiweibau GNU GPLv3 #
# cvc90 2023 https://github.com/cvc90 GNU GPLv3 #
#---------------------------------------------------------------------------------#
import datetime
import json
@@ -11,6 +21,7 @@ from json2table import convert
# pialert modules
import conf
import const
from const import pialertPath, logPath, apiPath
from helper import noti_struc, generate_mac_links, removeDuplicateNewLines, timeNow, hide_email, updateState, get_file_content, write_file
from logger import logResult, mylog, print_log
@@ -46,8 +57,8 @@ def construct_notifications(db, sqlQuery, tableTitle, skipText = False, supplied
return noti_struc("", "", "")
table_attributes = {"style" : "border-collapse: collapse; font-size: 12px; color:#70707", "width" : "100%", "cellspacing" : 0, "cellpadding" : "3px", "bordercolor" : "#C0C0C0", "border":"1"}
headerProps = "width='120px' style='color:blue; font-size: 16px;' bgcolor='#909090' "
thProps = "width='120px' style='color:#F0F0F0' bgcolor='#909090' "
headerProps = "width='120px' style='color:white; font-size: 16px;' bgcolor='#64a0d6' "
thProps = "width='120px' style='color:#F0F0F0' bgcolor='#64a0d6' "
build_direction = "TOP_TO_BOTTOM"
text_line = '{}\t{}\n'
@@ -522,4 +533,4 @@ def handle_test(testType):
if testType == 'REPORT_PUSHSAFER':
send_pushsafer (sample_msg)
mylog('info', ['[Test Publishers] END Test: ', testType])
mylog('info', ['[Test Publishers] END Test: ', testType])