diff --git a/front/deviceDetails.php b/front/deviceDetails.php index e17bc495..1b36361e 100644 --- a/front/deviceDetails.php +++ b/front/deviceDetails.php @@ -266,14 +266,25 @@ if ($_REQUEST['mac'] == 'Internet') { $DevDetail_Tap_temp = "Tools"; } else { $D
-
- +
+
+ + +
+ + + +
+ +
- +
@@ -803,10 +814,11 @@ function initializeiCheck () { // ----------------------------------------------------------------------------- function initializeCombos () { // Initialize combos with queries - initializeCombo ( $('#dropdownOwner')[0], 'getOwners', 'txtOwner'); - initializeCombo ( $('#dropdownDeviceType')[0], 'getDeviceTypes', 'txtDeviceType'); - initializeCombo ( $('#dropdownGroup')[0], 'getGroups', 'txtGroup'); - initializeCombo ( $('#dropdownLocation')[0], 'getLocations', 'txtLocation'); + initializeCombo ( $('#dropdownOwner')[0], 'getOwners', 'txtOwner'); + initializeCombo ( $('#dropdownDeviceType')[0], 'getDeviceTypes', 'txtDeviceType'); + initializeCombo ( $('#dropdownGroup')[0], 'getGroups', 'txtGroup'); + initializeCombo ( $('#dropdownLocation')[0], 'getLocations', 'txtLocation'); + initializeCombo ( $('#dropdownNetworkNodeMac')[0], 'getNetworkNodes', 'txtNetworkNodeMac'); // Initialize static combos initializeComboSkipRepeated (); @@ -827,10 +839,17 @@ function initializeCombo (HTMLelement, queryAction, txtDataField) { order = item['order']; } + id = item['name']; + // use explicitly specified id (value) if avaliable + if(item['id']) + { + id = item['id']; + } + // add dropdown item HTMLelement.innerHTML += '
  • '+ item['name'] + '
  • ' + txtDataField +'\',\''+ id +'\')">'+ item['name'] + '' }); }); } @@ -1120,8 +1139,8 @@ function getDeviceData (readAllData=false) { $('#txtGroup').val ('--'); $('#txtLocation').val ('--'); $('#txtComments').val ('--'); - $('#txtInfrastructure').val ('--'); - $('#txtInfrastructurePort').val ('--'); + $('#networkNodeMac').val ('--'); + $('#txtNetworkPort').val ('--'); $('#txtFirstConnection').val ('--'); $('#txtLastConnection').val ('--'); @@ -1209,8 +1228,8 @@ function getDeviceData (readAllData=false) { $('#txtGroup').val (deviceData['dev_Group']); $('#txtLocation').val (deviceData['dev_Location']); $('#txtComments').val (deviceData['dev_Comments']); - $('#txtInfrastructure').val (deviceData['dev_Infrastructure']); - $('#txtInfrastructurePort').val (deviceData['dev_Infrastructure_port']); + $('#txtNetworkNodeMac').val (deviceData['dev_Network_Node_MAC']); + $('#txtNetworkPort').val (deviceData['dev_Network_Node_port']); $('#txtFirstConnection').val (deviceData['dev_FirstConnection']); $('#txtLastConnection').val (deviceData['dev_LastConnection']); @@ -1319,8 +1338,8 @@ function setDeviceData (refreshCallback='') { + '&group=' + $('#txtGroup').val() + '&location=' + $('#txtLocation').val() + '&comments=' + $('#txtComments').val() - + '&infrastructure=' + $('#txtInfrastructure').val() - + '&infrastructureport=' + $('#txtInfrastructurePort').val() + + '&networknode=' + $('#txtNetworkNodeMac').val() + + '&networknodeport=' + $('#txtNetworkPort').val() + '&staticIP=' + ($('#chkStaticIP')[0].checked * 1) + '&scancycle=' + $('#txtScanCycle').val().split(' ')[0] + '&alertevents=' + ($('#chkAlertEvents')[0].checked * 1) @@ -1342,6 +1361,7 @@ function setDeviceData (refreshCallback='') { } + // ----------------------------------------------------------------------------- function askSkipNotifications () { // Check MAC diff --git a/front/network.php b/front/network.php index 16696be1..253b9252 100644 --- a/front/network.php +++ b/front/network.php @@ -1,368 +1,256 @@ query($sql); -// ##################################### -// ## Expand Devices Table -// ##################################### -$sql = 'ALTER TABLE "Devices" ADD "dev_Infrastructure" INTEGER'; -$result = $db->query($sql); -$sql = 'ALTER TABLE "Devices" ADD "dev_Infrastructure_port" INTEGER'; -$result = $db->query($sql); -// ##################################### -// Add New Network Devices -// ##################################### -if ($_REQUEST['Networkinsert'] == "yes") { - if (isset($_REQUEST['NetworkDeviceName']) && isset($_REQUEST['NetworkDeviceTyp'])) - { - $sql = 'INSERT INTO "network_infrastructure" ("net_device_name", "net_device_typ", "net_device_port") VALUES("'.$_REQUEST['NetworkDeviceName'].'", "'.$_REQUEST['NetworkDeviceTyp'].'", "'.$_REQUEST['NetworkDevicePort'].'")'; - $result = $db->query($sql); - } -} -// ##################################### -// Add New Network Devices -// ##################################### -if ($_REQUEST['Networkedit'] == "yes") { - if (isset($_REQUEST['NewNetworkDeviceName']) && isset($_REQUEST['NewNetworkDeviceTyp'])) - { - $sql = 'UPDATE "network_infrastructure" SET "net_device_name" = "'.$_REQUEST['NewNetworkDeviceName'].'", "net_device_typ" = "'.$_REQUEST['NewNetworkDeviceTyp'].'", "net_device_port" = "'.$_REQUEST['NewNetworkDevicePort'].'" WHERE "device_id"="'.$_REQUEST['NetworkDeviceID'].'"'; - //$sql = 'INSERT INTO "network_infrastructure" ("net_device_name", "net_device_typ", "net_device_port") VALUES("'.$_REQUEST['NetworkDeviceName'].'", "'.$_REQUEST['NetworkDeviceTyp'].'", "'.$_REQUEST['NetworkDevicePort'].'")'; - $result = $db->query($sql); - } -} -// ##################################### -// remove Network Devices -// ##################################### -if ($_REQUEST['Networkdelete'] == "yes") { - if (isset($_REQUEST['NetworkDeviceID'])) - { - $sql = 'DELETE FROM "network_infrastructure" WHERE "device_id"="'.$_REQUEST['NetworkDeviceID'].'"'; - $result = $db->query($sql); - } -} + $DBFILE = '../db/pialert.db'; + OpenDB(); + // ##################################### + // ## Expand Devices Table + // ##################################### + $sql = 'ALTER TABLE "Devices" ADD "dev_Network_Node_MAC" INTEGER'; + $result = $db->query($sql); + $sql = 'ALTER TABLE "Devices" ADD "dev_Network_Node_port" INTEGER'; + $result = $db->query($sql); ?> +
    - -
    - -

    - -

    -
    + +
    + +

    + +

    +
    - -
    -
    -
    -

    -
    - -
    -
    - -
    -
    -
    -

    -
    -
    - - -
    - -
    - - -
    -
    - - -
    -
    - -
    -
    - -
    - -
    -

    -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    - -
    - -
    -
    - -
    - -
    -

    -
    -
    - - -
    - -
    - -
    -
    - -
    -
    - -
    - -
    -'.$pia_func_netdevname.' / '.$pia_func_netdevtyp; - if ($pia_func_netdevport != "") {echo ' ('.$pia_func_netdevport.')';} - echo ''; -} -function createnetworktabcontent($pia_func_netdevid, $pia_func_netdevname, $pia_func_netdevtyp, $pia_func_netdevport, $activetab) { - global $pia_lang; - echo '
    -

    '.$pia_func_netdevname.' (ID: '.$pia_func_netdevid.')


    '; - echo '
    - - - - - - - '; - // Prepare Array for Devices with Port value - // If no Port is set, the Port number is set to 1 - if ($pia_func_netdevport == "") {$pia_func_netdevport = 1;} - // Create Array with specific length - $network_device_portname = array(); - $network_device_portmac = array(); - $network_device_portip = array(); - $network_device_portstate = array(); - // make sql query for Network Hardware ID - global $db; - $func_sql = 'SELECT * FROM "Devices" WHERE "dev_Infrastructure" = "'.$pia_func_netdevid.'"'; - $func_result = $db->query($func_sql);//->fetchArray(SQLITE3_ASSOC); - while($func_res = $func_result->fetchArray(SQLITE3_ASSOC)) { - //if(!isset($func_res['dev_Name'])) continue; - if ($func_res['dev_PresentLastScan'] == 1) {$port_state = '
    Online
    ';} else {$port_state = '
    Offline
    ';} - // Prepare Table with Port > push values in array - if ($pia_func_netdevport > 1) - { - if (stristr($func_res['dev_Infrastructure_port'], ',') == '') { - if ($network_device_portname[$func_res['dev_Infrastructure_port']] != '') {$network_device_portname[$func_res['dev_Infrastructure_port']] = $network_device_portname[$func_res['dev_Infrastructure_port']].','.$func_res['dev_Name'];} else {$network_device_portname[$func_res['dev_Infrastructure_port']] = $func_res['dev_Name'];} - if ($network_device_portmac[$func_res['dev_Infrastructure_port']] != '') {$network_device_portmac[$func_res['dev_Infrastructure_port']] = $network_device_portmac[$func_res['dev_Infrastructure_port']].','.$func_res['dev_MAC'];} else {$network_device_portmac[$func_res['dev_Infrastructure_port']] = $func_res['dev_MAC'];} - if ($network_device_portip[$func_res['dev_Infrastructure_port']] != '') {$network_device_portip[$func_res['dev_Infrastructure_port']] = $network_device_portip[$func_res['dev_Infrastructure_port']].','.$func_res['dev_LastIP'];} else {$network_device_portip[$func_res['dev_Infrastructure_port']] = $func_res['dev_LastIP'];} - if (isset($network_device_portstate[$func_res['dev_Infrastructure_port']])) {$network_device_portstate[$func_res['dev_Infrastructure_port']] = $network_device_portstate[$func_res['dev_Infrastructure_port']].','.$func_res['dev_PresentLastScan'];} else {$network_device_portstate[$func_res['dev_Infrastructure_port']] = $func_res['dev_PresentLastScan'];} - } else { - $multiport = array(); - $multiport = explode(',',$func_res['dev_Infrastructure_port']); - foreach($multiport as $row) { - $network_device_portname[trim($row)] = $func_res['dev_Name']; - $network_device_portmac[trim($row)] = $func_res['dev_MAC']; - $network_device_portip[trim($row)] = $func_res['dev_LastIP']; - $network_device_portstate[trim($row)] = $func_res['dev_PresentLastScan']; - } - unset($multiport); + +
    + '.$name.' / '.$type; + if ($port != "") { + echo ' ('.$port.')'; } - } else { - // Table without Port > echo values - // Specific icon for devicetype - if ($pia_func_netdevtyp == "WLAN") {$dev_port_icon = 'fa-wifi';} - if ($pia_func_netdevtyp == "Powerline") {$dev_port_icon = 'fa-flash';} - echo '
    '; + echo ''; } - } - // Create table with Port - if ($pia_func_netdevport > 1) - { - for ($x=1; $x<=$pia_func_netdevport; $x++) - { - // Prepare online/offline badge for later functions - $online_badge = '
    Online
    '; - $offline_badge = '
    Offline
    '; - // Set online/offline badge - echo ''; - echo ''; - // Set online/offline badge - // Check if multiple badges necessary - if (stristr($network_device_portstate[$x],',') == '') { - // Set single online/offline badge - if ($network_device_portstate[$x] == 1) {$port_state = $online_badge;} else {$port_state = $offline_badge;} - echo ''; - } else { - // Set multiple online/offline badges - $multistate = array(); - $multistate = explode(',',$network_device_portstate[$x]); - echo ''; - unset($multistate); - } - // Check if multiple Hostnames are set - // print single hostname - if (stristr($network_device_portmac[$x],',') == '') { - echo ''; - } else { - // print multiple hostnames with separate links - $multimac = array(); - $multimac = explode(',',$network_device_portmac[$x]); - $multiname = array(); - $multiname = explode(',',$network_device_portname[$x]); - echo ''; - unset($multiname, $multimac); - } - // Check if multiple IP are set - // print single IP - if (stristr($network_device_portip[$x],',') == '') { - echo ''; - } else { - // print multiple IPs - $multiip = array(); - $multiip = explode(',',$network_device_portip[$x]); - echo ''; - unset($multiip); - } - echo ''; - } - } - echo '
    Port'.$pia_lang['Network_Table_State'].''.$pia_lang['Network_Table_Hostname'].''.$pia_lang['Network_Table_IP'].'
    '.$port_state.''.$func_res['dev_Name'].''.$func_res['dev_LastIP'].'
    '.$x.''.$port_state.''; - foreach($multistate as $key => $value) { - if ($value == 1) {$port_state = $online_badge;} else {$port_state = $offline_badge;} - echo $port_state.'
    '; - } - echo '
    '.$network_device_portname[$x].''; - foreach($multiname as $key => $value) { - echo ''.$value.'
    '; - } - echo '
    '.$network_device_portip[$x].''; - foreach($multiip as $key => $value) { - echo $value.'
    '; - } - echo '
    -
    '; - echo '
    '; -} -// ##################################### -// ## End Function Setup -// ##################################### -// ##################################### -// ## Create Tabs -// ##################################### -$sql = 'SELECT "device_id", "net_device_name", "net_device_typ", "net_device_port" FROM "network_infrastructure"'; -$result = $db->query($sql);//->fetchArray(SQLITE3_ASSOC); -?> - -
    -
    + function createTabContent($mac, $name, $type, $port, $activetab) { + global $pia_lang; + echo '
    +

    '.$name.' (ID: '.str_replace(":", "_", $mac).')


    '; + echo '
    + + + + + + + '; + // Prepare Array for Devices with Port value + // If no Port is set, the Port number is set to 1 + if ($port == "") {$port = 1;} + // Create Array with specific length + $network_device_portname = array(); + $network_device_portmac = array(); + $network_device_portip = array(); + $network_device_portstate = array(); + // make sql query for Network Hardware ID + global $db; + $func_sql = 'SELECT * FROM "Devices" WHERE "dev_Network_Node_MAC" = "'.$mac.'"'; + $func_result = $db->query($func_sql); + while($func_res = $func_result->fetchArray(SQLITE3_ASSOC)) { + // Online / Offline state of port + if ($func_res['dev_PresentLastScan'] == 1) { + $port_state = '
    Online
    '; + } else { + $port_state = '
    Offline
    '; + } + // Prepare Table with Port > push values in array + if ($port > 1) + { + if (stristr($func_res['dev_Network_Node_port'], ',') == '') { + if ($network_device_portname[$func_res['dev_Network_Node_port']] != '') { + $network_device_portname[$func_res['dev_Network_Node_port']] = $network_device_portname[$func_res['dev_Network_Node_port']].','.$func_res['dev_Name']; + } else { + $network_device_portname[$func_res['dev_Network_Node_port']] = $func_res['dev_Name']; + } + if ($network_device_portmac[$func_res['dev_Network_Node_port']] != '') { + $network_device_portmac[$func_res['dev_Network_Node_port']] = $network_device_portmac[$func_res['dev_Network_Node_port']].','.$func_res['dev_MAC']; + } else { + $network_device_portmac[$func_res['dev_Network_Node_port']] = $func_res['dev_MAC']; + } + if ($network_device_portip[$func_res['dev_Network_Node_port']] != '') { + $network_device_portip[$func_res['dev_Network_Node_port']] = $network_device_portip[$func_res['dev_Network_Node_port']].','.$func_res['dev_LastIP']; + } else { + $network_device_portip[$func_res['dev_Network_Node_port']] = $func_res['dev_LastIP']; + } + if (isset($network_device_portstate[$func_res['dev_Network_Node_port']])) { + $network_device_portstate[$func_res['dev_Network_Node_port']] = $network_device_portstate[$func_res['dev_Network_Node_port']].','.$func_res['dev_PresentLastScan']; + } else { + $network_device_portstate[$func_res['dev_Network_Node_port']] = $func_res['dev_PresentLastScan']; + } + } else { + $multiport = array(); + $multiport = explode(',',$func_res['dev_Network_Node_port']); + foreach($multiport as $row) { + $network_device_portname[trim($row)] = $func_res['dev_Name']; + $network_device_portmac[trim($row)] = $func_res['dev_MAC']; + $network_device_portip[trim($row)] = $func_res['dev_LastIP']; + $network_device_portstate[trim($row)] = $func_res['dev_PresentLastScan']; + } + unset($multiport); + } + } else { + // Table without Port > echo values + // Specific icon for devicetype + if ($type == "WLAN") {$dev_port_icon = 'fa-wifi';} + if ($type == "Powerline") {$dev_port_icon = 'fa-flash';} + echo ''; + } + } + // Create table with Port + if ($port > 1) + { + for ($x=1; $x<=$port; $x++) + { + // Prepare online/offline badge for later functions + $online_badge = '
    Online
    '; + $offline_badge = '
    Offline
    '; + // Set online/offline badge + echo ''; + echo ''; + // Set online/offline badge + // Check if multiple badges necessary + if (stristr($network_device_portstate[$x],',') == '') { + // Set single online/offline badge + if ($network_device_portstate[$x] == 1) {$port_state = $online_badge;} else {$port_state = $offline_badge;} + echo ''; + } else { + // Set multiple online/offline badges + $multistate = array(); + $multistate = explode(',',$network_device_portstate[$x]); + echo ''; + unset($multistate); + } + // Check if multiple Hostnames are set + // print single hostname + if (stristr($network_device_portmac[$x],',') == '') { + echo ''; + } else { + // print multiple hostnames with separate links + $multimac = array(); + $multimac = explode(',',$network_device_portmac[$x]); + $multiname = array(); + $multiname = explode(',',$network_device_portname[$x]); + echo ''; + unset($multiname, $multimac); + } + // Check if multiple IP are set + // print single IP + if (stristr($network_device_portip[$x],',') == '') { + echo ''; + } else { + // print multiple IPs + $multiip = array(); + $multiip = explode(',',$network_device_portip[$x]); + echo ''; + unset($multiip); + } + echo ''; + } + } + echo ' +
    Port'.$pia_lang['Network_Table_State'].''.$pia_lang['Network_Table_Hostname'].''.$pia_lang['Network_Table_IP'].'
    '.$port_state.''.$func_res['dev_Name'].''.$func_res['dev_LastIP'].'
    '.$x.''.$port_state.''; + foreach($multistate as $key => $value) { + if ($value == 1) {$port_state = $online_badge;} else {$port_state = $offline_badge;} + echo $port_state.'
    '; + } + echo '
    '.$network_device_portname[$x].''; + foreach($multiname as $key => $value) { + echo ''.$value.'
    '; + } + echo '
    '.$network_device_portip[$x].''; + foreach($multiip as $key => $value) { + echo $value.'
    '; + } + echo '
    +
    '; + echo '
    '; + } + + + // Create Tabs + + $sql = 'select dev_MAC, dev_Name, dev_DeviceType, dev_Network_Node_port from Devices where dev_DeviceType in ("AP", "Gateway", "Powerline", "Switch", "WLAN", "PLC", "Router","USB LAN Adapter", "USB WIFI Adapter")'; + $result = $db->query($sql); + + // array + $tableData = array(); + while ($row = $result -> fetchArray (SQLITE3_ASSOC)) { + // Push row data + $tableData[] = array('dev_MAC' => $row['dev_MAC'], + 'dev_Name' => $row['dev_Name'], + 'dev_DeviceType' => $row['dev_DeviceType'], + 'dev_Network_Node_port' => $row['dev_Network_Node_port'] ); + } + + // Control no rows + if (empty($tableData)) { + $tableData = []; + } + + ?> + +
    +
    @@ -371,4 +259,4 @@ unset($i); \ No newline at end of file +?> diff --git a/front/php/server/devices.php b/front/php/server/devices.php index c081c197..76bfa7ae 100644 --- a/front/php/server/devices.php +++ b/front/php/server/devices.php @@ -41,6 +41,7 @@ if (strlen($pia_lang_selected) == 0) {$pia_lang_selected = 'en_us';} switch ($action) { case 'getDeviceData': getDeviceData(); break; case 'setDeviceData': setDeviceData(); break; + case 'getNetworkNodes': getNetworkNodes(); break; case 'deleteDevice': deleteDevice(); break; case 'deleteAllWithEmptyMACs': deleteAllWithEmptyMACs(); break; case 'createBackupDB': createBackupDB(); break; @@ -94,8 +95,8 @@ function getDeviceData() { $deviceData = $row; $mac = $deviceData['dev_MAC']; - $deviceData['dev_Infrastructure'] = $row['dev_Infrastructure']; - $deviceData['dev_Infrastructure_port'] = $row['dev_Infrastructure_port']; + $deviceData['dev_Network_Node_MAC'] = $row['dev_Network_Node_MAC']; + $deviceData['dev_Network_Node_port'] = $row['dev_Network_Node_port']; $deviceData['dev_FirstConnection'] = formatDate ($row['dev_FirstConnection']); // Date formated $deviceData['dev_LastConnection'] = formatDate ($row['dev_LastConnection']); // Date formated @@ -165,8 +166,8 @@ function setDeviceData() { dev_Group = "'. quotes($_REQUEST['group']) .'", dev_Location = "'. quotes($_REQUEST['location']) .'", dev_Comments = "'. quotes($_REQUEST['comments']) .'", - dev_Infrastructure = "'. quotes($_REQUEST['infrastructure']).'", - dev_Infrastructure_port = "'. quotes($_REQUEST['infrastructureport']).'", + dev_Network_Node_MAC = "'. quotes($_REQUEST['networknode']).'", + dev_Network_Node_port = "'. quotes($_REQUEST['networknodeport']).'", dev_StaticIP = "'. quotes($_REQUEST['staticIP']) .'", dev_ScanCycle = "'. quotes($_REQUEST['scancycle']) .'", dev_AlertEvents = "'. quotes($_REQUEST['alertevents']) .'", @@ -599,12 +600,43 @@ function getOwners() { } +//------------------------------------------------------------------------------ +// Query Device Data +//------------------------------------------------------------------------------ +function getNetworkNodes() { + global $db; + + // Device Data + $sql = 'SELECT * FROM Devices WHERE dev_DeviceType in ( "AP", "Gateway", "Powerline", "Switch", "WLAN", "PLC", "Router","USB LAN Adapter", "USB WIFI Adapter")'; + + $result = $db->query($sql); + + // arrays of rows + $tableData = array(); + while ($row = $result -> fetchArray (SQLITE3_ASSOC)) { + // Push row data + $tableData[] = array('id' => $row['dev_MAC'], + 'name' => $row['dev_Name'] ); + } + + // Control no rows + if (empty($tableData)) { + $tableData = []; + } + + // Return json + echo (json_encode ($tableData)); +} + + //------------------------------------------------------------------------------ // Query the List of types //------------------------------------------------------------------------------ function getDeviceTypes() { global $db; + $networkTypes = getNetworkTypes(); + // SQL $sql = 'SELECT DISTINCT 9 as dev_Order, dev_DeviceType FROM Devices @@ -613,7 +645,7 @@ function getDeviceTypes() { "Laptop", "Mini PC", "PC", "Printer", "Server", "Singleboard Computer (SBC)", "Game Console", "SmartTV", "TV Decoder", "Virtual Assistance", "Clock", "House Appliance", "Phone", "Radio", - "AP", "NAS", "PLC", "Router") + "AP", "Gateway", "Powerline", "Switch", "WLAN", "PLC", "Router","USB LAN Adapter", "USB WIFI Adapter" ) UNION SELECT 1 as dev_Order, "Smartphone" UNION SELECT 1 as dev_Order, "Tablet" @@ -624,6 +656,7 @@ function getDeviceTypes() { UNION SELECT 2 as dev_Order, "Printer" UNION SELECT 2 as dev_Order, "Server" UNION SELECT 2 as dev_Order, "Singleboard Computer (SBC)" + UNION SELECT 2 as dev_Order, "NAS" UNION SELECT 3 as dev_Order, "Domotic" UNION SELECT 3 as dev_Order, "Game Console" @@ -636,8 +669,12 @@ function getDeviceTypes() { UNION SELECT 4 as dev_Order, "Phone" UNION SELECT 4 as dev_Order, "Radio" + -- network devices UNION SELECT 5 as dev_Order, "AP" - UNION SELECT 5 as dev_Order, "NAS" + UNION SELECT 5 as dev_Order, "Gateway" + UNION SELECT 5 as dev_Order, "Powerline" + UNION SELECT 5 as dev_Order, "Switch" + UNION SELECT 5 as dev_Order, "WLAN" UNION SELECT 5 as dev_Order, "PLC" UNION SELECT 5 as dev_Order, "Router" UNION SELECT 5 as dev_Order, "USB LAN Adapter" @@ -646,6 +683,8 @@ function getDeviceTypes() { UNION SELECT 10 as dev_Order, "Other" ORDER BY 1,2'; + + $result = $db->query($sql); // arrays of rows @@ -658,8 +697,6 @@ function getDeviceTypes() { // Return json echo (json_encode ($tableData)); } - - //------------------------------------------------------------------------------ // Query the List of groups //------------------------------------------------------------------------------ diff --git a/front/php/server/util.php b/front/php/server/util.php index 0869214d..c87da3ae 100644 --- a/front/php/server/util.php +++ b/front/php/server/util.php @@ -65,4 +65,12 @@ function logServerConsole ($text) { $y = $x['__________'. $text .'__________']; } +function getNetworkTypes(){ + + $array = array( + "AP", "Gateway", "Powerline", "Switch", "WLAN", "PLC", "Router","USB LAN Adapter", "USB WIFI Adapter" + ); + + return $array; +} ?> diff --git a/front/php/templates/language/en_us.php b/front/php/templates/language/en_us.php index 77e421f1..bca4bcb1 100644 --- a/front/php/templates/language/en_us.php +++ b/front/php/templates/language/en_us.php @@ -133,8 +133,8 @@ $pia_lang['DevDetail_MainInfo_Favorite'] = 'Favorite'; $pia_lang['DevDetail_MainInfo_Group'] = 'Group'; $pia_lang['DevDetail_MainInfo_Location'] = 'Location'; $pia_lang['DevDetail_MainInfo_Comments'] = 'Comments'; -$pia_lang['DevDetail_MainInfo_Network'] = 'Network Hardware (ID)'; -$pia_lang['DevDetail_MainInfo_Network_Port'] = 'Network HW Port'; +$pia_lang['DevDetail_MainInfo_Network'] = 'Network Node (MAC)'; +$pia_lang['DevDetail_MainInfo_Network_Port'] = 'Connected to Port'; $pia_lang['DevDetail_SessionInfo_Title'] = 'Session Info'; $pia_lang['DevDetail_SessionInfo_Status'] = 'Status'; $pia_lang['DevDetail_SessionInfo_FirstSession'] = 'First Session';