From 2b057d339c205979b27fbcd0aebb052f7cfbe5e8 Mon Sep 17 00:00:00 2001 From: Jokob-sk Date: Thu, 5 Oct 2023 07:15:00 +1100 Subject: [PATCH] Network bug - selectable Internet parent #467 --- front/deviceDetails.php | 30 ++++++++++++++++--------- front/php/templates/language/en_us.json | 1 + 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/front/deviceDetails.php b/front/deviceDetails.php index b3cf5aa28..d32a1f5c6 100755 --- a/front/deviceDetails.php +++ b/front/deviceDetails.php @@ -325,7 +325,7 @@
-
+
@@ -1295,8 +1295,8 @@ function getDeviceData (readAllData=false) { $('#txtNetworkNodeMac').attr ('data-mynodemac', deviceData['dev_Network_Node_MAC_ADDR']); $('#txtNetworkPort').val (deviceData['dev_Network_Node_port']); // disabling network node configuration if root Internet node - $('#txtNetworkNodeMac').prop('readonly', mac == 'Internet' ); - $('#txtNetworkPort').prop('readonly', mac == 'Internet' ); + toggleNetworkConfiguration(mac == 'Internet') + $('#txtFirstConnection').val (deviceData['dev_FirstConnection']); $('#txtLastConnection').val (deviceData['dev_LastConnection']); @@ -1398,8 +1398,6 @@ function performSwitch(direction) getDeviceData (true); - // reload current tab - reloadTab() } // ----------------------------------------------------------------------------- @@ -1796,15 +1794,27 @@ function initTable(tableId, mac){ { initializeTabsNew(); - reloadTab(); + } //----------------------------------------------------------------------------------- - -function reloadTab() +// Disables network configuration for the root node +function toggleNetworkConfiguration(disable) { - // tab loaded without switching - + $('#txtNetworkNodeMac').prop('readonly', true ); // disable direct input as should only be selected via the dropdown + + if(disable) + { + $('#txtNetworkNodeMac').val(getString('Network_Root_Unconfigurable')); + $('#txtNetworkPort').val(getString('Network_Root_Unconfigurable')); + $('#txtNetworkPort').prop('readonly', true ); + $('.parentNetworkNode .input-group-btn').hide(); + } + else + { + $('#txtNetworkPort').prop('readonly', false ); + $('.parentNetworkNode .input-group-btn').show(); + } } diff --git a/front/php/templates/language/en_us.json b/front/php/templates/language/en_us.json index a3eaa7535..2faee1ae8 100755 --- a/front/php/templates/language/en_us.json +++ b/front/php/templates/language/en_us.json @@ -410,6 +410,7 @@ "Network_Parent" : "Parent network device", "Network_Cant_Assign" : "Can't assign the root Internet node as a child leaf node.", "Network_NoAssignedDevices" : "This network node does not have any assigned devices (leaf nodes). Assign one from bellow or go to the Details tab of any device in Devices, and assign it to a network Node (MAC) and Port there.", + "Network_Root_Unconfigurable": "Unconfigurable root", "HelpFAQ_Title" : "Help / FAQ", "HelpFAQ_Cat_General" : "General", "HelpFAQ_Cat_Detail" : "Details",