ui update
This commit is contained in:
parent
34fb393b55
commit
4471cc9dce
|
|
@ -159,7 +159,6 @@ $selected_interface = $_GET['interface'] ?? array_keys($interface_data)[0] ?? nu
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">Multicast</label>
|
<label class="form-label">Multicast</label>
|
||||||
|
|
||||||
<div class="form-check form-switch">
|
<div class="form-check form-switch">
|
||||||
<input
|
<input
|
||||||
class="form-check-input multicast-toggle"
|
class="form-check-input multicast-toggle"
|
||||||
|
|
@ -168,14 +167,12 @@ $selected_interface = $_GET['interface'] ?? array_keys($interface_data)[0] ?? nu
|
||||||
name="multicast"
|
name="multicast"
|
||||||
value="on"
|
value="on"
|
||||||
<?php echo (($interface_data[$selected_interface]['config']['multicast'] ?? 'off') === 'on') ? 'checked' : ''; ?>>
|
<?php echo (($interface_data[$selected_interface]['config']['multicast'] ?? 'off') === 'on') ? 'checked' : ''; ?>>
|
||||||
</div>
|
<label class="form-check-label" for="multicast-<?php echo $selected_interface; ?>">
|
||||||
|
|
||||||
<label
|
|
||||||
id="multicast-label-<?php echo $selected_interface; ?>"
|
|
||||||
for="multicast-<?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>
|
||||||
|
|
||||||
<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">
|
||||||
|
|
@ -271,34 +268,18 @@ $selected_interface = $_GET['interface'] ?? array_keys($interface_data)[0] ?? nu
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Multicast toggle switch functionality - simplified approach
|
// Multicast toggle switch functionality
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
|
||||||
document.querySelectorAll('.multicast-toggle').forEach(function(checkbox) {
|
document.querySelectorAll('.multicast-toggle').forEach(function(checkbox) {
|
||||||
|
checkbox.addEventListener('change', function() {
|
||||||
checkbox.addEventListener('click', function() {
|
|
||||||
|
|
||||||
const interfaceName = this.id.replace('multicast-', '');
|
const interfaceName = this.id.replace('multicast-', '');
|
||||||
|
const label = this.nextElementSibling; // Get the label element
|
||||||
const label = document.getElementById(
|
|
||||||
'multicast-label-' + interfaceName
|
|
||||||
);
|
|
||||||
|
|
||||||
if (label) {
|
if (label) {
|
||||||
label.textContent = this.checked ?
|
label.textContent = this.checked ? 'Enabled' : 'Disabled';
|
||||||
'Enabled' :
|
|
||||||
'Disabled';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(
|
|
||||||
'Multicast:',
|
|
||||||
interfaceName,
|
|
||||||
this.checked ? 'on' : 'off'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue