mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Network page improvements
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
case 'getPholus': getPholus(); break;
|
||||
case 'getNmap': getNmap(); break;
|
||||
case 'saveNmapPort': saveNmapPort(); break;
|
||||
case 'updateNetworkLeaf': updateNetworkLeaf(); break;
|
||||
|
||||
default: logServerConsole ('Action: '. $action); break;
|
||||
}
|
||||
@@ -969,7 +970,7 @@ function getNmap() {
|
||||
function saveNmapPort()
|
||||
{
|
||||
|
||||
$portIndex = $_REQUEST['index'];
|
||||
$portIndex = $_REQUEST['id'];
|
||||
$value = $_REQUEST['value'];
|
||||
|
||||
if(is_integer((int)$portIndex))
|
||||
@@ -987,9 +988,35 @@ function saveNmapPort()
|
||||
echo 'KO';
|
||||
}
|
||||
}
|
||||
// echo "asdasdasasd";
|
||||
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
function updateNetworkLeaf()
|
||||
{
|
||||
$nodeMac = $_REQUEST['value'];
|
||||
$leafMac = $_REQUEST['id'];
|
||||
|
||||
if ((false === filter_var($nodeMac , FILTER_VALIDATE_MAC) && $nodeMac != "Internet" && $nodeMac != "") || false === filter_var($leafMac , FILTER_VALIDATE_MAC) ) {
|
||||
throw new Exception('Invalid mac address');
|
||||
}
|
||||
else
|
||||
{
|
||||
global $db;
|
||||
// sql
|
||||
$sql = 'UPDATE Devices SET "dev_Network_Node_MAC_ADDR" = "'. $nodeMac .'" WHERE "dev_MAC"="' . $leafMac.'"' ;
|
||||
// update Data
|
||||
$result = $db->query($sql);
|
||||
|
||||
// check result
|
||||
if ($result == TRUE) {
|
||||
echo 'OK';
|
||||
} else {
|
||||
echo 'KO';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Status Where conditions
|
||||
|
||||
@@ -205,6 +205,8 @@ function cleanLog($logFile)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
function saveSettings()
|
||||
{
|
||||
|
||||
@@ -222,7 +222,7 @@ if ($ENABLED_DARKMODE === True) {
|
||||
</li>
|
||||
|
||||
<li class=" <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('network.php') ) ){ echo 'active'; } ?>">
|
||||
<a href="network.php"><i class="fa fa-server"></i> <span><?php echo lang('Navigation_Network');?></span></a>
|
||||
<a href="network.php"><i class="fa fa-network-wired"></i> <span><?php echo lang('Navigation_Network');?></span></a>
|
||||
</li>
|
||||
|
||||
<li class=" <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('maintenance.php') ) ){ echo 'active'; } ?>">
|
||||
|
||||
@@ -170,9 +170,9 @@ $lang['en_us'] = array(
|
||||
'DevDetail_MainInfo_Group' => 'Group',
|
||||
'DevDetail_MainInfo_Location' => 'Location',
|
||||
'DevDetail_MainInfo_Comments' => 'Comments',
|
||||
'DevDetail_MainInfo_Network_Title' => 'Network',
|
||||
'DevDetail_MainInfo_Network' => 'Network Node (MAC)',
|
||||
'DevDetail_MainInfo_Network_Port' => 'Connected to Port',
|
||||
'DevDetail_MainInfo_Network_Title' => '<i class="fa fa-network-wired"></i> Network',
|
||||
'DevDetail_MainInfo_Network' => '<i class="fa fa-server"></i> Node (MAC)',
|
||||
'DevDetail_MainInfo_Network_Port' => '<i class="fa fa-ethernet"></i> Port',
|
||||
'DevDetail_SessionInfo_Title' => 'Session Info',
|
||||
'DevDetail_SessionInfo_Status' => 'Status',
|
||||
'DevDetail_SessionInfo_FirstSession' => 'First Session',
|
||||
@@ -339,6 +339,8 @@ $lang['en_us'] = array(
|
||||
'Network_Title' => 'Network overview',
|
||||
'Network_ManageDevices' => 'Manage Devices',
|
||||
'Network_ManageAdd' => 'Add Device',
|
||||
'Network_ManageAssign' => 'Assign Device',
|
||||
'Network_ManageUnassign' => 'Unassign',
|
||||
'Network_ManageEdit' => 'Update Device',
|
||||
'Network_ManageDel' => 'Delete Device',
|
||||
'Network_ManageAdd_Name' => 'Device Name',
|
||||
@@ -364,6 +366,13 @@ $lang['en_us'] = array(
|
||||
'Network_Table_Hostname' => 'Hostname',
|
||||
'Network_Table_IP' => 'IP',
|
||||
'Network_UnassignedDevices' => 'Unassigned devices',
|
||||
'Network_Assign' => 'Connect to the above <i class="fa fa-server"></i> Network node',
|
||||
'Network_Connected' => 'Connected devices',
|
||||
'Network_ManageLeaf' => 'Manage assignment',
|
||||
'Network_Node' => 'Network node',
|
||||
'Network_Node_Name' => 'Node name',
|
||||
'Network_Parent' => 'Parent network device',
|
||||
'Network_NoAssignedDevices' => 'This network node doesn\'t have any assigned devices (leaf nodes). Assign one from bellow or go to the <b>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.',
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// Help Page
|
||||
|
||||
Reference in New Issue
Block a user