Implemented DXCluster-Lookup for current QRG

This commit is contained in:
int2001 2023-07-16 11:53:53 +00:00
parent ba5a97b5dd
commit 6aab4f7bbc
3 changed files with 31 additions and 2 deletions

View File

@ -598,3 +598,16 @@ $config['rewrite_short_tags'] = FALSE;
| Array: array('10.0.1.200', '192.168.5.0/24') | Array: array('10.0.1.200', '192.168.5.0/24')
*/ */
$config['proxy_ips'] = ''; $config['proxy_ips'] = '';
/*
|--------------------------------------------------------------------------
| DXCluster-API Base-URL
|--------------------------------------------------------------------------
|
| If you have access to a DXCluster-API ( see https://github.com/int2001/DXClusterAPI for running your own )
| put the base-URL for that API here
|
| Example: 'https://log.jo30.de/dxcache'
| Leave blank to disable: ''
*/
$config['dxcluster_provider']='';

View File

@ -933,9 +933,25 @@ $(document).on('keypress',function(e) {
<?php if ($this->uri->segment(1) == "qso") { ?> <?php if ($this->uri->segment(1) == "qso") { ?>
<script src="<?php echo base_url() ;?>assets/js/sections/qso.js"></script> <script src="<?php echo base_url() ;?>assets/js/sections/qso.js"></script>
<?php <?php
if ($this->config->item('dxcluster_provider') != ''){ ?>
<script type="text/javascript">
var dxcluster_provider =' <?php echo $this->config->item('dxcluster_provider'); ?>';
$(document).ready(function() {
$("#check_cluster").on("click", function() {
$.ajax({ url: dxcluster_provider+"/spot/"+$("#frequency").val()/1000, cache: false, dataType: "json" }).done(
function(dxspot) {
$("#callsign").val(dxspot.spotted);
}
);
});
});
</script>
<?php
}
$this->load->model('stations'); $this->load->model('stations');
$active_station_id = $this->stations->find_active(); $active_station_id = $this->stations->find_active();
$station_profile = $this->stations->profile($active_station_id); $station_profile = $this->stations->profile($active_station_id);

View File

@ -63,7 +63,7 @@
<!-- Callsign Input --> <!-- Callsign Input -->
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-9"> <div class="form-group col-md-9">
<label for="callsign"><?php echo lang('gen_hamradio_callsign'); ?></label> <label for="callsign"><?php echo lang('gen_hamradio_callsign'); ?></label><?php if ($this->config->item('dxcluster_provider') != '') { ?>&nbsp;<i id="check_cluster" data-toggle="tooltip" data-original-title="Search DXCluster for latest Spot" class="fas fa-search"></i> <?php } ?>
<input type="text" class="form-control" id="callsign" name="callsign" required> <input type="text" class="form-control" id="callsign" name="callsign" required>
<small id="callsign_info" class="badge badge-secondary"></small> <small id="lotw_info" class="badge badge-success"></small> <small id="callsign_info" class="badge badge-secondary"></small> <small id="lotw_info" class="badge badge-success"></small>
</div> </div>