From 30a3525a08afd46ed1e021febea57836fbd69539 Mon Sep 17 00:00:00 2001 From: Devdatt Bhatt Date: Mon, 8 Jun 2026 00:14:45 +0000 Subject: [PATCH] ui upadte --- html/network.php | 166 +++++++++++++++++++++++------------------------ 1 file changed, 83 insertions(+), 83 deletions(-) diff --git a/html/network.php b/html/network.php index aa2a445..6b845f2 100755 --- a/html/network.php +++ b/html/network.php @@ -23,7 +23,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (isset($_POST['action'])) { $interface = $_POST['interface'] ?? ''; $action = $_POST['action']; - + if ($action === 'save') { // Save configuration $config = [ @@ -34,7 +34,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { 'gateway' => $_POST['gateway'] ?? '', 'dns' => $_POST['dns'] ?? '' ]; - + $network_config[$interface] = $config; file_put_contents($config_file, json_encode($network_config, JSON_PRETTY_PRINT)); } elseif ($action === 'activate') { @@ -51,7 +51,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { 'ntp_servers' => $_POST['ntp_servers'] ?? '', 'proxy' => $_POST['proxy'] ?? '' ]; - + $network_config['general'] = $general_config; file_put_contents($config_file, json_encode($network_config, JSON_PRETTY_PRINT)); } @@ -70,28 +70,26 @@ foreach ($output as $line) { // Match interface name if (preg_match('/^\d+:\s+([a-zA-Z0-9]+):/', $line, $matches)) { $current_interface = $matches[1]; - + // Skip interfaces we want to exclude if (strpos($current_interface, 'enx') === 0) { $current_interface = null; continue; } - + if ($current_interface === 'lo') { $current_interface = null; continue; } - + // Check if interface is a bridge or docker interface - if ( - strpos($current_interface, 'docker') === 0 || + if (strpos($current_interface, 'docker') === 0 || strpos($current_interface, 'br-') === 0 || - strpos($current_interface, 'veth') === 0 - ) { + strpos($current_interface, 'veth') === 0) { $current_interface = null; continue; } - + $interface_data[$current_interface] = [ 'name' => $current_interface, 'ip' => '', @@ -100,17 +98,17 @@ foreach ($output as $line) { 'config' => $network_config[$current_interface] ?? null ]; } - + // Extract IP address if ($current_interface && preg_match('/inet\s+(\d+\.\d+\.\d+\.\d+)/', $line, $matches)) { $interface_data[$current_interface]['ip'] = $matches[1]; } - + // Extract MAC address if ($current_interface && preg_match('/link\/ether\s+([a-f0-9:]+)/', $line, $matches)) { $interface_data[$current_interface]['mac'] = $matches[1]; } - + // Check if interface is up if ($current_interface && strpos($line, 'state UP') !== false) { $interface_data[$current_interface]['status'] = 'up'; @@ -128,7 +126,7 @@ $general_config = $network_config['general'] ?? [

Network Configuration

- +
@@ -144,7 +142,7 @@ $general_config = $network_config['general'] ?? [ - +
@@ -156,37 +154,37 @@ $general_config = $network_config['general'] ?? [
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
@@ -196,35 +194,32 @@ $general_config = $network_config['general'] ?? [
- +
- -
+ +

IP Address:

MAC Address:

-

Status: +

Status: @@ -234,51 +229,57 @@ $general_config = $network_config['general'] ?? [

+
- > + >
- > + >
-
+ +
- + + - + + - + + - +
+
- -
@@ -288,8 +289,7 @@ $general_config = $network_config['general'] ?? [
- +
@@ -299,19 +299,19 @@ $general_config = $network_config['general'] ?? [
\ No newline at end of file