diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index b971a490..0d79320e 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -36,7 +36,7 @@ jobs:
with:
# list of Docker images to use as base name for tags
images: |
- jokobsk/pi.alert_dev
+ jokobsk/pi.alert
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=latest
diff --git a/README.md b/README.md
index 7857238d..6eb21842 100644
--- a/README.md
+++ b/README.md
@@ -196,7 +196,7 @@ Instructions for [leiweibau's fork](https://github.com/leiweibau/Pi.Alert/)
[screen2]: ./docs/img/2_2_device_sessions.jpg "Screen 2"
[screen3]: ./docs/img/2_3_device_presence.jpg "Screen 3"
[screen4]: ./docs/img/3_presence.jpg "Screen 4"
-[screen5]: ./docs/img/2_4_device_nmap.jpg "Screen 5"
+[screen5]: ./docs/img/2_4_network.png "Screen 5"
[screen6]: ./docs/img/2_5_device_nmap_ready.jpg "Screen 6"
[report1]: ./docs/img/4_report_1.jpg "Report sample 1"
[report2]: ./docs/img/4_report_2.jpg "Report sample 2"
diff --git a/docs/img/2_4_network.png b/docs/img/2_4_network.png
new file mode 100644
index 00000000..8570bcf7
Binary files /dev/null and b/docs/img/2_4_network.png differ
diff --git a/front/network.php b/front/network.php
index 1b419fb5..d522c49f 100644
--- a/front/network.php
+++ b/front/network.php
@@ -74,7 +74,7 @@
}
// Create pane content (displayed inside of the tabs)
- function createPane($node_mac, $node_name, $node_status, $node_type, $node_ports_count, $activetab){
+ function createPane($node_mac, $node_name, $node_status, $node_type, $node_ports_count, $node_parent_mac, $activetab){
global $pia_lang; //language strings
// online/offline status circle (red/green)
@@ -117,6 +117,16 @@
.$node_badge.
'
+
+ |
+ '.$pia_lang['DevDetail_MainInfo_Network'].'
+ |
+
+
+ '.$node_parent_mac.'
+
+ |
+
@@ -217,7 +227,7 @@
$str_table_close = '
';
- // no connected device - don't render table, just dispaly some info
+ // no connected device - don't render table, just display some info
if($str_table_rows == "")
{
$str_table = "
@@ -254,24 +264,25 @@
// \
// PC (leaf)
- $sql = "SELECT node_name, node_mac, online, node_type, node_ports_count
- FROM
- (
- SELECT a.dev_Name as node_name,
- a.dev_MAC as node_mac,
- a.dev_PresentLastScan as online,
- a.dev_DeviceType as node_type
- FROM Devices a
- WHERE a.dev_DeviceType in ('AP', 'Gateway', 'Powerline', 'Switch', 'WLAN', 'PLC', 'Router','USB LAN Adapter', 'USB WIFI Adapter', 'Internet')
- ) t1
- LEFT JOIN
- (
- SELECT b.dev_Network_Node_MAC_ADDR as node_mac_2,
- count() as node_ports_count
- FROM Devices b
- WHERE b.dev_Network_Node_MAC_ADDR NOT NULL group by b.dev_Network_Node_MAC_ADDR
- ) t2
- ON (t1.node_mac = t2.node_mac_2);
+ $sql = "SELECT node_name, node_mac, online, node_type, node_ports_count, parent_mac
+ FROM
+ (
+ SELECT a.dev_Name as node_name,
+ a.dev_MAC as node_mac,
+ a.dev_PresentLastScan as online,
+ a.dev_DeviceType as node_type,
+ a.dev_Network_Node_MAC_ADDR as parent_mac
+ FROM Devices a
+ WHERE a.dev_DeviceType in ('AP', 'Gateway', 'Powerline', 'Switch', 'WLAN', 'PLC', 'Router','USB LAN Adapter', 'USB WIFI Adapter', 'Internet')
+ ) t1
+ LEFT JOIN
+ (
+ SELECT b.dev_Network_Node_MAC_ADDR as node_mac_2,
+ count() as node_ports_count
+ FROM Devices b
+ WHERE b.dev_Network_Node_MAC_ADDR NOT NULL group by b.dev_Network_Node_MAC_ADDR
+ ) t2
+ ON (t1.node_mac = t2.node_mac_2);
";
$result = $db->query($sql);
@@ -284,6 +295,7 @@
'node_name' => $row['node_name'],
'online' => $row['online'],
'node_type' => $row['node_type'],
+ 'parent_mac' => $row['parent_mac'],
'node_ports_count' => $row['node_ports_count']);
}
@@ -317,6 +329,7 @@
$row['online'],
$row['node_type'],
$row['node_ports_count'],
+ $row['parent_mac'],
$activetab);
$activetab = ""; // reset active tab indicator, only the first tab is active
@@ -326,11 +339,93 @@
$db->close();
?>
-
-
-
+
+
+
+ query($func_sql);
+
+ // array
+ $tableData = array();
+ while ($row = $func_result -> fetchArray (SQLITE3_ASSOC)) {
+ // Push row data
+ $tableData[] = array( 'mac' => $row['mac'],
+ 'online' => $row['online'],
+ 'name' => $row['name'],
+ 'last_ip' => $row['last_ip']);
+ }
+
+ // Don't do anything if empty
+ if (!(empty($tableData))) {
+ $str_table_header = '
+
+
+
+
+ '.$pia_lang['Network_UnnasignedDevices'].'
+
+
+
+
+ | '.$pia_lang['Network_Table_State'].' |
+ '.$pia_lang['Network_Table_Hostname'].' |
+ '.$pia_lang['Network_Table_IP'].' |
+
';
+
+ $str_table_rows = "";
+
+ foreach ($tableData as $row) {
+
+ if ($row['online'] == 1) {
+ $state = badge_online;
+ } else {
+ $state = badge_offline;
+ }
+
+ $str_table_rows = $str_table_rows.
+ '
+ | '
+ .$state.
+ ' |
+
+
+ '.$row['name'].'
+
+ |
+ '
+ .$row['last_ip'].
+ ' |
+
';
+
+ }
+
+ $str_table_close = '
+
+
+
+
';
+
+ // write the html
+ echo $str_table_header.$str_table_rows.$str_table_close;
+ }
+
+ $db->close();
+ ?>
+
diff --git a/front/php/templates/language/en_us.php b/front/php/templates/language/en_us.php
index 1bc043b1..fe82bd7d 100644
--- a/front/php/templates/language/en_us.php
+++ b/front/php/templates/language/en_us.php
@@ -334,5 +334,6 @@ $pia_lang['Network_ManageDel_Submit'] = 'Delete';
$pia_lang['Network_Table_State'] = 'State';
$pia_lang['Network_Table_Hostname'] = 'Hostname';
$pia_lang['Network_Table_IP'] = 'IP';
+$pia_lang['Network_UnnasignedDevices'] = 'Unnasigned devices';
?>
\ No newline at end of file