cleanup + fixes
This commit is contained in:
@@ -796,7 +796,7 @@ function getDeviceDataByMacAddress(macAddress, dbColumn) {
|
|||||||
const sessionDataKey = 'devicesListAll_JSON';
|
const sessionDataKey = 'devicesListAll_JSON';
|
||||||
const sessionData = sessionStorage.getItem(sessionDataKey);
|
const sessionData = sessionStorage.getItem(sessionDataKey);
|
||||||
|
|
||||||
if (!sessionData) {
|
if (!sessionData || sessionData == "") {
|
||||||
console.log(`Session variable "${sessionDataKey}" not found.`);
|
console.log(`Session variable "${sessionDataKey}" not found.`);
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
@@ -824,7 +824,16 @@ function initDeviceListAll_JSON()
|
|||||||
|
|
||||||
devicesListAll_JSON = data["data"]
|
devicesListAll_JSON = data["data"]
|
||||||
|
|
||||||
setCache('devicesListAll_JSON', JSON.stringify(devicesListAll_JSON))
|
devicesListAll_JSON_str = JSON.stringify(devicesListAll_JSON)
|
||||||
|
|
||||||
|
if(devicesListAll_JSON_str == "")
|
||||||
|
{
|
||||||
|
setTimeout(() => {
|
||||||
|
initDeviceListAll_JSON()
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
setCache('devicesListAll_JSON', devicesListAll_JSON_str)
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -511,7 +511,7 @@
|
|||||||
{
|
{
|
||||||
"name" : "value",
|
"name" : "value",
|
||||||
"type" : "sql",
|
"type" : "sql",
|
||||||
"value" : "SELECT Dev_Name as name, dev_MAC as id FROM Devices WHERE EXISTS (SELECT 1 FROM Settings WHERE Code_Name = 'NETWORK_DEVICE_TYPES' AND LOWER(value) LIKE '%' || LOWER(dev_DeviceType) || '%' AND dev_DeviceType <> '')"
|
"value" : "SELECT '' as name, '' as id UNION SELECT Dev_Name as name, dev_MAC as id FROM Devices WHERE EXISTS (SELECT 1 FROM Settings WHERE Code_Name = 'NETWORK_DEVICE_TYPES' AND LOWER(value) LIKE '%' || LOWER(dev_DeviceType) || '%' AND dev_DeviceType <> '')"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name" : "target_macs",
|
"name" : "target_macs",
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ def execute_nslookup (ip, timeout):
|
|||||||
domain_name = ''
|
domain_name = ''
|
||||||
dns_server = ''
|
dns_server = ''
|
||||||
|
|
||||||
mylog('verbose', [f'[{pluginName}] DEBUG OUTPUT : {output}'])
|
# mylog('verbose', [f'[{pluginName}] DEBUG OUTPUT : {output}'])
|
||||||
|
|
||||||
# Parse output using case-insensitive regular expressions
|
# Parse output using case-insensitive regular expressions
|
||||||
domain_pattern = re.compile(r'name\s*=\s*([^\s]+)', re.IGNORECASE)
|
domain_pattern = re.compile(r'name\s*=\s*([^\s]+)', re.IGNORECASE)
|
||||||
@@ -118,12 +118,13 @@ def execute_nslookup (ip, timeout):
|
|||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
# An error occured, handle it
|
# An error occured, handle it
|
||||||
mylog('verbose', [f'[{pluginName}]', e.output])
|
mylog('verbose', [f'[{pluginName}]', e.output])
|
||||||
mylog('verbose', [f'[{pluginName}] ⚠ ERROR - check logs'])
|
# mylog('verbose', [f'[{pluginName}] ⚠ ERROR - check logs'])
|
||||||
except subprocess.TimeoutExpired as timeErr:
|
except subprocess.TimeoutExpired as timeErr:
|
||||||
mylog('verbose', [f'[{pluginName}] TIMEOUT - the process forcefully terminated as timeout reached'])
|
mylog('verbose', [f'[{pluginName}] TIMEOUT - the process forcefully terminated as timeout reached'])
|
||||||
|
|
||||||
if output == "": # check if the subprocess failed
|
if output == "": # check if the subprocess failed
|
||||||
mylog('verbose', [f'[{pluginName}] Scan: FAIL - check logs'])
|
tmp = 1 # can't have empty
|
||||||
|
# mylog('verbose', [f'[{pluginName}] Scan: FAIL - check logs'])
|
||||||
else:
|
else:
|
||||||
mylog('verbose', [f'[{pluginName}] Scan: SUCCESS'])
|
mylog('verbose', [f'[{pluginName}] Scan: SUCCESS'])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user