From a1349f83139d4890412d3f5fcab015a9084c3c91 Mon Sep 17 00:00:00 2001 From: leiweibau <105860611+leiweibau@users.noreply.github.com> Date: Wed, 27 Jul 2022 00:58:06 +0200 Subject: [PATCH] add port number --- front/deviceDetails.php | 59 +++++++++++++++++++++--------------- front/network.php | 30 +++++++++--------- front/php/server/devices.php | 2 ++ 3 files changed, 51 insertions(+), 40 deletions(-) diff --git a/front/deviceDetails.php b/front/deviceDetails.php index 9ee4b1a2..8b36dee8 100644 --- a/front/deviceDetails.php +++ b/front/deviceDetails.php @@ -265,11 +265,17 @@ if ($_REQUEST['mac'] == 'Internet') { $DevDetail_Tap_temp = "Tools"; } else { $D
- +
+
+ +
+ +
+
@@ -1099,34 +1105,35 @@ function getDeviceData (readAllData=false) { $('#deviceStatus')[0].className = 'text-gray'; $('#deviceStatusIcon')[0].className = ''; - $('#deviceSessions').html ('--'); - $('#deviceDownAlerts').html ('--'); - $('#deviceEvents').html ('--'); + $('#deviceSessions').html ('--'); + $('#deviceDownAlerts').html ('--'); + $('#deviceEvents').html ('--'); - $('#txtMAC').val ('--'); - $('#txtName').val ('--'); - $('#txtOwner').val ('--'); - $('#txtDeviceType').val ('--'); - $('#txtVendor').val ('--'); + $('#txtMAC').val ('--'); + $('#txtName').val ('--'); + $('#txtOwner').val ('--'); + $('#txtDeviceType').val ('--'); + $('#txtVendor').val ('--'); - $('#chkFavorite').iCheck ('uncheck'); - $('#txtGroup').val ('--'); - $('#txtLocation').val ('--'); - $('#txtComments').val ('--'); - $('#txtInfrastructure').val ('--'); + $('#chkFavorite').iCheck ('uncheck'); + $('#txtGroup').val ('--'); + $('#txtLocation').val ('--'); + $('#txtComments').val ('--'); + $('#txtInfrastructure').val ('--'); + $('#txtInfrastructurePort').val ('--'); - $('#txtFirstConnection').val ('--'); - $('#txtLastConnection').val ('--'); - $('#txtLastIP').val ('--'); - $('#txtStatus').val ('--'); - $('#chkStaticIP').iCheck ('uncheck'); + $('#txtFirstConnection').val ('--'); + $('#txtLastConnection').val ('--'); + $('#txtLastIP').val ('--'); + $('#txtStatus').val ('--'); + $('#chkStaticIP').iCheck ('uncheck'); - $('#txtScanCycle').val ('--'); - $('#chkAlertEvents').iCheck ('uncheck') - $('#chkAlertDown').iCheck ('uncheck') - $('#txtSkipRepeated').val ('--'); - $('#chkNewDevice').iCheck ('uncheck'); - $('#chkArchived').iCheck ('uncheck'); + $('#txtScanCycle').val ('--'); + $('#chkAlertEvents').iCheck ('uncheck') + $('#chkAlertDown').iCheck ('uncheck') + $('#txtSkipRepeated').val ('--'); + $('#chkNewDevice').iCheck ('uncheck'); + $('#chkArchived').iCheck ('uncheck'); $('#iconRandomMACactive').addClass ('hidden'); $('#iconRandomMACinactive').removeClass ('hidden'); @@ -1195,6 +1202,7 @@ function getDeviceData (readAllData=false) { $('#txtLocation').val (deviceData['dev_Location']); $('#txtComments').val (deviceData['dev_Comments']); $('#txtInfrastructure').val (deviceData['dev_Infrastructure']); + $('#txtInfrastructurePort').val (deviceData['dev_Infrastructure_port']); $('#txtFirstConnection').val (deviceData['dev_FirstConnection']); $('#txtLastConnection').val (deviceData['dev_LastConnection']); @@ -1304,6 +1312,7 @@ function setDeviceData (refreshCallback='') { + '&location=' + $('#txtLocation').val() + '&comments=' + $('#txtComments').val() + '&infrastructure=' + $('#txtInfrastructure').val() + + '&infrastructureport=' + $('#txtInfrastructurePort').val() + '&staticIP=' + ($('#chkStaticIP')[0].checked * 1) + '&scancycle=' + $('#txtScanCycle').val().split(' ')[0] + '&alertevents=' + ($('#chkAlertEvents')[0].checked * 1) diff --git a/front/network.php b/front/network.php index f433a409..e53692f2 100644 --- a/front/network.php +++ b/front/network.php @@ -9,10 +9,11 @@ if ($_SESSION["login"] != 1) require 'php/templates/header.php'; require 'php/server/db.php'; - $DBFILE = '../db/pialert.db'; OpenDB(); -// Create Table if not exists' +// ##################################### +// ## Create Table if not exists' +// ##################################### $sql = 'CREATE TABLE IF NOT EXISTS "network_infrastructure" ( "device_id" INTEGER, "net_device_name" TEXT NOT NULL, @@ -20,13 +21,16 @@ $sql = 'CREATE TABLE IF NOT EXISTS "network_infrastructure" ( PRIMARY KEY("device_id" AUTOINCREMENT) )'; $result = $db->query($sql); -// Expand Devices Table +// ##################################### +// ## Expand Devices Table +// ##################################### $sql = 'ALTER TABLE "Devices" ADD "dev_Infrastructure" INTEGER'; $result = $db->query($sql); $sql = 'ALTER TABLE "Devices" ADD "dev_Infrastructure_port" INTEGER'; $result = $db->query($sql); - - +// ##################################### +// Add New Network Devices +// ##################################### if ($_REQUEST['Networkinsert'] == "yes") { if (isset($_REQUEST['NetworkDeviceName']) && isset($_REQUEST['NetworkDeviceTyp'])) { @@ -34,7 +38,9 @@ if ($_REQUEST['Networkinsert'] == "yes") { $result = $db->query($sql); } } - +// ##################################### +// remove Network Devices +// ##################################### if ($_REQUEST['Networkdelete'] == "yes") { if (isset($_REQUEST['NetworkDeviceID'])) { @@ -63,10 +69,8 @@ echo $_REQUEST['device_id'];

Verwalte Netzwerk-Geräte

-
-
@@ -102,7 +106,6 @@ echo $_REQUEST['device_id'];