mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
CSS and row count fixes
This commit is contained in:
@@ -217,9 +217,6 @@ if (sys.version_info > (3,0)):
|
|||||||
else:
|
else:
|
||||||
execfile (fullConfPath)
|
execfile (fullConfPath)
|
||||||
|
|
||||||
|
|
||||||
deviceUrl = REPORT_DASHBOARD_URL + '/deviceDetails.php?mac='
|
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# USER CONFIG VARIABLES - END
|
# USER CONFIG VARIABLES - END
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
@@ -264,9 +261,13 @@ def main ():
|
|||||||
upgradeDB()
|
upgradeDB()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
|
||||||
# update NOW time
|
# update NOW time
|
||||||
time_now = datetime.datetime.now()
|
time_now = datetime.datetime.now()
|
||||||
|
|
||||||
|
# re-load user configuration
|
||||||
|
importConfig()
|
||||||
|
|
||||||
# proceed if 1 minute passed
|
# proceed if 1 minute passed
|
||||||
if last_run + timedelta(minutes=1) < time_now :
|
if last_run + timedelta(minutes=1) < time_now :
|
||||||
|
|
||||||
@@ -282,9 +283,6 @@ def main ():
|
|||||||
startTime = time_now
|
startTime = time_now
|
||||||
startTime = startTime.replace (microsecond=0)
|
startTime = startTime.replace (microsecond=0)
|
||||||
|
|
||||||
# re-load user configuration
|
|
||||||
importConfig()
|
|
||||||
|
|
||||||
# determine run/scan type based on passed time
|
# determine run/scan type based on passed time
|
||||||
if last_internet_IP_scan + timedelta(minutes=3) < time_now:
|
if last_internet_IP_scan + timedelta(minutes=3) < time_now:
|
||||||
cycle = 'internet_IP'
|
cycle = 'internet_IP'
|
||||||
@@ -315,9 +313,12 @@ def main ():
|
|||||||
# Close SQL
|
# Close SQL
|
||||||
closeDB()
|
closeDB()
|
||||||
|
|
||||||
# Final menssage
|
# Final message
|
||||||
if cycle != "":
|
if cycle != "":
|
||||||
file_print('[', time_now.replace (microsecond=0), '] Last action: ', cycle)
|
action = str(cycle)
|
||||||
|
if cycle == "1":
|
||||||
|
action = "network_scan"
|
||||||
|
file_print('[', time_now.replace (microsecond=0), '] Last action: ', action)
|
||||||
cycle = ""
|
cycle = ""
|
||||||
|
|
||||||
# Footer
|
# Footer
|
||||||
@@ -566,7 +567,6 @@ def update_devices_MAC_vendors (pArg = ''):
|
|||||||
recordsToUpdate.append ([vendor, device['dev_MAC']])
|
recordsToUpdate.append ([vendor, device['dev_MAC']])
|
||||||
|
|
||||||
# Print log
|
# Print log
|
||||||
file_print('')
|
|
||||||
file_print(" Devices Ignored: ", ignored)
|
file_print(" Devices Ignored: ", ignored)
|
||||||
file_print(" Vendors Not Found:", notFound)
|
file_print(" Vendors Not Found:", notFound)
|
||||||
file_print(" Vendors updated: ", len(recordsToUpdate) )
|
file_print(" Vendors updated: ", len(recordsToUpdate) )
|
||||||
@@ -940,13 +940,13 @@ def print_scan_stats ():
|
|||||||
sql.execute ("""SELECT COUNT(*) FROM CurrentScan
|
sql.execute ("""SELECT COUNT(*) FROM CurrentScan
|
||||||
WHERE cur_ScanMethod='arp-scan' AND cur_ScanCycle = ? """,
|
WHERE cur_ScanMethod='arp-scan' AND cur_ScanCycle = ? """,
|
||||||
(cycle,))
|
(cycle,))
|
||||||
file_print(' arp-scan detected....: ', str (sql.fetchone()[0]) )
|
file_print(' arp-scan detected..: ', str (sql.fetchone()[0]) )
|
||||||
|
|
||||||
# Devices Pi-hole
|
# Devices Pi-hole
|
||||||
sql.execute ("""SELECT COUNT(*) FROM CurrentScan
|
sql.execute ("""SELECT COUNT(*) FROM CurrentScan
|
||||||
WHERE cur_ScanMethod='PiHole' AND cur_ScanCycle = ? """,
|
WHERE cur_ScanMethod='PiHole' AND cur_ScanCycle = ? """,
|
||||||
(cycle,))
|
(cycle,))
|
||||||
file_print(' Pi-hole detected.....: +' + str (sql.fetchone()[0]) )
|
file_print(' Pi-hole detected...: +' + str (sql.fetchone()[0]) )
|
||||||
|
|
||||||
# New Devices
|
# New Devices
|
||||||
sql.execute ("""SELECT COUNT(*) FROM CurrentScan
|
sql.execute ("""SELECT COUNT(*) FROM CurrentScan
|
||||||
@@ -961,7 +961,7 @@ def print_scan_stats ():
|
|||||||
WHERE dev_MAC = cur_MAC AND dev_ScanCycle = cur_ScanCycle
|
WHERE dev_MAC = cur_MAC AND dev_ScanCycle = cur_ScanCycle
|
||||||
AND dev_ScanCycle = ? """,
|
AND dev_ScanCycle = ? """,
|
||||||
(cycle,))
|
(cycle,))
|
||||||
file_print('')
|
|
||||||
file_print(' Devices in this cycle..: ' + str (sql.fetchone()[0]) )
|
file_print(' Devices in this cycle..: ' + str (sql.fetchone()[0]) )
|
||||||
|
|
||||||
# Down Alerts
|
# Down Alerts
|
||||||
@@ -1512,8 +1512,11 @@ json_final = []
|
|||||||
def email_reporting ():
|
def email_reporting ():
|
||||||
global mail_text
|
global mail_text
|
||||||
global mail_html
|
global mail_html
|
||||||
|
|
||||||
|
deviceUrl = REPORT_DASHBOARD_URL + '/deviceDetails.php?mac='
|
||||||
|
|
||||||
# Reporting section
|
# Reporting section
|
||||||
file_print('\nCheck if something to report')
|
file_print('Check if something to report')
|
||||||
openDB()
|
openDB()
|
||||||
|
|
||||||
# prepare variables for JSON construction
|
# prepare variables for JSON construction
|
||||||
@@ -2211,9 +2214,20 @@ def start_mqtt_thread ():
|
|||||||
# DB
|
# DB
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
def importConfig ():
|
def importConfig ():
|
||||||
openDB()
|
|
||||||
|
|
||||||
# file_print('pialertPath:', pialertPath)
|
# global SCAN_SUBNETS, PRINT_LOG, TIMEZONE, PIALERT_WEB_PROTECTION, PIALERT_WEB_PASSWORD, INCLUDED_SECTIONS, SCAN_CYCLE_MINUTES, DAYS_TO_KEEP_EVENTS, REPORT_DASHBOARD_URL
|
||||||
|
|
||||||
|
# load the variables from pialert.conf
|
||||||
|
if (sys.version_info > (3,0)):
|
||||||
|
# file_print(">>>>>oooooo>>>>", PRINT_LOG)
|
||||||
|
d = {}
|
||||||
|
exec(open(fullConfPath).read(), d ) #here
|
||||||
|
else:
|
||||||
|
execfile (fullConfPath, globals())
|
||||||
|
|
||||||
|
# file_print(">>>>>>>>>", PRINT_LOG)
|
||||||
|
|
||||||
|
openDB()
|
||||||
|
|
||||||
# Code_Name, Display_Name, Description, Type, Options, Value, Group
|
# Code_Name, Display_Name, Description, Type, Options, Value, Group
|
||||||
settings = [
|
settings = [
|
||||||
@@ -2484,7 +2498,7 @@ def print_log (pText):
|
|||||||
log_timestamp2 = datetime.datetime.now()
|
log_timestamp2 = datetime.datetime.now()
|
||||||
|
|
||||||
# Print line + time + elapsed time + text
|
# Print line + time + elapsed time + text
|
||||||
file_print('[LOG_PRINT] > ',
|
file_print('[LOG_PRINT] ',
|
||||||
log_timestamp2, ' ',
|
log_timestamp2, ' ',
|
||||||
log_timestamp2 - log_timestamp, ' ',
|
log_timestamp2 - log_timestamp, ' ',
|
||||||
pText)
|
pText)
|
||||||
|
|||||||
@@ -579,18 +579,18 @@ height: 50px;
|
|||||||
|
|
||||||
.setting_name
|
.setting_name
|
||||||
{
|
{
|
||||||
width:20%;
|
width:19%;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting_description
|
.setting_description
|
||||||
{
|
{
|
||||||
width:50%;
|
width:46%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting_input
|
.setting_input
|
||||||
{
|
{
|
||||||
width:30%;
|
width:35%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.center
|
.center
|
||||||
@@ -609,7 +609,7 @@ height: 50px;
|
|||||||
|
|
||||||
.settings_content {
|
.settings_content {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background-color: #272c30;
|
/* background-color: #272c30; */
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -220,11 +220,16 @@
|
|||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function main () {
|
function main () {
|
||||||
|
|
||||||
// get parameter value
|
// get parameter value
|
||||||
$.get('php/server/parameters.php?action=get¶meter='+ parTableRows, function(data) {
|
$.get('php/server/parameters.php?action=get¶meter='+ parTableRows, function(data) {
|
||||||
var result = JSON.parse(data);
|
var result = JSON.parse(data);
|
||||||
|
|
||||||
|
result = parseInt(result, 10)
|
||||||
|
|
||||||
if (Number.isInteger (result) ) {
|
if (Number.isInteger (result) ) {
|
||||||
tableRows = result;
|
tableRows = result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// get parameter value
|
// get parameter value
|
||||||
|
|||||||
@@ -206,6 +206,7 @@ function main () {
|
|||||||
// get parameter value
|
// get parameter value
|
||||||
$.get('php/server/parameters.php?action=get¶meter='+ parTableRows, function(data) {
|
$.get('php/server/parameters.php?action=get¶meter='+ parTableRows, function(data) {
|
||||||
var result = JSON.parse(data);
|
var result = JSON.parse(data);
|
||||||
|
result = parseInt(result, 10)
|
||||||
if (Number.isInteger (result) ) {
|
if (Number.isInteger (result) ) {
|
||||||
tableRows = result;
|
tableRows = result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ if (submit && isset($_POST['langselector_set'])) {
|
|||||||
<div><button class="btn btn-primary" onclick="logManage('pialert_front.log','cleanLog')"><?php echo $pia_lang['Gen_Purge'];?></button></div>
|
<div><button class="btn btn-primary" onclick="logManage('pialert_front.log','cleanLog')"><?php echo $pia_lang['Gen_Purge'];?></button></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="db_tools_table_cell_b">
|
<div class="db_tools_table_cell_b">
|
||||||
<textarea id="pialert_log" class="logs" cols="70" rows="10" readonly><?php echo file_get_contents( "./log/pialert_front.log" ); ?>
|
<textarea id="pialert_front_log" class="logs" cols="70" rows="10" readonly><?php echo file_get_contents( "./log/pialert_front.log" ); ?>
|
||||||
</textarea>
|
</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -684,6 +684,9 @@ function scrollDown()
|
|||||||
var tempArea = $('#pialert_log');
|
var tempArea = $('#pialert_log');
|
||||||
$(tempArea[0]).scrollTop(tempArea[0].scrollHeight);
|
$(tempArea[0]).scrollTop(tempArea[0].scrollHeight);
|
||||||
|
|
||||||
|
tempArea = $('#pialert_front_log');
|
||||||
|
$(tempArea[0]).scrollTop(tempArea[0].scrollHeight);
|
||||||
|
|
||||||
tempArea = $('#IP_changes_log');
|
tempArea = $('#IP_changes_log');
|
||||||
$(tempArea[0]).scrollTop(tempArea[0].scrollHeight);
|
$(tempArea[0]).scrollTop(tempArea[0].scrollHeight);
|
||||||
|
|
||||||
@@ -741,6 +744,7 @@ function setCache(key, data)
|
|||||||
// load footer asynchronously not to block the page load/other sections
|
// load footer asynchronously not to block the page load/other sections
|
||||||
window.onload = function asyncFooter()
|
window.onload = function asyncFooter()
|
||||||
{
|
{
|
||||||
|
scrollDown();
|
||||||
|
|
||||||
$("#lastCommit").append('<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/jokob-sk/pi.alert/main?logo=github">');
|
$("#lastCommit").append('<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/jokob-sk/pi.alert/main?logo=github">');
|
||||||
|
|
||||||
|
|||||||
@@ -51,14 +51,6 @@ $timestamp = $date->format('Y-m-d_H-i-s');
|
|||||||
// ###################################
|
// ###################################
|
||||||
// ## GUI settings processing start
|
// ## GUI settings processing start
|
||||||
// ###################################
|
// ###################################
|
||||||
if (file_exists('../db/setting_darkmode')) {
|
|
||||||
$ENABLED_DARKMODE = True;
|
|
||||||
}
|
|
||||||
foreach (glob("../db/setting_skin*") as $filename) {
|
|
||||||
$pia_skin_selected = str_replace('setting_','',basename($filename));
|
|
||||||
}
|
|
||||||
if (isset($pia_skin_selected) == FALSE or (strlen($pia_skin_selected) == 0)) {$pia_skin_selected = 'skin-blue';}
|
|
||||||
|
|
||||||
foreach (glob("../db/setting_language*") as $filename) {
|
foreach (glob("../db/setting_language*") as $filename) {
|
||||||
$pia_lang_selected = str_replace('setting_language_','',basename($filename));
|
$pia_lang_selected = str_replace('setting_language_','',basename($filename));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ $db->close();
|
|||||||
<?php echo $pia_lang['Navigation_Settings'];?>
|
<?php echo $pia_lang['Navigation_Settings'];?>
|
||||||
</h1>
|
</h1>
|
||||||
</section>
|
</section>
|
||||||
|
<div class="content">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$html = "";
|
$html = "";
|
||||||
@@ -87,7 +87,7 @@ $db->close();
|
|||||||
|
|
||||||
// create settings groups
|
// create settings groups
|
||||||
foreach ($groups as $group) {
|
foreach ($groups as $group) {
|
||||||
$html = $html.'<section class="settings_content">
|
$html = $html.'<section class="content box">
|
||||||
<h4>'.$group.'</h4>';
|
<h4>'.$group.'</h4>';
|
||||||
|
|
||||||
// populate settings for each group
|
// populate settings for each group
|
||||||
@@ -95,7 +95,7 @@ $db->close();
|
|||||||
if($set["Group"] == $group)
|
if($set["Group"] == $group)
|
||||||
{
|
{
|
||||||
$html = $html.
|
$html = $html.
|
||||||
'<div class="table_row" >
|
'<div class=" row table_row" >
|
||||||
<div class="table_cell setting_name bold" ><label>';
|
<div class="table_cell setting_name bold" ><label>';
|
||||||
|
|
||||||
$html = $html.getString ($set['Code_Name'].'_name', $set['Display_Name'], $pia_lang).'</label>';
|
$html = $html.getString ($set['Code_Name'].'_name', $set['Display_Name'], $pia_lang).'</label>';
|
||||||
@@ -224,6 +224,7 @@ $db->close();
|
|||||||
|
|
||||||
echo $html;
|
echo $html;
|
||||||
?>
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- /.content -->
|
<!-- /.content -->
|
||||||
<div class="row" >
|
<div class="row" >
|
||||||
|
|||||||
Reference in New Issue
Block a user