kopia lustrzana https://github.com/magicbug/Cloudlog
Merge pull request #2108 from phl0/radioStatusHint
Show radio CAT status above QSO panel if availablepull/2114/head
commit
a6611773de
|
@ -1247,13 +1247,32 @@ $(document).on('keypress',function(e) {
|
|||
var minutes = Math.floor(<?php echo $this->optionslib->get_option('cat_timeout_interval'); ?> / 60);
|
||||
|
||||
if(data.updated_minutes_ago > minutes) {
|
||||
$(".radio_cat_state" ).remove();
|
||||
if($('.radio_timeout_error').length == 0) {
|
||||
$('.qso_panel').prepend('<div class="alert alert-danger radio_timeout_error" role="alert">Radio connection timed-out: ' + $('select.radios option:selected').text() + ' data is ' + data.updated_minutes_ago + ' minutes old.</div>');
|
||||
$('.qso_panel').prepend('<div class="alert alert-danger radio_timeout_error" role="alert"><i class="fas fa-broadcast-tower"></i> Radio connection timed-out: ' + $('select.radios option:selected').text() + ' data is ' + data.updated_minutes_ago + ' minutes old.</div>');
|
||||
} else {
|
||||
$('.radio_timeout_error').text('Radio connection timed-out: ' + $('select.radios option:selected').text() + ' data is ' + data.updated_minutes_ago + ' minutes old.');
|
||||
$('.radio_timeout_error').html('Radio connection timed-out: ' + $('select.radios option:selected').text() + ' data is ' + data.updated_minutes_ago + ' minutes old.');
|
||||
}
|
||||
} else {
|
||||
$(".radio_timeout_error" ).remove();
|
||||
text = '<i class="fas fa-broadcast-tower"></i><span style="margin-left:10px;"></span><b>TX:</b> '+parseInt(data.frequency)/1000/1000+' MHz';
|
||||
if(data.power != null && data.power != 0) {
|
||||
text = text+'<span style="margin-left:10px"></span>'+data.power+'W';
|
||||
}
|
||||
if(data.prop_mode != null && data.prop_mode != '') {
|
||||
text = text+'<span style="margin-left:10px"></span>('+data.prop_mode;
|
||||
if (data.prop_mode == 'SAT') {
|
||||
text = text+' '+data.satname;
|
||||
}
|
||||
}
|
||||
if(data.frequency_rx != null && data.frequency_rx != 0) {
|
||||
text = text+'<span style="margin-left:10px"></span><b>RX:</b> '+parseInt(data.frequency_rx)/1000/1000+' MHz)';
|
||||
}
|
||||
if (! $('#radio_cat_state').length) {
|
||||
$('.qso_panel').prepend('<div id="radio_cat_state" class="alert alert-success radio_cat_state" role="alert">'+text+'</div>');
|
||||
} else {
|
||||
$('#radio_cat_state').html(text);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Ładowanie…
Reference in New Issue