Network bug - selectable Internet parent #467

This commit is contained in:
Jokob-sk
2023-10-05 07:15:00 +11:00
parent 1e0552cc13
commit 2b057d339c
2 changed files with 20 additions and 9 deletions

View File

@@ -325,7 +325,7 @@
<div class="form-group" title="<?= lang('DevDetail_Network_Node_hover');?>"> <div class="form-group" title="<?= lang('DevDetail_Network_Node_hover');?>">
<label class="col-sm-3 control-label"><?= lang('DevDetail_MainInfo_Network');?></label> <label class="col-sm-3 control-label"><?= lang('DevDetail_MainInfo_Network');?></label>
<div class="col-sm-9"> <div class="col-sm-9">
<div class="input-group"> <div class="input-group parentNetworkNode">
<input class="form-control" id="txtNetworkNodeMac" type="text" value="--"> <input class="form-control" id="txtNetworkNodeMac" type="text" value="--">
<span class="input-group-addon"><i title="<?= lang('DevDetail_GoToNetworkNode');?>" class="fa fa-square-up-right pointer" onclick="goToNetworkNode('txtNetworkNodeMac');"></i></span> <span class="input-group-addon"><i title="<?= lang('DevDetail_GoToNetworkNode');?>" class="fa fa-square-up-right pointer" onclick="goToNetworkNode('txtNetworkNodeMac');"></i></span>
@@ -1295,8 +1295,8 @@ function getDeviceData (readAllData=false) {
$('#txtNetworkNodeMac').attr ('data-mynodemac', deviceData['dev_Network_Node_MAC_ADDR']); $('#txtNetworkNodeMac').attr ('data-mynodemac', deviceData['dev_Network_Node_MAC_ADDR']);
$('#txtNetworkPort').val (deviceData['dev_Network_Node_port']); $('#txtNetworkPort').val (deviceData['dev_Network_Node_port']);
// disabling network node configuration if root Internet node // disabling network node configuration if root Internet node
$('#txtNetworkNodeMac').prop('readonly', mac == 'Internet' ); toggleNetworkConfiguration(mac == 'Internet')
$('#txtNetworkPort').prop('readonly', mac == 'Internet' );
$('#txtFirstConnection').val (deviceData['dev_FirstConnection']); $('#txtFirstConnection').val (deviceData['dev_FirstConnection']);
$('#txtLastConnection').val (deviceData['dev_LastConnection']); $('#txtLastConnection').val (deviceData['dev_LastConnection']);
@@ -1398,8 +1398,6 @@ function performSwitch(direction)
getDeviceData (true); getDeviceData (true);
// reload current tab
reloadTab()
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@@ -1796,15 +1794,27 @@ window.onload = function async()
{ {
initializeTabsNew(); initializeTabsNew();
reloadTab();
} }
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// Disables network configuration for the root node
function reloadTab() 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();
}
} }
</script> </script>

View File

@@ -410,6 +410,7 @@
"Network_Parent" : "Parent network device", "Network_Parent" : "Parent network device",
"Network_Cant_Assign" : "Can't assign the root Internet node as a child leaf node.", "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 <b><i class=\"fa fa-info-circle\"></i> Details</b> tab of any device in <a href=\"devices.php\"><b> <i class=\"fa fa-laptop\"></i> Devices</b></a>, and assign it to a network <b><i class=\"fa fa-server\"></i> Node (MAC)</b> and <b><i class=\"fa fa-ethernet\"></i> Port</b> there.", "Network_NoAssignedDevices" : "This network node does not have any assigned devices (leaf nodes). Assign one from bellow or go to the <b><i class=\"fa fa-info-circle\"></i> Details</b> tab of any device in <a href=\"devices.php\"><b> <i class=\"fa fa-laptop\"></i> Devices</b></a>, and assign it to a network <b><i class=\"fa fa-server\"></i> Node (MAC)</b> and <b><i class=\"fa fa-ethernet\"></i> Port</b> there.",
"Network_Root_Unconfigurable": "Unconfigurable root",
"HelpFAQ_Title" : "Help / FAQ", "HelpFAQ_Title" : "Help / FAQ",
"HelpFAQ_Cat_General" : "General", "HelpFAQ_Cat_General" : "General",
"HelpFAQ_Cat_Detail" : "Details", "HelpFAQ_Cat_Detail" : "Details",