docs + #457 work

This commit is contained in:
Jokob-sk
2023-10-01 16:09:17 +11:00
parent c412f025ca
commit 2a0f464c63
6 changed files with 21 additions and 7 deletions

View File

@@ -767,10 +767,18 @@
// ---------------------------------------------------------------------------
function updateLeaf(leafMac,nodeMac)
{
console.log(leafMac)
console.log(nodeMac)
saveData('updateNetworkLeaf', leafMac, nodeMac);
setTimeout("location.reload();", 1000); // refresh page after 1s
console.log(leafMac) // child
console.log(nodeMac) // parent
// prevent the assignment of the Internet root node avoiding recursion when generating the network tree topology
if(leafMac.toLowerCase().includes('internet'))
{
showMessage(getString('Network_Cant_Assign'))
}
else{
saveData('updateNetworkLeaf', leafMac, nodeMac);
setTimeout("location.reload();", 500); // refresh page
}
}

View File

@@ -1006,8 +1006,8 @@ function getLocations() {
// ----------------------------------------------------------------------------------------
function updateNetworkLeaf()
{
$nodeMac = $_REQUEST['value'];
$leafMac = $_REQUEST['id'];
$nodeMac = $_REQUEST['value']; // parent
$leafMac = $_REQUEST['id']; // child
if ((false === filter_var($nodeMac , FILTER_VALIDATE_MAC) && $nodeMac != "Internet" && $nodeMac != "") || false === filter_var($leafMac , FILTER_VALIDATE_MAC) ) {
throw new Exception('Invalid mac address');

View File

@@ -408,6 +408,7 @@
"Network_Node" : "Network node",
"Network_Node_Name" : "Node name",
"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.",
"HelpFAQ_Title" : "Help / FAQ",
"HelpFAQ_Cat_General" : "General",