QSO Panel: CAT Timeout Warning Message #310
This adds a warning that Cloudlogs not received any recent data from CAT Interface this timeout is defined in the cloudlog.php configuration file $config['cat_timeout_interval'] = 1800; The default has been changed to 30mins.
这个提交包含在:
父节点
468419245a
当前提交
5e6e65301c
共有 4 个文件被更改,包括 34 次插入 和 9 次删除
|
|
@ -55,11 +55,10 @@ $config['map_gridsquares'] = FALSE;
|
||||||
| The external CAT applications can obviously stop working for various reasons
|
| The external CAT applications can obviously stop working for various reasons
|
||||||
| this interval is used for displaying a warning on the QSO Panel
|
| this interval is used for displaying a warning on the QSO Panel
|
||||||
|
|
|
|
||||||
| Default is: 300 seconds (5 minutes)
|
| Default is: 1800 seconds (30 minutes)
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
$config['cat_timeout_interval'] = 1800;
|
||||||
$config['cat_timeout_interval'] = 300;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@
|
||||||
foreach ($query->result() as $row)
|
foreach ($query->result() as $row)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if($row->sat_name != "") {
|
if($row->sat_name != "") {
|
||||||
$uplink_freq = $row->uplink_freq;
|
$uplink_freq = $row->uplink_freq;
|
||||||
$downlink_freq = $row->downlink_freq;
|
$downlink_freq = $row->downlink_freq;
|
||||||
|
|
@ -118,13 +119,20 @@
|
||||||
$sat_mode = "";
|
$sat_mode = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Calculate how old the data is in minutes
|
||||||
|
$datetime1 = new DateTime(); // Today's Date/Time
|
||||||
|
$datetime2 = new DateTime($row->newtime);
|
||||||
|
$interval = $datetime1->diff($datetime2);
|
||||||
|
$updated_at = $interval->format('%i');
|
||||||
|
|
||||||
|
// Return Json data
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
"uplink_freq" => $uplink_freq,
|
"uplink_freq" => $uplink_freq,
|
||||||
"downlink_freq" => $downlink_freq,
|
"downlink_freq" => $downlink_freq,
|
||||||
"mode" => $mode,
|
"mode" => $mode,
|
||||||
"satmode" => $sat_mode,
|
"satmode" => $sat_mode,
|
||||||
"satname" => $sat_name,
|
"satname" => $sat_name,
|
||||||
|
"updated_minutes_ago" => $updated_at,
|
||||||
), JSON_PRETTY_PRINT);
|
), JSON_PRETTY_PRINT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -175,4 +183,5 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -92,11 +92,9 @@
|
||||||
|
|
||||||
|
|
||||||
function radio_status($id) {
|
function radio_status($id) {
|
||||||
$this->db->select('*');
|
|
||||||
$this->db->where('id', $id);
|
|
||||||
$query = $this->db->get('cat');
|
|
||||||
|
|
||||||
return $query;
|
return $this->db->query('SELECT *, CONVERT_TZ(`timestamp`, @@session.time_zone, \'+00:00\' ) as newtime FROM `cat` WHERE 1');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -879,6 +879,20 @@ $(document).on('keypress',function(e) {
|
||||||
}
|
}
|
||||||
$("#sat_name").val(data.satname);
|
$("#sat_name").val(data.satname);
|
||||||
$("#sat_mode").val(data.satmode);
|
$("#sat_mode").val(data.satmode);
|
||||||
|
|
||||||
|
// Display CAT Timeout warnng based on the figure given in the config file
|
||||||
|
var minutes = Math.floor(<?php echo $this->config->item('cat_timeout_interval'); ?> / 60);
|
||||||
|
|
||||||
|
if(data.updated_minutes_ago > minutes) {
|
||||||
|
if($('.radio_timeout_error').length == 0) {
|
||||||
|
$('.qso_panel').prepend('<div class="alert alert-danger radio_timeout_error" role="alert">Radio Connection Error: ' + $('select.radios option:selected').text() + ' data is ' + data.updated_minutes_ago + ' minutes old.</div>');
|
||||||
|
} else {
|
||||||
|
$('.radio_timeout_error').text('Radio Connection Error: ' + $('select.radios option:selected').text() + ' data is ' + data.updated_minutes_ago + ' minutes old.');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$(".radio_timeout_error" ).remove();
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -898,6 +912,11 @@ $(document).on('keypress',function(e) {
|
||||||
$("#frequency_rx").val("");
|
$("#frequency_rx").val("");
|
||||||
$("#selectPropagation").val($("#selectPropagation option:first").val());
|
$("#selectPropagation").val($("#selectPropagation option:first").val());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($(".radios option:selected").text() == "None") {
|
||||||
|
$(".radio_timeout_error" ).remove();
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用