ui upadte
This commit is contained in:
parent
69c1c6f2bd
commit
283d663306
|
|
@ -163,13 +163,20 @@ $selected_interface = $_GET['interface'] ?? array_keys($interface_data)[0] ?? nu
|
||||||
name="multicast" value="on" <?php echo ($interface_data[$selected_interface]['config']['multicast'] ?? 'off') === 'on' ? 'checked' : ''; ?>>
|
name="multicast" value="on" <?php echo ($interface_data[$selected_interface]['config']['multicast'] ?? 'off') === 'on' ? 'checked' : ''; ?>>
|
||||||
<span class="slider"></span>
|
<span class="slider"></span>
|
||||||
</div>
|
</div>
|
||||||
<label for="multicast-<?php echo $selected_interface; ?>" class="switch-label">
|
<label for="multicast-<?php echo $selected_interface; ?>" class="switch-label" id="multicast-label-<?php echo $selected_interface; ?>">
|
||||||
<?php echo ($interface_data[$selected_interface]['config']['multicast'] ?? 'off') === 'on' ? 'Enabled' : 'Disabled'; ?>
|
<?php echo ($interface_data[$selected_interface]['config']['multicast'] ?? 'off') === 'on' ? 'Enabled' : 'Disabled'; ?>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<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">
|
||||||
|
<input class="form-check-input" type="radio" name="method" id="disable-<?php echo $selected_interface; ?>"
|
||||||
|
value="disable" <?php echo ($interface_data[$selected_interface]['config']['method'] ?? '') === 'disable' ? 'checked' : ''; ?>>
|
||||||
|
<label class="form-check-label" for="disable-<?php echo $selected_interface; ?>">
|
||||||
|
Disable
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="method" id="dhcp-<?php echo $selected_interface; ?>"
|
<input class="form-check-input" type="radio" name="method" id="dhcp-<?php echo $selected_interface; ?>"
|
||||||
value="dhcp" <?php echo ($interface_data[$selected_interface]['config']['method'] ?? '') === 'dhcp' ? 'checked' : ''; ?>>
|
value="dhcp" <?php echo ($interface_data[$selected_interface]['config']['method'] ?? '') === 'dhcp' ? 'checked' : ''; ?>>
|
||||||
|
|
@ -184,13 +191,6 @@ $selected_interface = $_GET['interface'] ?? array_keys($interface_data)[0] ?? nu
|
||||||
Static IP
|
Static IP
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
|
||||||
<input class="form-check-input" type="radio" name="method" id="disable-<?php echo $selected_interface; ?>"
|
|
||||||
value="disable" <?php echo ($interface_data[$selected_interface]['config']['method'] ?? '') === 'disable' ? 'checked' : ''; ?>>
|
|
||||||
<label class="form-check-label" for="disable-<?php echo $selected_interface; ?>">
|
|
||||||
Disable
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3" id="static-ip-fields-<?php echo $selected_interface; ?>"
|
<div class="mb-3" id="static-ip-fields-<?php echo $selected_interface; ?>"
|
||||||
|
|
@ -262,6 +262,20 @@ $selected_interface = $_GET['interface'] ?? array_keys($interface_data)[0] ?? nu
|
||||||
window.location.href = '?interface=' + encodeURIComponent(interfaceName);
|
window.location.href = '?interface=' + encodeURIComponent(interfaceName);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Multicast toggle switch functionality
|
||||||
|
document.querySelectorAll('.switch input[type="checkbox"]').forEach(checkbox => {
|
||||||
|
checkbox.addEventListener('change', function() {
|
||||||
|
const interfaceName = this.id.split('-')[2]; // Get interface name from ID like "multicast-eth0"
|
||||||
|
const label = document.getElementById(`multicast-label-${interfaceName}`);
|
||||||
|
|
||||||
|
if (this.checked) {
|
||||||
|
label.textContent = 'Enabled';
|
||||||
|
} else {
|
||||||
|
label.textContent = 'Disabled';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php include 'footer.php' ?>
|
<?php include 'footer.php' ?>
|
||||||
Loading…
Reference in New Issue