fix DMX sniff on T1

This commit is contained in:
Kwimbee
2025-01-23 17:11:48 +01:00
parent ea5680b473
commit 0b8f06099a
2 changed files with 32 additions and 18 deletions

View File

@@ -464,8 +464,6 @@
// CREATES MODAL FOR LOG TOOLS // CREATES MODAL FOR LOG TOOLS
function cfgm() { function cfgm() {
console.log(is_sniffing);
$('#m-t').html('Logs tools'); $('#m-t').html('Logs tools');
$('#m-f').empty(); $('#m-f').empty();
$('.sb').unbind(); $('.sb').unbind();

View File

@@ -323,19 +323,35 @@
</div> </div>
</div> </div>
<script> <script>
var is_sniffing = false;
// CREATES MODAL FOR LOG TOOLS // CREATES MODAL FOR LOG TOOLS
function cfgm() { function cfgm() {
$('#m-t').html('Logs tools'); $('#m-t').html('Logs tools');
$('#m-f').empty(); $('#m-f').empty();
$('.sb').unbind(); $('.sb').unbind();
var tl = c_btn('Download log file', 0, ' dlog'); var tl = c_btn('Download log file', 0, ' dlog');
if (!is_sniffing) {
tl += c_btn('Start DMX sniff', 0, ' ddmx'); tl += c_btn('Start DMX sniff', 0, ' ddmx');
} else {
tl += c_btn('Stop DMX sniff', 0, ' ddmx');
}
$('#m-b').html(tl); $('#m-b').html(tl);
$('#cfg-modal').modal(); $('#cfg-modal').modal();
$('.dlog').bind('click', function () { $('.dlog').bind('click', function () {
// download logs
close_modal() close_modal()
}); });
$('.ddmx').bind('click', function () { $('.ddmx').bind('click', function () {
// start sniff
if (is_sniffing) {
$('.ddmx').html('Start DMX sniff');
is_sniffing = false;
} else {
$('.ddmx').html('Stop DMX sniff');
is_sniffing = true;
}
close_modal() close_modal()
}) })
} }