PiXelTubes/server/templates/index.html

104 lines
4.1 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PiXelTube Web Interface</title>
<link rel="stylesheet" href="{{ url_for('static', filename='bootstrap/css/bootstrap.min.css')}}">
</head>
<body>
<div class="container mt-5">
<h1 class="mb-4">PiXelTube Web Interface</h1>
<!-- Tube List Table -->
<table class="table">
<thead>
<tr>
<th scope="col">Tube ID</th>
<th scope="col">Universe</th>
<th scope="col">DMX Address</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody id="tubeList">
<!-- Tube information will be dynamically added here -->
</tbody>
</table>
<!-- Tube Settings Modal -->
<div class="modal fade" id="tubeSettingsModal" tabindex="-1" role="dialog" aria-labelledby="tubeSettingsModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="tubeSettingsModalLabel">Tube Settings</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form id="tubeSettingsForm">
<div class="form-group">
<label for="universeInput">Universe:</label>
<input type="number" class="form-control" id="universeInput" required>
</div>
<div class="form-group">
<label for="dmxAddressInput">DMX Address:</label>
<input type="number" class="form-control" id="dmxAddressInput" required>
</div>
<button type="submit" class="btn btn-primary">Save Changes</button>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Include Bootstrap JS and jQuery (assuming you've downloaded them locally) -->
<script src="{{ url_for('static', filename='jquery.min.js')}}"></script>
<script src="{{ url_for('static', filename='bootstrap/js/bootstrap.bundle.min.js')}}"></script>
<script>
// Function to handle tube toggle switch changes
function handleTubeToggle(tubeId) {
// Replace this with your actual logic to handle the toggle switch change
console.log(`Tube ${tubeId} toggle switched`);
}
// Function to handle master toggle switch change
function handleMasterToggle() {
// Replace this with your actual logic to handle the master toggle switch change
console.log('Master toggle switched');
}
// Function to handle settings modal open
function openSettingsModal(tubeId) {
// Replace this with your actual logic to open the settings modal for the specified tube
console.log(`Opening settings modal for Tube ${tubeId}`);
}
// Assign event listeners to the toggle switches
document.addEventListener('DOMContentLoaded', function () {
// Replace 'toggleTube1', 'toggleTube2', etc., with the actual IDs of your toggle switches
document.getElementById('toggleTube1').addEventListener('change', function () {
handleTubeToggle(1);
});
// Add more event listeners for additional toggle switches
// Assign event listener for the master toggle switch
document.getElementById('masterToggle').addEventListener('change', handleMasterToggle);
// Assign event listeners for settings buttons to open respective modals
// Replace 'settingsModalTube1', 'settingsModalTube2', etc., with the actual IDs of your modal buttons
document.getElementById('settingsModalTube1').addEventListener('click', function () {
openSettingsModal(1);
});
// Add more event listeners for additional settings buttons
});
</script>
</body>
</html>