ui updtae
This commit is contained in:
parent
ba0d2ab332
commit
6fa14d2f6e
|
|
@ -32,7 +32,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
'ip' => $_POST['ip'] ?? '',
|
'ip' => $_POST['ip'] ?? '',
|
||||||
'netmask' => $_POST['netmask'] ?? '',
|
'netmask' => $_POST['netmask'] ?? '',
|
||||||
'gateway' => $_POST['gateway'] ?? '',
|
'gateway' => $_POST['gateway'] ?? '',
|
||||||
'dns' => $_POST['dns'] ?? ''
|
'dns' => $_POST['dns'] ?? '',
|
||||||
|
'multicast' => $_POST['multicast'] ?? 'off'
|
||||||
];
|
];
|
||||||
|
|
||||||
$network_config[$interface] = $config;
|
$network_config[$interface] = $config;
|
||||||
|
|
@ -72,9 +73,11 @@ foreach ($output as $line) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if interface is a bridge or docker interface
|
// 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, 'br-') === 0 ||
|
||||||
strpos($current_interface, 'veth') === 0) {
|
strpos($current_interface, 'veth') === 0
|
||||||
|
) {
|
||||||
$current_interface = null;
|
$current_interface = null;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -108,8 +111,10 @@ foreach ($output as $line) {
|
||||||
$selected_interface = $_GET['interface'] ?? array_keys($interface_data)[0] ?? null;
|
$selected_interface = $_GET['interface'] ?? array_keys($interface_data)[0] ?? null;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="container">
|
<div class="containerindex">
|
||||||
<h2>Network Configuration</h2>
|
<div class="grid">
|
||||||
|
<div class="card wide">
|
||||||
|
<h3>Network Configuration</h3>
|
||||||
|
|
||||||
<!-- Interface selection -->
|
<!-- Interface selection -->
|
||||||
<div class="interface-selector">
|
<div class="interface-selector">
|
||||||
|
|
@ -129,7 +134,7 @@ $selected_interface = $_GET['interface'] ?? array_keys($interface_data)[0] ?? nu
|
||||||
<?php if ($selected_interface && isset($interface_data[$selected_interface])): ?>
|
<?php if ($selected_interface && isset($interface_data[$selected_interface])): ?>
|
||||||
<div class="interface-card">
|
<div class="interface-card">
|
||||||
<div class="interface-header">
|
<div class="interface-header">
|
||||||
<h5><?php echo htmlspecialchars($interface_data[$selected_interface]['name']); ?></h5>
|
<h5>Interface Settings</h5>
|
||||||
<span class="badge bg-<?php echo $interface_data[$selected_interface]['status'] === 'up' ? 'success' : 'secondary'; ?>">
|
<span class="badge bg-<?php echo $interface_data[$selected_interface]['status'] === 'up' ? 'success' : 'secondary'; ?>">
|
||||||
<?php echo htmlspecialchars($interface_data[$selected_interface]['status']); ?>
|
<?php echo htmlspecialchars($interface_data[$selected_interface]['status']); ?>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -184,6 +189,24 @@ $selected_interface = $_GET['interface'] ?? array_keys($interface_data)[0] ?? nu
|
||||||
placeholder="8.8.8.8">
|
placeholder="8.8.8.8">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Multicast</label>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="radio" name="multicast" id="multicast-on-<?php echo $selected_interface; ?>"
|
||||||
|
value="on" <?php echo ($interface_data[$selected_interface]['config']['multicast'] ?? 'off') === 'on' ? 'checked' : ''; ?>>
|
||||||
|
<label class="form-check-label" for="multicast-on-<?php echo $selected_interface; ?>">
|
||||||
|
Enable
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="radio" name="multicast" id="multicast-off-<?php echo $selected_interface; ?>"
|
||||||
|
value="off" <?php echo ($interface_data[$selected_interface]['config']['multicast'] ?? 'off') === 'off' ? 'checked' : ''; ?>>
|
||||||
|
<label class="form-check-label" for="multicast-off-<?php echo $selected_interface; ?>">
|
||||||
|
Disable
|
||||||
|
</label>
|
||||||
|
</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>
|
||||||
|
|
@ -206,11 +229,13 @@ $selected_interface = $_GET['interface'] ?? array_keys($interface_data)[0] ?? nu
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</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}`);
|
||||||
|
|
@ -221,7 +246,7 @@ document.querySelectorAll('input[name^="method"]').forEach(radio => {
|
||||||
staticFields.style.display = 'none';
|
staticFields.style.display = 'none';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php include 'footer.php' ?>
|
<?php include 'footer.php' ?>
|
||||||
Loading…
Reference in New Issue