WebSocket RadioName

This commit is contained in:
int2001
2025-12-26 08:29:18 +00:00
parent 4b01943bcb
commit 2f720e76d7
3 changed files with 9 additions and 1 deletions

View File

@@ -173,7 +173,9 @@ class Logbook_model extends CI_Model {
$tx_power = null;
}
if (($this->input->post('radio',TRUE) ?? 0) != 0) {
if (($this->input->post('radio',TRUE) ?? '') == 'ws') { // WebSocket
$radio_name=$this->input->post('radio_ws_name',TRUE);
} elseif (($this->input->post('radio',TRUE) ?? 0) != 0) {
$this->load->model('cat');
$radio_name=$this->cat->radio_status($this->input->post('radio',TRUE))->row()->radio ?? '';
} else {

View File

@@ -409,6 +409,7 @@ if (typeof window.DX_WATERFALL_FIELD_MAP === 'undefined') {
<option value="<?php echo $row->id; ?>" <?php if($this->session->userdata('radio') == $row->id && $manual_mode == '0') { echo "selected=\"selected\""; } ?>><?= __("Polling - ") . $row->radio; ?> <?php if ($radio_last_updated->id == $row->id) { echo "(".__("last updated").")"; } else { echo ''; } ?></option>
<?php } ?>
</select>
<input type="hidden" id="radio_ws_name" name="radio_ws_name" value="" />
</div>
<div class="mb-3">

View File

@@ -593,6 +593,11 @@ $(document).ready(function() {
// Build icon with Bootstrap color class and ID for animation
var icon = '<i id="radio-status-icon" class="fas fa-radio ' + iconClass + '" style="margin-right: 10px; font-size: 1.2em;"></i>';
var html = baseStyle + icon + content + '</div>';
if (($(".radios option:selected").val() == 'ws') && (data.radio != undefined)) { // Are we on websocket? add hiddenfield with radioName
$("#radio_ws_name").val(data.radio);
} else {
$("#radio_ws_name").val('');
}
// Update DOM based on global CAT_COMPACT_MODE setting
if (window.CAT_COMPACT_MODE === 'icon-only') {