diff --git a/html/input.php b/html/input.php index 83b3e99..e7c6def 100755 --- a/html/input.php +++ b/html/input.php @@ -430,69 +430,6 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") { } ?> -
diff --git a/html/network.php b/html/network.php index f6593a9..1d09b62 100755 --- a/html/network.php +++ b/html/network.php @@ -88,7 +88,7 @@ function generate_netplan_config($config) switch ($settings['method']) { case 'dhcp': $netplan_content .= " dhcp4: true\n"; - + // Add multicast route for DHCP interfaces if (($settings['multicast'] ?? 'off') === 'on') { $netplan_content .= " routes:\n"; @@ -102,7 +102,7 @@ function generate_netplan_config($config) if (!empty($ip) && strpos($ip, '/') === false) { $ip .= '/24'; } - + $netplan_content .= " addresses:\n"; $netplan_content .= " - $ip\n"; @@ -154,13 +154,15 @@ function generate_netplan_config($config) // Run netplan try to validate configuration exec('sudo cp /var/www/50-cloud-init.yaml /etc/netplan/50-cloud-init.yaml', $output, $return_code); exec("sudo netplan generate 2>&1", $out, $return_code); - + if ($return_code !== 0) { + error_log("This is my custom log message!"); if (file_exists($backup_file)) { exec('sudo cp /var/www/50-cloud-init.yaml_backup /etc/netplan/50-cloud-init.yaml', $output, $return_code); exec('sudo netplan apply', $output, $return_code); } - } + } else + exec('sudo netplan apply', $output, $return_code); } // Get network interfaces excluding specific ones diff --git a/html/style.css b/html/style.css index 3f7d1fb..18618c1 100644 --- a/html/style.css +++ b/html/style.css @@ -935,4 +935,63 @@ input:checked+.slider:before { vertical-align: middle; font-size: 0.9rem; color: var(--text-primary); +} + +#popup { + display: none; + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background: #fff; + padding: 20px; + border: 1px solid #333; + width: 350px; + max-width: 90vw; + max-height: 90vh; + overflow-y: auto; + z-index: 1000; + border-radius: 8px; + box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); +} + +#overlay { + display: none; + position: fixed; + inset: 0; + background: rgba(0, 0, 0, 0.5); + z-index: 999; +} + +/* Ensure the popup content is properly centered */ +#popup h3 { + margin-top: 0; + margin-bottom: 15px; + text-align: center; +} + +#popup input, +#popup select { + margin-bottom: 10px; + padding: 8px; + border: 1px solid #ccc; + border-radius: 4px; +} + +#popup button { + margin: 5px; + padding: 8px 12px; + border: none; + border-radius: 4px; + cursor: pointer; +} + +#popup button#saveBtn { + background: #0066cc; + color: white; +} + +#popup button[type="button"] { + background: #ccc; + color: black; } \ No newline at end of file