fixing button to redirect

Signed-off-by: Ebbe Baß <ebbe.bass>
main
Ebbe Baß 2024-02-17 02:06:44 +01:00
parent 290acca363
commit ed76e7e1a0
1 changed files with 47 additions and 95 deletions

View File

@ -9,7 +9,6 @@
<script src="jquery/jquery.min.js"></script> <script src="jquery/jquery.min.js"></script>
</head> </head>
<body> <body>
<div class="container mt-5"> <div class="container mt-5">
<h1 class="mb-4">PiXelTube Web Interface</h1> <h1 class="mb-4">PiXelTube Web Interface</h1>
<table class="table"> <table class="table">
@ -46,7 +45,9 @@
<th>'.$row["universe"].'</th> <th>'.$row["universe"].'</th>
<th>'.$row["dmx_address"].'</th> <th>'.$row["dmx_address"].'</th>
<th> <th>
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#configureModal" data-id="'.$row["mac_address"].'" data-universe="'.$row["universe"].'" data-dmx-address="'.$row["dmx_address"].'">Configure</button> <a href="./settings.php?mac='.$row["mac_address"].'">
<button type="button" class="btn btn-secondary">Configure</button>
</a>
</th> </th>
</tr> </tr>
'; ';
@ -59,55 +60,6 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<!-- Configure Modal -->
<div class="modal" id="configureModal" tabindex="-1" role="dialog" aria-labelledby="configureModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="configureModalLabel">Configure DMX Address and Universe</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="configureForm">
<div class="form-group">
<label for="dmxAddress">DMX Address:</label>
<input type="text" class="form-control" id="dmxAddress" placeholder="Enter DMX Address">
</div>
<div class="form-group">
<label for="universe">Universe:</label>
<input type="text" class="form-control" id="universe" placeholder="Enter Universe">
</div>
<button type="submit" class="btn btn-primary">Save Changes</button>
</form>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('#configureModal').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget);
var macAddress = button.data('id');
var universe = button.data('universe');
var dmxAddress = button.data('dmx-address');
var modal = $(this);
modal.find('.modal-title').text('Configure DMX Address and Universe for Tube ID ' + macAddress);
modal.find('#dmxAddress').val(dmxAddress);
modal.find('#universe').val(universe);
});
$('#configureForm').submit(function (event) {
event.preventDefault();
$('#configureModal').modal('hide');
});
});
</script>
</div> </div>
</body> </body>
</html> </html>