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

@@ -463,9 +463,7 @@
var is_sniffing = false; var is_sniffing = false;
// 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,22 +323,38 @@
</div> </div>
</div> </div>
<script> <script>
// CREATES MODAL FOR LOG TOOLS
function cfgm() { var is_sniffing = false;
$('#m-t').html('Logs tools');
$('#m-f').empty(); // CREATES MODAL FOR LOG TOOLS
$('.sb').unbind(); function cfgm() {
var tl = c_btn('Download log file', 0, ' dlog'); $('#m-t').html('Logs tools');
tl += c_btn('Start DMX sniff', 0, ' ddmx'); $('#m-f').empty();
$('#m-b').html(tl); $('.sb').unbind();
$('#cfg-modal').modal(); var tl = c_btn('Download log file', 0, ' dlog');
$('.dlog').bind('click', function () { if (!is_sniffing) {
close_modal() tl += c_btn('Start DMX sniff', 0, ' ddmx');
}); } else {
$('.ddmx').bind('click', function () { tl += c_btn('Stop DMX sniff', 0, ' ddmx');
close_modal()
})
} }
$('#m-b').html(tl);
$('#cfg-modal').modal();
$('.dlog').bind('click', function () {
// download logs
close_modal()
});
$('.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()
})
}
function lfix(l) { function lfix(l) {
return l.charAt(0).toUpperCase() + l.slice(1).toLowerCase().replace('ems', 'EMS') return l.charAt(0).toUpperCase() + l.slice(1).toLowerCase().replace('ems', 'EMS')