+
+
+
+
\ No newline at end of file
diff --git a/front/js/pialert_common.js b/front/js/pialert_common.js
index e88a319c..d8e7e891 100755
--- a/front/js/pialert_common.js
+++ b/front/js/pialert_common.js
@@ -486,6 +486,11 @@ function navigateToDeviceWithIp (ip) {
// -----------------------------------------------------------------------------
function getNameByMacAddress(macAddress) {
+ return getDeviceDataByMacAddress(macAddress, "name")
+}
+
+// -----------------------------------------------------------------------------
+function getDeviceDataByMacAddress(macAddress, property) {
const sessionDataKey = 'devicesListAll';
const sessionData = sessionStorage.getItem(sessionDataKey);
@@ -499,7 +504,39 @@ function getNameByMacAddress(macAddress) {
for (const device of devices) {
if (device.mac === macAddress) {
- return device.name;
+ if ( device.mac == 'd2:a4:1a:74:ae:86')
+ {
+ console.log(device)
+ }
+
+ return device[property];
+ }
+ }
+
+ return "Unknown"; // Return a default value if MAC address is not found
+}
+
+// -----------------------------------------------------------------------------
+function getDeviceDataByMacAddress_NEW(macAddress, property) {
+
+ const sessionDataKey = 'devicesListAll_JSON';
+ const sessionData = sessionStorage.getItem(sessionDataKey);
+
+ if (!sessionData) {
+ console.log(`Session variable "${sessionDataKey}" not found.`);
+ return "Unknown";
+ }
+
+ const devices = JSON.parse(sessionData);
+
+ for (const device of devices) {
+ if (device.mac === macAddress) {
+ if ( device.mac == 'd2:a4:1a:74:ae:86')
+ {
+ console.log(device)
+ }
+
+ return device[property];
}
}
@@ -531,6 +568,23 @@ function initDeviceListAll()
}
var devicesListAll = []; // this will contain a list off all devices
+// -----------------------------------------------------------------------------
+
+function initDeviceListAll_JSON()
+{
+
+ $.get('/api/table_devices.json', function(data) {
+
+ console.log(data)
+
+ devicesListAll_JSON = data["data"]
+
+ setCache('devicesListAll_JSON', JSON.stringify(devicesListAll_JSON))
+ });
+
+}
+
+var devicesListAll_JSON = []; // this will contain a list off all devices
// -----------------------------------------------------------------------------
function isEmpty(value)
@@ -542,6 +596,7 @@ function isEmpty(value)
cacheSettings()
cacheStrings()
initDeviceListAll()
+initDeviceListAll_JSON()
console.log("init pialert_common.js")
diff --git a/front/php/templates/language/en_us.json b/front/php/templates/language/en_us.json
index 3bedc639..99001d03 100755
--- a/front/php/templates/language/en_us.json
+++ b/front/php/templates/language/en_us.json
@@ -149,7 +149,7 @@
"DevDetail_Tab_Tools_Speedtest_Description" : "The Speedtest tool measures the download speed, upload speed and latency of the internet connection.",
"DevDetail_Tab_Tools_Speedtest_Start" : "Start Speedtest",
"DevDetail_Tab_Tools_Traceroute_Title": "Traceroute",
- "DevDetail_Tab_Tools_Traceroute_Description": "Traceroute is a network diagnostic command used to trace the path that data packets take from one host to another.
The command uses the Internet Control Message Protocol (ICMP) to send packets to intermediate nodes on the route, each intermediate node responds with an ICMP time-out (TTL timed out) packet.
The output of the traceroute command displays the IP address of each intermediate node on the route.
The output of the traceroute command displays the IP address of each intermediate node on the route.
The traceroute command can be used to diagnose network problems, such as delays, packet loss, and blocked routes.
It can also be used to identify the location of an intermediate node on a network.",
+ "DevDetail_Tab_Tools_Traceroute_Description": "Traceroute is a network diagnostic command used to trace the path that data packets take from one host to another.
The command uses the Internet Control Message Protocol (ICMP) to send packets to intermediate nodes on the route, each intermediate node responds with an ICMP time-out (TTL timed out) packet.
The output of the traceroute command displays the IP address of each intermediate node on the route.
The traceroute command can be used to diagnose network problems, such as delays, packet loss, and blocked routes.
It can also be used to identify the location of an intermediate node on a network.",
"DevDetail_Tab_Tools_Traceroute_Start": "Start Traceroute",
"DevDetail_Tab_Tools_Traceroute_Error": "Error: IP address is not valid",
"DevDetail_Tab_Nmap" : " Nmap",
@@ -232,7 +232,8 @@
"DevDetail_Nmap_buttonSkipDiscovery" : "Skip host discovery",
"DevDetail_Nmap_buttonSkipDiscovery_text" : "Skip host discovery (-Pn option): Default scan without host discovery",
"DevDetail_Nmap_resultsLink" : "You can leave this page after starting a scan. Results will be also available in the pialert_front.log file.",
- "DevDetail_Nmap_Scans": "Nmap Scans",
+ "DevDetail_Nmap_Scans": "Manual Nmap Scans",
+ "DevDetail_Nmap_Scans_desc": "Here you can execute manual NMAP scans. You can also schedule regular automatic NMAP scans via the Services & Ports (NMAP) plugin. Head to Settings to find out more",
"BackDevDetail_Actions_Title_Run" : "Run action",
"BackDevDetail_Actions_Not_Registered" : "Action not registered: ",
"BackDevDetail_Actions_Ask_Run" : "Do you want to execute the action?",
diff --git a/front/plugins/csv_backup/README_DE.md b/front/plugins/csv_backup/README_DE.md
old mode 100644
new mode 100755
diff --git a/front/plugins/csv_backup/README_ES.md b/front/plugins/csv_backup/README_ES.md
old mode 100644
new mode 100755
diff --git a/pialert/reporting.py b/pialert/reporting.py
index c5fd21a0..1b259917 100755
--- a/pialert/reporting.py
+++ b/pialert/reporting.py
@@ -100,7 +100,11 @@ def construct_notifications(db, sqlQuery, tableTitle, skipText = False, supplied
notiStruc = noti_struc(jsn, text, html)
- mylog('debug', ['[Notification] notiStruc:', json.dumps(notiStruc.__dict__, indent=4) ])
+
+ if not notiStruc.json['data'] and not notiStruc.text and not notiStruc.html:
+ mylog('debug', '[Notification] notiStruc is empty')
+ else:
+ mylog('debug', ['[Notification] notiStruc:', json.dumps(notiStruc.__dict__, indent=4)])
return notiStruc