mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
more logging to debug pholus issues
This commit is contained in:
@@ -551,7 +551,7 @@ def importConfig ():
|
||||
lastTimeImported = time.time()
|
||||
|
||||
# Used to display a message in the UI
|
||||
sql.executemany ("""INSERT INTO Parameters ("par_ID", "par_Value") VALUES (?, ?)""", [('Back_Settings_Imported', str(lastTimeImported) )])
|
||||
sql.execute ("""UPDATE Parameters set "par_Value" = ? where "par_ID" = "Back_Settings_Imported" """, (timeNow(),))
|
||||
|
||||
commitDB()
|
||||
|
||||
@@ -2878,7 +2878,7 @@ def upgradeDB ():
|
||||
('Front_Devices_Order', '[[3,"desc"],[0,"asc"]]'),
|
||||
('Front_Devices_Rows', '100'),
|
||||
('Front_Details_Tab', 'tabDetails'),
|
||||
('Back_Settings_Imported', ''),
|
||||
('Back_Settings_Imported', timeNow()),
|
||||
('Back_App_State', 'Initializing')
|
||||
]
|
||||
|
||||
|
||||
@@ -609,6 +609,7 @@ height: 50px;
|
||||
/*settings*/
|
||||
|
||||
@media (max-width: 767px) {
|
||||
/* hide on mobile */
|
||||
.setting_description {
|
||||
/* color: red; */
|
||||
display: none;
|
||||
@@ -624,12 +625,12 @@ height: 50px;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.setting_description {
|
||||
/* color: rgb(0, 255, 106); */
|
||||
/* color: green; */
|
||||
display: block;
|
||||
}
|
||||
.setting_input{
|
||||
width:35%;
|
||||
/* background-color: rgb(0, 255, 106); */
|
||||
/* background-color: green; */
|
||||
}
|
||||
.setting_name
|
||||
{
|
||||
|
||||
@@ -51,6 +51,7 @@ CommitDB();
|
||||
<h1 id="pageTitle">
|
||||
<?php echo lang('Navigation_Settings');?>
|
||||
</h1>
|
||||
<span id="lastImportedTime"></span>
|
||||
</section>
|
||||
<div class="content">
|
||||
<?php
|
||||
@@ -248,11 +249,33 @@ CommitDB();
|
||||
// number of settings has to be equal to
|
||||
var settingsNumber = 53;
|
||||
|
||||
// Wrong number of settings processing
|
||||
if(<?php echo count($settings)?> != settingsNumber)
|
||||
{
|
||||
showModalOk('WARNING', '<?php echo lang("settings_missing")?>');
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------
|
||||
function getParam(targetId, key, skipCache = false) {
|
||||
|
||||
skipCacheQuery = "";
|
||||
|
||||
if(skipCache)
|
||||
{
|
||||
skipCacheQuery = "&skipcache";
|
||||
}
|
||||
|
||||
// get parameter value
|
||||
$.get('php/server/parameters.php?action=get¶meter='+ key + skipCacheQuery, function(data) {
|
||||
var result = data;
|
||||
|
||||
document.getElementById(targetId).innerHTML = result.replaceAll('"', '');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
function addInterface()
|
||||
{
|
||||
ipMask = $('#ipMask').val();
|
||||
@@ -273,11 +296,13 @@ CommitDB();
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
function removeInterfaces()
|
||||
{
|
||||
$('#SCAN_SUBNETS').empty();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
function collectSettings()
|
||||
{
|
||||
var settingsArray = [];
|
||||
@@ -315,6 +340,7 @@ CommitDB();
|
||||
return settingsArray;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
function saveSettings() {
|
||||
if(<?php echo count($settings)?> != settingsNumber)
|
||||
{
|
||||
@@ -332,6 +358,15 @@ CommitDB();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<script defer>
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// Show last time settings have been imported
|
||||
getParam("lastImportedTime", "Back_Settings_Imported", skipCache = true);
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -884,7 +884,9 @@ def main():
|
||||
file_print("I will sniff for ",values.sniffer_timeout," seconds, unless interrupted by Ctrl-C")
|
||||
pr = multiprocessing.Process(target=Sniffer, args=(myfilter, values.interface, float(values.sniffer_timeout),q,values.dns,values.show_ttl, values.dos_ttl, values.conflict, values.ttl,values.d4,values.d6, values.target_mac, values.auto_fake_responses,source_IPv6, source_IPv4, target_mac1, target_mac2, source_mac,values.hlimit,values.workstation,values.printer,values.googlecast,values.airtv,values.flood,values.flooding_timeout,values.flooding_interval,values.v4,values.v6))
|
||||
pr.daemon = True
|
||||
file_print(">>>>>>> Timestamp 0.01: ", timeNow())
|
||||
pr.start()
|
||||
file_print(">>>>>>> Timestamp 0.02: ", timeNow())
|
||||
file_print("------------------------------------------------------------------------")
|
||||
time.sleep(1)#to make sure than sniffer has started before we proceed, otherwise you may miss some traffic
|
||||
##########################################################################################################
|
||||
@@ -1010,7 +1012,9 @@ def main():
|
||||
############################################################################################
|
||||
if pr:
|
||||
try:
|
||||
file_print(">>>>>>> Timestamp 6.1: ", timeNow())
|
||||
pr.join()
|
||||
file_print(">>>>>>> Timestamp 6.2: ", timeNow())
|
||||
except KeyboardInterrupt:
|
||||
file_print("Exiting on user's request 2")
|
||||
exit(0)
|
||||
|
||||
Reference in New Issue
Block a user