ui update

This commit is contained in:
devdatt 2026-06-12 14:58:02 +00:00
parent 178a0463d0
commit a3b85d4e9d
3 changed files with 65 additions and 67 deletions

View File

@ -430,69 +430,6 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
}
?>
<style>
body {
font-family: Arial;
padding: 20px;
}
button {
padding: 6px 12px;
cursor: pointer;
}
.restart-btn {
background: #ffaa00;
}
.delete-btn {
background: #b40000;
color: white;
}
.edit-btn {
background: #0066cc;
color: white;
}
#popup {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #fff;
padding: 20px;
border: 1px solid #333;
width: 350px;
}
#overlay {
display: none;
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.5);
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
th,
td {
border: 1px solid #ccc;
padding: 10px;
}
input,
select {
width: 100%;
padding: 6px;
margin-bottom: 10px;
}
</style>
<div class="containerindex">
<div class="grid">

View File

@ -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

View File

@ -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;
}