ui upadte

This commit is contained in:
Devdatt Bhatt 2026-06-08 00:14:45 +00:00
parent 038550bb45
commit 30a3525a08
1 changed files with 83 additions and 83 deletions

View File

@ -83,11 +83,9 @@ foreach ($output as $line) {
} }
// Check if interface is a bridge or docker interface // Check if interface is a bridge or docker interface
if ( if (strpos($current_interface, 'docker') === 0 ||
strpos($current_interface, 'docker') === 0 ||
strpos($current_interface, 'br-') === 0 || strpos($current_interface, 'br-') === 0 ||
strpos($current_interface, 'veth') === 0 strpos($current_interface, 'veth') === 0) {
) {
$current_interface = null; $current_interface = null;
continue; continue;
} }
@ -196,8 +194,7 @@ $general_config = $network_config['general'] ?? [
<div class="card-body"> <div class="card-body">
<!-- Interface Tabs --> <!-- Interface Tabs -->
<ul class="nav nav-tabs interface-tabs" id="interfaceTabs" role="tablist"> <ul class="nav nav-tabs interface-tabs" id="interfaceTabs" role="tablist">
<?php $first = true; <?php $first = true; foreach ($interface_data as $interface): ?>
foreach ($interface_data as $interface): ?>
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
<button class="nav-link <?php echo $first ? 'active' : ''; ?>" <button class="nav-link <?php echo $first ? 'active' : ''; ?>"
id="tab-<?php echo $interface['name']; ?>" id="tab-<?php echo $interface['name']; ?>"
@ -208,14 +205,12 @@ $general_config = $network_config['general'] ?? [
<?php echo htmlspecialchars($interface['name']); ?> <?php echo htmlspecialchars($interface['name']); ?>
</button> </button>
</li> </li>
<?php $first = false; <?php $first = false; endforeach; ?>
endforeach; ?>
</ul> </ul>
<!-- Interface Tab Content --> <!-- Interface Tab Content -->
<div class="tab-content interface-tab-content" id="interfaceTabContent"> <div class="tab-content interface-tab-content" id="interfaceTabContent">
<?php $first = true; <?php $first = true; foreach ($interface_data as $interface): ?>
foreach ($interface_data as $interface): ?>
<div class="tab-pane fade <?php echo $first ? 'show active' : ''; ?>" <div class="tab-pane fade <?php echo $first ? 'show active' : ''; ?>"
id="<?php echo $interface['name']; ?>" id="<?php echo $interface['name']; ?>"
role="tabpanel"> role="tabpanel">
@ -234,6 +229,7 @@ $general_config = $network_config['general'] ?? [
<form method="post" action=""> <form method="post" action="">
<input type="hidden" name="interface" value="<?php echo htmlspecialchars($interface['name']); ?>"> <input type="hidden" name="interface" value="<?php echo htmlspecialchars($interface['name']); ?>">
<input type="hidden" name="action" value="save"> <input type="hidden" name="action" value="save">
<div class="mb-3"> <div class="mb-3">
<label class="form-label">Configuration Method</label> <label class="form-label">Configuration Method</label>
<div class="form-check"> <div class="form-check">
@ -251,25 +247,30 @@ $general_config = $network_config['general'] ?? [
</label> </label>
</div> </div>
</div> </div>
<div class="mb-3" id="static-ip-fields-<?php echo $interface['name']; ?>" <div class="mb-3" id="static-ip-fields-<?php echo $interface['name']; ?>"
style="<?php echo ($interface['config']['method'] ?? '') === 'static' ? 'display: block;' : 'display: none;'; ?>"> style="<?php echo ($interface['config']['method'] ?? '') === 'static' ? 'display: block;' : 'display: none;'; ?>">
<label class="form-label">IP Address</label> <label class="form-label">IP Address</label>
<input type="text" class="form-control" name="ip" <input type="text" class="form-control" name="ip"
value="<?php echo htmlspecialchars($interface['config']['ip'] ?? ''); ?>" value="<?php echo htmlspecialchars($interface['config']['ip'] ?? ''); ?>"
placeholder="192.168.1.100"> placeholder="192.168.1.100">
<label class="form-label mt-2">Netmask</label> <label class="form-label mt-2">Netmask</label>
<input type="text" class="form-control" name="netmask" <input type="text" class="form-control" name="netmask"
value="<?php echo htmlspecialchars($interface['config']['netmask'] ?? ''); ?>" value="<?php echo htmlspecialchars($interface['config']['netmask'] ?? ''); ?>"
placeholder="255.255.255.0"> placeholder="255.255.255.0">
<label class="form-label mt-2">Gateway</label> <label class="form-label mt-2">Gateway</label>
<input type="text" class="form-control" name="gateway" <input type="text" class="form-control" name="gateway"
value="<?php echo htmlspecialchars($interface['config']['gateway'] ?? ''); ?>" value="<?php echo htmlspecialchars($interface['config']['gateway'] ?? ''); ?>"
placeholder="192.168.1.1"> placeholder="192.168.1.1">
<label class="form-label mt-2">DNS Server</label> <label class="form-label mt-2">DNS Server</label>
<input type="text" class="form-control" name="dns" <input type="text" class="form-control" name="dns"
value="<?php echo htmlspecialchars($interface['config']['dns'] ?? ''); ?>" value="<?php echo htmlspecialchars($interface['config']['dns'] ?? ''); ?>"
placeholder="8.8.8.8"> placeholder="8.8.8.8">
</div> </div>
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<button type="submit" class="btn btn-primary">Save Configuration</button> <button type="submit" class="btn btn-primary">Save Configuration</button>
<div> <div>
@ -288,8 +289,7 @@ $general_config = $network_config['general'] ?? [
</div> </div>
</div> </div>
</div> </div>
<?php $first = false; <?php $first = false; endforeach; ?>
endforeach; ?>
</div> </div>
</div> </div>
</div> </div>
@ -299,8 +299,8 @@ $general_config = $network_config['general'] ?? [
</div> </div>
<script> <script>
// Toggle static IP fields based on method selection // Toggle static IP fields based on method selection
document.querySelectorAll('input[name^="method"]').forEach(radio => { document.querySelectorAll('input[name^="method"]').forEach(radio => {
radio.addEventListener('change', function() { radio.addEventListener('change', function() {
const interfaceName = this.name.replace('method', ''); const interfaceName = this.name.replace('method', '');
const staticFields = document.getElementById(`static-ip-fields-${interfaceName}`); const staticFields = document.getElementById(`static-ip-fields-${interfaceName}`);
@ -311,7 +311,7 @@ $general_config = $network_config['general'] ?? [
staticFields.style.display = 'none'; staticFields.style.display = 'none';
} }
}); });
}); });
</script> </script>
<?php include 'footer.php' ?> <?php include 'footer.php' ?>