more logging to debug pholus issues

This commit is contained in:
Jokob-sk
2023-01-01 15:33:41 +11:00
parent 5ed57780a3
commit 7aa61e142e
4 changed files with 49 additions and 9 deletions

View File

@@ -551,7 +551,7 @@ def importConfig ():
lastTimeImported = time.time() lastTimeImported = time.time()
# Used to display a message in the UI # 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() commitDB()
@@ -2878,7 +2878,7 @@ def upgradeDB ():
('Front_Devices_Order', '[[3,"desc"],[0,"asc"]]'), ('Front_Devices_Order', '[[3,"desc"],[0,"asc"]]'),
('Front_Devices_Rows', '100'), ('Front_Devices_Rows', '100'),
('Front_Details_Tab', 'tabDetails'), ('Front_Details_Tab', 'tabDetails'),
('Back_Settings_Imported', ''), ('Back_Settings_Imported', timeNow()),
('Back_App_State', 'Initializing') ('Back_App_State', 'Initializing')
] ]

View File

@@ -609,6 +609,7 @@ height: 50px;
/*settings*/ /*settings*/
@media (max-width: 767px) { @media (max-width: 767px) {
/* hide on mobile */
.setting_description { .setting_description {
/* color: red; */ /* color: red; */
display: none; display: none;
@@ -624,12 +625,12 @@ height: 50px;
} }
@media (min-width: 768px) { @media (min-width: 768px) {
.setting_description { .setting_description {
/* color: rgb(0, 255, 106); */ /* color: green; */
display: block; display: block;
} }
.setting_input{ .setting_input{
width:35%; width:35%;
/* background-color: rgb(0, 255, 106); */ /* background-color: green; */
} }
.setting_name .setting_name
{ {

View File

@@ -51,6 +51,7 @@ CommitDB();
<h1 id="pageTitle"> <h1 id="pageTitle">
<?php echo lang('Navigation_Settings');?> <?php echo lang('Navigation_Settings');?>
</h1> </h1>
<span id="lastImportedTime"></span>
</section> </section>
<div class="content"> <div class="content">
<?php <?php
@@ -248,11 +249,33 @@ CommitDB();
// number of settings has to be equal to // number of settings has to be equal to
var settingsNumber = 53; var settingsNumber = 53;
// Wrong number of settings processing
if(<?php echo count($settings)?> != settingsNumber) if(<?php echo count($settings)?> != settingsNumber)
{ {
showModalOk('WARNING', '<?php echo lang("settings_missing")?>'); 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&parameter='+ key + skipCacheQuery, function(data) {
var result = data;
document.getElementById(targetId).innerHTML = result.replaceAll('"', '');
});
}
// ---------------------------------------------------------
function addInterface() function addInterface()
{ {
ipMask = $('#ipMask').val(); ipMask = $('#ipMask').val();
@@ -273,11 +296,13 @@ CommitDB();
} }
} }
// ---------------------------------------------------------
function removeInterfaces() function removeInterfaces()
{ {
$('#SCAN_SUBNETS').empty(); $('#SCAN_SUBNETS').empty();
} }
// ---------------------------------------------------------
function collectSettings() function collectSettings()
{ {
var settingsArray = []; var settingsArray = [];
@@ -315,6 +340,7 @@ CommitDB();
return settingsArray; return settingsArray;
} }
// ---------------------------------------------------------
function saveSettings() { function saveSettings() {
if(<?php echo count($settings)?> != settingsNumber) if(<?php echo count($settings)?> != settingsNumber)
{ {
@@ -332,6 +358,15 @@ CommitDB();
} }
}); });
} }
} }
</script> </script>
<script defer>
// ---------------------------------------------------------
// Show last time settings have been imported
getParam("lastImportedTime", "Back_Settings_Imported", skipCache = true);
</script>

View File

@@ -884,7 +884,9 @@ def main():
file_print("I will sniff for ",values.sniffer_timeout," seconds, unless interrupted by Ctrl-C") 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 = 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 pr.daemon = True
file_print(">>>>>>> Timestamp 0.01: ", timeNow())
pr.start() pr.start()
file_print(">>>>>>> Timestamp 0.02: ", timeNow())
file_print("------------------------------------------------------------------------") file_print("------------------------------------------------------------------------")
time.sleep(1)#to make sure than sniffer has started before we proceed, otherwise you may miss some traffic 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: if pr:
try: try:
file_print(">>>>>>> Timestamp 6.1: ", timeNow())
pr.join() pr.join()
file_print(">>>>>>> Timestamp 6.2: ", timeNow())
except KeyboardInterrupt: except KeyboardInterrupt:
file_print("Exiting on user's request 2") file_print("Exiting on user's request 2")
exit(0) exit(0)