[Dashboard] Update radio frequency display every 5 seconds

pull/2174/head
Peter Goodhall 2023-05-28 15:02:15 +01:00
rodzic 8354bf609f
commit e8c62a26cf
3 zmienionych plików z 31 dodań i 22 usunięć

Wyświetl plik

@ -114,6 +114,13 @@ class Dashboard extends CI_Controller {
}
function radio_display_component() {
$this->load->model('cat');
$data['radio_status'] = $this->cat->recent_status();
$this->load->view('components/radio_display_table', $data);
}
function map() {
$this->load->model('logbook_model');

Wyświetl plik

@ -0,0 +1,23 @@
<?php if($radio_status->num_rows()) { ?>
<table class="table table-striped">
<tr class="titles">
<td colspan="2"><i class="fas fa-broadcast-tower"></i> Radio Status</td>
</tr>
<?php foreach ($radio_status->result_array() as $row) { ?>
<tr>
<td><?php echo $row['radio']; ?></td>
<td>
<?php if($row['prop_mode'] == 'SAT') { ?>
<?php echo $row['sat_name']; ?>
<?php } else { ?>
<?php echo $this->frequency->hz_to_mhz($row['frequency']); ?> (<?php echo $row['mode']; ?>)
<?php } ?>
</td>
</tr>
<?php } ?>
</table>
<?php } ?>

Wyświetl plik

@ -160,29 +160,8 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
<?php } ?>
<div class="table-responsive">
<?php if($radio_status->num_rows()) { ?>
<table class="table table-striped">
<tr class="titles">
<td colspan="2"><i class="fas fa-broadcast-tower"></i> Radio Status</td>
</tr>
<?php foreach ($radio_status->result_array() as $row) { ?>
<tr>
<td><?php echo $row['radio']; ?></td>
<td>
<?php if($row['prop_mode'] == 'SAT') { ?>
<?php echo $row['sat_name']; ?>
<?php } else { ?>
<?php echo $this->frequency->hz_to_mhz($row['frequency']); ?> (<?php echo $row['mode']; ?>)
<?php } ?>
</td>
</tr>
<?php } ?>
</table>
<?php } ?>
<div id="radio_display" hx-get="<?php echo site_url('dashboard/radio_display_component'); ?>" hx-trigger="every 5s"></div>
<table class="table table-striped">
<tr class="titles">