Skip to content

Commit

Permalink
Network bug - selectable Internet parent #467
Browse files Browse the repository at this point in the history
  • Loading branch information
jokob-sk committed Oct 4, 2023
1 parent 1e0552c commit 2b057d3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
30 changes: 20 additions & 10 deletions front/deviceDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@
<div class="form-group" title="<?= lang('DevDetail_Network_Node_hover');?>">
<label class="col-sm-3 control-label"><?= lang('DevDetail_MainInfo_Network');?></label>
<div class="col-sm-9">
<div class="input-group">
<div class="input-group parentNetworkNode">

<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>
Expand Down Expand Up @@ -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']);
Expand Down Expand Up @@ -1398,8 +1398,6 @@ function performSwitch(direction)

getDeviceData (true);

// reload current tab
reloadTab()
}

// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -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();
}
}

</script>
1 change: 1 addition & 0 deletions front/php/templates/language/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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_Cat_General" : "General",
"HelpFAQ_Cat_Detail" : "Details",
Expand Down

0 comments on commit 2b057d3

Please sign in to comment.