From fb53354518dfd306a3e440a86af4c65476c7cd0d Mon Sep 17 00:00:00 2001 From: Devdatt Bhatt Date: Mon, 8 Jun 2026 00:45:55 +0000 Subject: [PATCH] ui update --- html/network.php | 26 ++++++++++++-------------- html/style.css | 1 - 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/html/network.php b/html/network.php index e3d05bd..cd000c3 100755 --- a/html/network.php +++ b/html/network.php @@ -38,12 +38,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $network_config[$interface] = $config; file_put_contents($config_file, json_encode($network_config, JSON_PRETTY_PRINT)); - } elseif ($action === 'activate') { - // Activate interface - exec("sudo ip link set $interface up", $output, $return_code); - } elseif ($action === 'deactivate') { - // Deactivate interface - exec("sudo ip link set $interface down", $output, $return_code); + } elseif ($action === 'toggle') { + // Toggle interface state + $current_status = $interface_data[$interface]['status'] ?? 'down'; + if ($current_status === 'up') { + exec("sudo ip link set $interface down", $output, $return_code); + } else { + exec("sudo ip link set $interface up", $output, $return_code); + } } } } @@ -144,15 +146,11 @@ $selected_interface = $_GET['interface'] ?? array_keys($interface_data)[0] ?? nu

MAC Address: