From e6668443714b47a689aee4a1d9615653b8e3cf99 Mon Sep 17 00:00:00 2001
From: int2001
Date: Fri, 21 Jul 2023 09:19:59 +0000
Subject: [PATCH 08/39] Modified Bandmap
---
assets/js/sections/bandmap.js | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/assets/js/sections/bandmap.js b/assets/js/sections/bandmap.js
index 23a0731f..d5de46f9 100644
--- a/assets/js/sections/bandmap.js
+++ b/assets/js/sections/bandmap.js
@@ -47,7 +47,6 @@ $(function() {
}
}(Highcharts));
- var dxcluster_provider = 'https://dxc.jo30.de/dxcache';
var bandMapChart;
var color = ifDarkModeThemeReturn('white', 'grey');
@@ -123,9 +122,10 @@ $(function() {
return ret;
}
- function update_chart(lowerQrg,upperQrg,maxAgeMinutes) {
+ function update_chart(band,maxAgeMinutes) {
+ let dxurl = dxcluster_provider + "/spots/" + band + "/" +maxAgeMinutes;
$.ajax({
- url: dxcluster_provider + "/spots",
+ url: dxurl,
cache: false,
dataType: "json"
}).done(function(dxspots) {
@@ -133,9 +133,7 @@ $(function() {
dxspots.sort(SortByQrg);
dxspots=reduce_spots(dxspots);
dxspots.forEach((single) => {
- if ( (single.frequency >= lowerQrg) && (single.frequency <= upperQrg) && (Date.parse(single.when)>(Date.now() - 1000 * 60 * maxAgeMinutes)) ) {
- spots4chart.push(convert2high(single));
- }
+ spots4chart.push(convert2high(single));
});
// console.log(spots4chart);
bandMapChart.series[0].setData(spots4chart);
@@ -144,9 +142,10 @@ $(function() {
}
- function set_chart(lowerQrg,upperQrg,maxAgeMinutes) {
+ function set_chart(band,maxAgeMinutes) {
+ let dxurl = dxcluster_provider + "/spots/" + band + "/" +maxAgeMinutes;
$.ajax({
- url: dxcluster_provider + "/spots",
+ url: dxurl,
cache: false,
dataType: "json"
}).done(function(dxspots) {
@@ -154,14 +153,12 @@ $(function() {
dxspots.sort(SortByQrg);
dxspots=reduce_spots(dxspots);
dxspots.forEach((single) => {
- if ( (single.frequency >= lowerQrg) && (single.frequency <= upperQrg) && (Date.parse(single.when)>(Date.now() - 1000 * 60 * maxAgeMinutes)) ) {
- spots4chart.push(convert2high(single));
- }
+ spots4chart.push(convert2high(single));
});
- bandMapChart=render_chart('20m',spots4chart);
+ bandMapChart=render_chart(band,spots4chart);
});
}
- set_chart(14000,14350,30);
- setInterval(function () { update_chart(14000,14350,30); },60000);
+ set_chart($('#band option:selected').val(),30);
+ setInterval(function () { update_chart($('#band option:selected').val(),30); },60000);
});
From c24a2fc1137594a064828612d043aaea8a06a6b1 Mon Sep 17 00:00:00 2001
From: int2001
Date: Fri, 21 Jul 2023 09:44:05 +0000
Subject: [PATCH 09/39] Changed hard-url to base_url
---
application/views/interface_assets/footer.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php
index 2d755e2c..1acd0bc5 100644
--- a/application/views/interface_assets/footer.php
+++ b/application/views/interface_assets/footer.php
@@ -937,7 +937,7 @@ $(document).on('keypress',function(e) {
if ($this->optionslib->get_option('dxcache_url') != ''){ ?>
From dc7abe462f962926548869f7d6126ea195aa061a Mon Sep 17 00:00:00 2001
From: int2001
Date: Fri, 21 Jul 2023 10:15:24 +0000
Subject: [PATCH 11/39] onChange-Trigger for Band // Errorhandling when there
are no spots
---
assets/js/sections/bandmap.js | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/assets/js/sections/bandmap.js b/assets/js/sections/bandmap.js
index d5de46f9..327285c4 100644
--- a/assets/js/sections/bandmap.js
+++ b/assets/js/sections/bandmap.js
@@ -130,12 +130,14 @@ $(function() {
dataType: "json"
}).done(function(dxspots) {
spots4chart=[];
- dxspots.sort(SortByQrg);
- dxspots=reduce_spots(dxspots);
- dxspots.forEach((single) => {
- spots4chart.push(convert2high(single));
- });
- // console.log(spots4chart);
+ if (dxspots.length>1) {
+ dxspots.sort(SortByQrg);
+ dxspots=reduce_spots(dxspots);
+ dxspots.forEach((single) => {
+ spots4chart.push(convert2high(single));
+ });
+ }
+ bandMapChart.title.text=band;
bandMapChart.series[0].setData(spots4chart);
bandMapChart.redraw();
});
@@ -150,15 +152,20 @@ $(function() {
dataType: "json"
}).done(function(dxspots) {
spots4chart=[];
- dxspots.sort(SortByQrg);
- dxspots=reduce_spots(dxspots);
- dxspots.forEach((single) => {
- spots4chart.push(convert2high(single));
- });
+ if (dxspots.length>1) {
+ dxspots.sort(SortByQrg);
+ dxspots=reduce_spots(dxspots);
+ dxspots.forEach((single) => {
+ spots4chart.push(convert2high(single));
+ });
+ }
bandMapChart=render_chart(band,spots4chart);
});
}
set_chart($('#band option:selected').val(),30);
setInterval(function () { update_chart($('#band option:selected').val(),30); },60000);
+ $("#band").on("change",function() {
+ set_chart($('#band option:selected').val(),30);
+ });
});
From 1dc278847c381b4e64136d027f67788647a6cab1 Mon Sep 17 00:00:00 2001
From: int2001
Date: Fri, 21 Jul 2023 10:24:21 +0000
Subject: [PATCH 12/39] Number of spots must be at least 1 spot to
render/update
---
assets/js/sections/bandmap.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/assets/js/sections/bandmap.js b/assets/js/sections/bandmap.js
index 327285c4..520d9fc0 100644
--- a/assets/js/sections/bandmap.js
+++ b/assets/js/sections/bandmap.js
@@ -130,7 +130,7 @@ $(function() {
dataType: "json"
}).done(function(dxspots) {
spots4chart=[];
- if (dxspots.length>1) {
+ if (dxspots.length>0) {
dxspots.sort(SortByQrg);
dxspots=reduce_spots(dxspots);
dxspots.forEach((single) => {
@@ -152,7 +152,7 @@ $(function() {
dataType: "json"
}).done(function(dxspots) {
spots4chart=[];
- if (dxspots.length>1) {
+ if (dxspots.length>0) {
dxspots.sort(SortByQrg);
dxspots=reduce_spots(dxspots);
dxspots.forEach((single) => {
From fb39d8ec0dd4f8df8611ca9bdc87152990d7aaf5 Mon Sep 17 00:00:00 2001
From: Andreas <6977712+AndreasK79@users.noreply.github.com>
Date: Fri, 21 Jul 2023 13:27:13 +0200
Subject: [PATCH 13/39] [Bandmap] Added cat
---
application/controllers/Bandmap.php | 5 +++
application/views/bandmap/index.php | 45 ++++++++++++---------
assets/js/sections/bandmap.js | 61 ++++++++++++++++++++++++++++-
3 files changed, 91 insertions(+), 20 deletions(-)
diff --git a/application/controllers/Bandmap.php b/application/controllers/Bandmap.php
index 1719d891..f8c7e26b 100644
--- a/application/controllers/Bandmap.php
+++ b/application/controllers/Bandmap.php
@@ -11,6 +11,11 @@ class Bandmap extends CI_Controller {
}
function index() {
+ $this->load->model('cat');
+ $this->load->model('bands');
+ $data['radios'] = $this->cat->radios();
+ $data['bands'] = $this->bands->get_user_bands_for_qso_entry();
+
$footerData = [];
$footerData['scripts'] = [
'assets/js/sections/bandmap.js',
diff --git a/application/views/bandmap/index.php b/application/views/bandmap/index.php
index 8e5d6d3c..a933678c 100644
--- a/application/views/bandmap/index.php
+++ b/application/views/bandmap/index.php
@@ -1,31 +1,38 @@
-
+
-
-
diff --git a/assets/js/sections/bandmap.js b/assets/js/sections/bandmap.js
index 520d9fc0..dfd89c07 100644
--- a/assets/js/sections/bandmap.js
+++ b/assets/js/sections/bandmap.js
@@ -147,7 +147,7 @@ $(function() {
function set_chart(band,maxAgeMinutes) {
let dxurl = dxcluster_provider + "/spots/" + band + "/" +maxAgeMinutes;
$.ajax({
- url: dxurl,
+ url: dxurl,
cache: false,
dataType: "json"
}).done(function(dxspots) {
@@ -169,3 +169,62 @@ $(function() {
set_chart($('#band option:selected').val(),30);
});
});
+
+var updateFromCAT = function() {
+ if($('select.radios option:selected').val() != '0') {
+ radioID = $('select.radios option:selected').val();
+ $.getJSON( "radio/json/" + radioID, function( data ) {
+
+ if (data.error) {
+ if (data.error == 'not_logged_in') {
+ $(".radio_cat_state" ).remove();
+ if($('.radio_login_error').length == 0) {
+ $('.messages').prepend('
You\'re not logged it. Please
login ');
+ }
+ }
+ // Put future Errorhandling here
+ } else {
+ if($('.radio_login_error').length != 0) {
+ $(".radio_login_error" ).remove();
+ }
+ var band = frequencyToBand(data.frequency);
+
+ if (band !== $("#band").val()) {
+ $("#band").val(band);
+ $("#band").trigger("change");
+ }
+
+ var minutes = Math.floor(cat_timeout_interval / 60);
+
+ if(data.updated_minutes_ago > minutes) {
+ $(".radio_cat_state" ).remove();
+ if($('.radio_timeout_error').length == 0) {
+ $('.messages').prepend(' Radio connection timed-out: ' + $('select.radios option:selected').text() + ' data is ' + data.updated_minutes_ago + ' minutes old.
');
+ } else {
+ $('.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 = 'TX: '+(Math.round(parseInt(data.frequency)/100)/10000).toFixed(4)+' MHz';
+ if(data.mode != null) {
+ text = text+''+data.mode;
+ }
+ if(data.power != null && data.power != 0) {
+ text = text+''+data.power+' W';
+ }
+ if (! $('#radio_cat_state').length) {
+ $('.messages').prepend('');
+ } else {
+ $('#radio_cat_state').html(text);
+ }
+ }
+ }
+ });
+ }
+};
+
+// Update frequency every three second
+setInterval(updateFromCAT, 3000);
+
+// If a radios selected from drop down select radio update.
+$('.radios').change(updateFromCAT);
From 6c07da28ee8a7323a949ecc5384737796717417e Mon Sep 17 00:00:00 2001
From: int2001
Date: Fri, 21 Jul 2023 11:46:16 +0000
Subject: [PATCH 14/39] Added Settings for spot-age and de-continent
---
application/controllers/Options.php | 12 ++++++++++
application/language/english/options_lang.php | 5 ++++
application/language/german/options_lang.php | 5 +++-
application/views/options/dxcluster.php | 24 ++++++++++++++++++-
4 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/application/controllers/Options.php b/application/controllers/Options.php
index c83bcf27..55e7551a 100644
--- a/application/controllers/Options.php
+++ b/application/controllers/Options.php
@@ -159,12 +159,24 @@ class Options extends CI_Controller {
$this->load->library('form_validation');
$this->form_validation->set_rules('dxcache_url', 'URL of DXCache', 'valid_url');
+ $this->form_validation->set_rules('dxcluster_maxage', 'Max Age of Spots', 'required');
+ $this->form_validation->set_rules('dxcluster_decont', 'de continent', 'required');
if ($this->form_validation->run() == FALSE) {
$this->load->view('interface_assets/header', $data);
$this->load->view('options/dxcluster');
$this->load->view('interface_assets/footer');
} else {
+ $dxcluster_decont_update = $this->optionslib->update('dxcluster_decont', $this->input->post('dxcluster_decont'), 'yes');
+ if($dxcluster_decont_update == TRUE) {
+ $this->session->set_flashdata('success', $this->lang->line('options_dxcluster_decont_changed_to').$this->input->post('dxcluster_decont'));
+ }
+
+ $dxcluster_url_update = $this->optionslib->update('dxcluster_maxage', $this->input->post('dxcluster_maxage'), 'yes');
+ if($dxcluster_maxage_update == TRUE) {
+ $this->session->set_flashdata('success', $this->lang->line('options_dxcluster_maxage_changed_to').$this->input->post('dxcluster_maxage'));
+ }
+
$dxcache_url_update = $this->optionslib->update('dxcache_url', $this->input->post('dxcache_url'), 'yes');
if($dxcache_url_update == TRUE) {
$this->session->set_flashdata('success', $this->lang->line('options_dxcache_url_changed_to').$this->input->post('dxcache_url'));
diff --git a/application/language/english/options_lang.php b/application/language/english/options_lang.php
index 70814e49..da12f681 100644
--- a/application/language/english/options_lang.php
+++ b/application/language/english/options_lang.php
@@ -64,5 +64,10 @@ $lang['options_dxcluster_longtext'] = 'The Provider of the DXCluster-Cache. You
$lang['options_dxcluster_hint'] = 'URL of the DXCluster-Cache. e.g. https://dxc.jo30.de/dxcache';
$lang['options_dxcluster_settings'] = 'DXCluster';
$lang['options_dxcache_url_changed_to'] = 'DXCluster Cache URL changed to ';
+$lang['options_dxcluster_maxage'] = 'Maximum Age of spots taken care of';
+$lang['options_dxcluster_maxage_hint'] = 'The Age in Minutes of spots, that will be taken care at bandplan/lookup';
+$lang['options_dxcluster_decont'] = 'Show spots which are spotted from following continent';
+$lang['options_dxcluster_maxage_changed_to']='Maximum age of spots changed to ';
+$lang['options_dxcluster_decont_changed_to']='de continent changed to ';
$lang['options_save'] = 'Save';
diff --git a/application/language/german/options_lang.php b/application/language/german/options_lang.php
index eee2cdfd..ec0886a1 100644
--- a/application/language/german/options_lang.php
+++ b/application/language/german/options_lang.php
@@ -64,6 +64,9 @@ $lang['options_dxcluster_longtext'] = 'Der Provider des DXCluster-Caches. Du kan
$lang['options_dxcluster_hint'] = 'URL des DXCluster-Caches. z.B. https://dxc.jo30.de/dxcache';
$lang['options_dxcluster_settings'] = 'DXCluster';
$lang['options_dxcache_url_changed_to'] = 'DXCluster Cache URL geänder zu ';
-
+$lang['options_dxcluster_maxage'] = 'Maximales Alter bis zu dem Spots berücksichtigt werden';
+$lang['options_dxcluster_decont'] = 'Nur Spots berücksichtigen, die in folgendem Kontinent erfasst wurden';
+$lang['options_dxcluster_maxage_changed_to']='Maximal Spot-Alter geänder auf ';
+$lang['options_dxcluster_decont_changed_to']='Spotterkontinent geändert auf ';
$lang['options_save'] = 'Speichern';
diff --git a/application/views/options/dxcluster.php b/application/views/options/dxcluster.php
index 645eb923..4d8d9a58 100644
--- a/application/views/options/dxcluster.php
+++ b/application/views/options/dxcluster.php
@@ -40,7 +40,29 @@
-
+
+
+
+
+
+
+
+
+
+
+
From 355aef7af820005d5404c35f4a5752a7b0987bbd Mon Sep 17 00:00:00 2001
From: int2001
Date: Fri, 21 Jul 2023 12:17:28 +0000
Subject: [PATCH 15/39] Show Bandmap only in Menu, when setted up
---
application/views/interface_assets/header.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php
index 6166f617..cd0b2449 100644
--- a/application/views/interface_assets/header.php
+++ b/application/views/interface_assets/header.php
@@ -80,8 +80,10 @@
+optionslib->get_option('dxcache_url') != '') { ?>
+
From c62a4c70a0f3ef4bf38e34b3418b4bfd26c97cb9 Mon Sep 17 00:00:00 2001
From: int2001
Date: Fri, 21 Jul 2023 14:44:14 +0000
Subject: [PATCH 16/39] Added filtering on maxAge / de-cont to bandmap (apply
settings)
---
application/controllers/Dxcluster.php | 10 ++++++++--
application/models/Logbook_model.php | 10 ++++++++--
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/application/controllers/Dxcluster.php b/application/controllers/Dxcluster.php
index 807e3793..af10c8cf 100644
--- a/application/controllers/Dxcluster.php
+++ b/application/controllers/Dxcluster.php
@@ -11,8 +11,14 @@ class Dxcluster extends CI_Controller {
}
- function spots($band,$age = 60) {
- $calls_found=$this->logbook_model->dxc_spotlist($band, $age);
+ function spots($band,$age = '', $de = '') {
+ if ($age == '') {
+ $age = $this->optionslib->get_option('dxcluster_maxage');
+ }
+ if ($de == '') {
+ $de = $this->optionslib->get_option('dxcluster_decont');
+ }
+ $calls_found=$this->logbook_model->dxc_spotlist($band, $age, $de);
header('Content-Type: application/json');
if ($calls_found) {
echo json_encode($calls_found, JSON_PRETTY_PRINT);
diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php
index 704e5bad..a3327d22 100755
--- a/application/models/Logbook_model.php
+++ b/application/models/Logbook_model.php
@@ -3993,7 +3993,7 @@ class Logbook_model extends CI_Model {
return false;
}
- public function dxc_spotlist($band = '20m',$maxage = 60) {
+ public function dxc_spotlist($band = '20m',$maxage = 60, $de = '') {
$CI =& get_instance();
if ( ($this->optionslib->get_option('dxcache_url') != '') ) {
$dxcache_url = $this->optionslib->get_option('dxcache_url').'/spots/';
@@ -4025,7 +4025,13 @@ class Logbook_model extends CI_Model {
if ($minutes<=$maxage) {
$dxcc=$this->dxcc_lookup($singlespot->spotter,date('Ymd', time()));
$singlespot->dxcc_spotter=$dxcc;
- array_push($spotsout,$singlespot);
+ if ($de != '') {
+ if ($de == $dxcc['cont']) {
+ array_push($spotsout,$singlespot);
+ }
+ } else {
+ array_push($spotsout,$singlespot);
+ }
}
}
return ($spotsout);
From a2304a8fe5de1df0c221c7aaf6d9694a439fb109 Mon Sep 17 00:00:00 2001
From: int2001
Date: Fri, 21 Jul 2023 16:05:38 +0000
Subject: [PATCH 17/39] Fixed a small bug at qso page (tick was missing)
---
application/models/Logbook_model.php | 2 +-
application/views/interface_assets/footer.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php
index a3327d22..0909a2cc 100755
--- a/application/models/Logbook_model.php
+++ b/application/models/Logbook_model.php
@@ -4050,7 +4050,7 @@ class Logbook_model extends CI_Model {
// CURL Functions
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $dxcache_url);
- curl_setopt($ch, CURLOPT_USERAGENT, 'Cloudlog DXLookup');
+ curl_setopt($ch, CURLOPT_USERAGENT, 'Cloudlog DXLookup by QRG');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$jsonraw = curl_exec($ch);
diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php
index 1acd0bc5..c1b15a73 100644
--- a/application/views/interface_assets/footer.php
+++ b/application/views/interface_assets/footer.php
@@ -937,7 +937,7 @@ $(document).on('keypress',function(e) {
if ($this->optionslib->get_option('dxcache_url') != ''){ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | / |
+ |
+ |
+ DXCC |
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/js/sections/bandmap_list.js b/assets/js/sections/bandmap_list.js
new file mode 100644
index 00000000..91717e78
--- /dev/null
+++ b/assets/js/sections/bandmap_list.js
@@ -0,0 +1,100 @@
+$(function() {
+
+ function SortByQrg(a, b){
+ var a = a.frequency;
+ var b = b.frequency;
+ return ((a< b) ? -1 : ((a> b) ? 1 : 0));
+ }
+
+
+ function fill_list(band,maxAgeMinutes) {
+ let dxurl = dxcluster_provider + "/spots/" + band + "/" +maxAgeMinutes;
+ $.ajax({
+ url: dxurl,
+ cache: false,
+ dataType: "json"
+ }).done(function(dxspots) {
+ var table = $('.spottable').DataTable();
+ table.clear();
+ table.page.len(50);
+ table.order([1, 'asc']);
+ if (dxspots.length>0) {
+ dxspots.sort(SortByQrg);
+ dxspots.forEach((single) => {
+ var data = [[ single.when, single.frequency, single.spotted, single.dxcc_spotted.call ]];
+ table.rows.add(data).draw();
+ // add to datatable single
+ });
+ }
+ });
+ }
+
+ fill_list($('#band option:selected').val(),30);
+ setInterval(function () { fill_list($('#band option:selected').val(),30); },60000);
+ $("#band").on("change",function() {
+ fill_list($('#band option:selected').val(),30);
+ });
+
+
+ var updateFromCAT = function() {
+ if($('select.radios option:selected').val() != '0') {
+ radioID = $('select.radios option:selected').val();
+ $.getJSON( "radio/json/" + radioID, function( data ) {
+
+ if (data.error) {
+ if (data.error == 'not_logged_in') {
+ $(".radio_cat_state" ).remove();
+ if($('.radio_login_error').length == 0) {
+ $('.messages').prepend(' You\'re not logged it. Please
login ');
+ }
+ }
+ // Put future Errorhandling here
+ } else {
+ if($('.radio_login_error').length != 0) {
+ $(".radio_login_error" ).remove();
+ }
+ var band = frequencyToBand(data.frequency);
+
+ if (band !== $("#band").val()) {
+ $("#band").val(band);
+ $("#band").trigger("change");
+ }
+
+ var minutes = Math.floor(cat_timeout_interval / 60);
+
+ if(data.updated_minutes_ago > minutes) {
+ $(".radio_cat_state" ).remove();
+ if($('.radio_timeout_error').length == 0) {
+ $('.messages').prepend(' Radio connection timed-out: ' + $('select.radios option:selected').text() + ' data is ' + data.updated_minutes_ago + ' minutes old.
');
+ } else {
+ $('.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 = 'TX: '+(Math.round(parseInt(data.frequency)/100)/10000).toFixed(4)+' MHz';
+ if(data.mode != null) {
+ text = text+''+data.mode;
+ }
+ if(data.power != null && data.power != 0) {
+ text = text+''+data.power+' W';
+ }
+ if (! $('#radio_cat_state').length) {
+ $('.messages').prepend('');
+ } else {
+ $('#radio_cat_state').html(text);
+ }
+ }
+ }
+ });
+ }
+};
+
+// Update frequency every three second
+// setInterval(updateFromCAT, 3000);
+
+// If a radios selected from drop down select radio update.
+$('.radios').change(updateFromCAT);
+
+});
+
+
From c27f97defa7d81a16f66bb3a9c002e1036f27dae Mon Sep 17 00:00:00 2001
From: int2001
Date: Sun, 23 Jul 2023 06:12:11 +0000
Subject: [PATCH 24/39] Added highlighting on already worked and time-things
---
application/controllers/Bandmap.php | 31 +++++++++++++++++++++++---
application/models/Dxcluster_model.php | 8 ++++++-
application/views/bandmap/list.php | 3 ++-
assets/js/sections/bandmap_list.js | 9 +++++++-
4 files changed, 45 insertions(+), 6 deletions(-)
diff --git a/application/controllers/Bandmap.php b/application/controllers/Bandmap.php
index e40363c8..e98d7470 100644
--- a/application/controllers/Bandmap.php
+++ b/application/controllers/Bandmap.php
@@ -33,14 +33,39 @@ class Bandmap extends CI_Controller {
$data['radios'] = $this->cat->radios();
$data['bands'] = $this->bands->get_user_bands_for_qso_entry();
- $footerData = [];
+ $footerData = [];
$footerData['scripts'] = [
- 'assets/js/sections/bandmap_list.js',
+ 'assets/js/moment.min.js',
+ 'assets/js/datetime-moment.js',
+ 'assets/js/sections/bandmap_list.js'
];
+ $CI =& get_instance();
+ // Get Date format
+ if($CI->session->userdata('user_date_format')) {
+ // If Logged in and session exists
+ $pageData['custom_date_format'] = $CI->session->userdata('user_date_format');
+ } else {
+ // Get Default date format from /config/cloudlog.php
+ $pageData['custom_date_format'] = $CI->config->item('qso_date_format');
+ }
+
+ switch ($pageData['custom_date_format']) {
+ case "d/m/y": $pageData['custom_date_format'] = 'DD/MM/YY'; break;
+ case "d/m/Y": $pageData['custom_date_format'] = 'DD/MM/YYYY'; break;
+ case "m/d/y": $pageData['custom_date_format'] = 'MM/DD/YY'; break;
+ case "m/d/Y": $pageData['custom_date_format'] = 'MM/DD/YYYY'; break;
+ case "d.m.Y": $pageData['custom_date_format'] = 'DD.MM.YYYY'; break;
+ case "y/m/d": $pageData['custom_date_format'] = 'YY/MM/DD'; break;
+ case "Y-m-d": $pageData['custom_date_format'] = 'YYYY-MM-DD'; break;
+ case "M d, Y": $pageData['custom_date_format'] = 'MMM DD, YYYY'; break;
+ case "M d, y": $pageData['custom_date_format'] = 'MMM DD, YY'; break;
+ default: $pageData['custom_date_format'] = 'DD/MM/YYYY';
+ }
+
$data['page_title'] = "DXCluster";
$this->load->view('interface_assets/header', $data);
- $this->load->view('bandmap/list');
+ $this->load->view('bandmap/list',$pageData);
$this->load->view('interface_assets/footer', $footerData);
}
}
diff --git a/application/models/Dxcluster_model.php b/application/models/Dxcluster_model.php
index fcb61472..fc9b4551 100644
--- a/application/models/Dxcluster_model.php
+++ b/application/models/Dxcluster_model.php
@@ -7,6 +7,12 @@ class Dxcluster_model extends CI_Model {
$this->load->helper(array('psr4_autoloader'));
$CI =& get_instance();
if ( ($this->optionslib->get_option('dxcache_url') != '') ) {
+ if($CI->session->userdata('user_date_format')) {
+ $custom_date_format = $CI->session->userdata('user_date_format');
+ } else {
+ $custom_date_format = $CI->config->item('qso_date_format');
+ }
+
$dxcache_url = $this->optionslib->get_option('dxcache_url').'/spots/'.$band;
$CI->load->model('logbooks_model');
$CI->load->model('logbook_model');
@@ -39,7 +45,7 @@ class Dxcluster_model extends CI_Model {
$minutes += $spotage->h * 60;
$minutes += $spotage->i;
$singlespot->age=$minutes;
-
+ $singlespot->when_pretty=date($custom_date_format . " H:i", strtotime($singlespot->when));
if ($minutes<=$maxage) {
if (!(property_exists($singlespot,'dxcc_spotted'))) { // Check if we already have dxcc of spotted
diff --git a/application/views/bandmap/list.php b/application/views/bandmap/list.php
index 4f7a55c4..e742863a 100644
--- a/application/views/bandmap/list.php
+++ b/application/views/bandmap/list.php
@@ -1,6 +1,7 @@
@@ -37,7 +38,7 @@
-
+
| / |
diff --git a/assets/js/sections/bandmap_list.js b/assets/js/sections/bandmap_list.js
index 91717e78..2129fbe5 100644
--- a/assets/js/sections/bandmap_list.js
+++ b/assets/js/sections/bandmap_list.js
@@ -21,7 +21,13 @@ $(function() {
if (dxspots.length>0) {
dxspots.sort(SortByQrg);
dxspots.forEach((single) => {
- var data = [[ single.when, single.frequency, single.spotted, single.dxcc_spotted.call ]];
+ // var data = [[ single.when_pretty, single.frequency, single.spotted, single.dxcc_spotted.call ]];
+ var data=[];
+ data[0]=[];
+ data[0].push(single.when_pretty);
+ data[0].push(single.frequency);
+ data[0].push((single.worked_call ?'' : '')+single.spotted+(single.worked_call ? '' : ''));
+ data[0].push(single.dxcc_spotted.entity);
table.rows.add(data).draw();
// add to datatable single
});
@@ -89,6 +95,7 @@ $(function() {
}
};
+$.fn.dataTable.moment(custom_date_format + ' HH:mm');
// Update frequency every three second
// setInterval(updateFromCAT, 3000);
From 32073482b618c97dedcf1c23eaf40790ddf83789 Mon Sep 17 00:00:00 2001
From: int2001
Date: Sun, 23 Jul 2023 08:55:45 +0000
Subject: [PATCH 25/39] Highlighting when updated/fresh spot
---
application/controllers/Bandmap.php | 2 +-
application/views/bandmap/list.php | 9 +++++++++
assets/js/sections/bandmap_list.js | 29 ++++++++++++++++++++++++-----
3 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/application/controllers/Bandmap.php b/application/controllers/Bandmap.php
index e98d7470..e600e365 100644
--- a/application/controllers/Bandmap.php
+++ b/application/controllers/Bandmap.php
@@ -36,7 +36,7 @@ class Bandmap extends CI_Controller {
$footerData = [];
$footerData['scripts'] = [
'assets/js/moment.min.js',
- 'assets/js/datetime-moment.js',
+ 'assets/js/datetime-moment.js',
'assets/js/sections/bandmap_list.js'
];
diff --git a/application/views/bandmap/list.php b/application/views/bandmap/list.php
index e742863a..a193a5ac 100644
--- a/application/views/bandmap/list.php
+++ b/application/views/bandmap/list.php
@@ -4,6 +4,15 @@
var custom_date_format = "";
+
+
diff --git a/assets/js/sections/bandmap_list.js b/assets/js/sections/bandmap_list.js
index 2129fbe5..75deb82f 100644
--- a/assets/js/sections/bandmap_list.js
+++ b/assets/js/sections/bandmap_list.js
@@ -15,29 +15,48 @@ $(function() {
dataType: "json"
}).done(function(dxspots) {
var table = $('.spottable').DataTable();
- table.clear();
table.page.len(50);
- table.order([1, 'asc']);
+ let oldtable=table.data();
+ table.clear();
if (dxspots.length>0) {
dxspots.sort(SortByQrg);
dxspots.forEach((single) => {
- // var data = [[ single.when_pretty, single.frequency, single.spotted, single.dxcc_spotted.call ]];
var data=[];
data[0]=[];
data[0].push(single.when_pretty);
data[0].push(single.frequency);
data[0].push((single.worked_call ?'
' : '')+single.spotted+(single.worked_call ? '' : ''));
data[0].push(single.dxcc_spotted.entity);
- table.rows.add(data).draw();
- // add to datatable single
+ if (oldtable.length > 0) {
+ let update=false;
+ oldtable.each( function (srow) {
+ if (JSON.stringify(srow) === JSON.stringify(data[0])) {
+ update=true;
+ }
+ });
+ if (!update) { // Sth. Fresh? So highlight
+ table.rows.add(data).draw().nodes().to$().addClass("fresh bg-info");
+ } else {
+ table.rows.add(data).draw();
+ }
+ } else {
+ table.rows.add(data).draw();
+ }
});
+ setTimeout(function(){ // Remove Highlights within 15sec
+ $(".fresh").removeClass("bg-info");
+ },1000);
}
});
}
+ $('.spottable').DataTable().order([1, 'asc']);
+ $('.spottable').DataTable().clear();
fill_list($('#band option:selected').val(),30);
setInterval(function () { fill_list($('#band option:selected').val(),30); },60000);
$("#band").on("change",function() {
+ $('.spottable').DataTable().order([1, 'asc']);
+ $('.spottable').DataTable().clear();
fill_list($('#band option:selected').val(),30);
});
From ba9d5be56235de5bd3d47db76b9b69ef2edd4666 Mon Sep 17 00:00:00 2001
From: int2001
Date: Sun, 23 Jul 2023 09:29:04 +0000
Subject: [PATCH 26/39] Added de-spot options as selector
---
application/models/Dxcluster_model.php | 4 ++--
application/views/bandmap/list.php | 11 +++++++++++
assets/js/sections/bandmap_list.js | 16 +++++++++++-----
3 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/application/models/Dxcluster_model.php b/application/models/Dxcluster_model.php
index fc9b4551..23108b58 100644
--- a/application/models/Dxcluster_model.php
+++ b/application/models/Dxcluster_model.php
@@ -56,8 +56,8 @@ class Dxcluster_model extends CI_Model {
$dxcc=$dxccObj->dxcc_lookup($singlespot->spotter,date('Ymd', time()));
$singlespot->dxcc_spotter=$dxcc;
}
- if ( ($de != '') && (property_exists($singlespot->dxcc_spotter,'cont')) ){ // If we have a "de continent" and a filter-wish filter on that
- if ($de == $singlespot->dxcc_spotter->cont) {
+ if ( ($de != '') && ($de != 'Any') && (property_exists($singlespot->dxcc_spotter,'cont')) ){ // If we have a "de continent" and a filter-wish filter on that
+ if (strtolower($de) == strtolower($singlespot->dxcc_spotter->cont)) {
$singlespot->worked_call = ($this->logbook_model->check_if_callsign_worked_in_logbook($singlespot->spotted, $logbooks_locations_array, $singlespot->band) == 1);
array_push($spotsout,$singlespot);
}
diff --git a/application/views/bandmap/list.php b/application/views/bandmap/list.php
index a193a5ac..8abd3271 100644
--- a/application/views/bandmap/list.php
+++ b/application/views/bandmap/list.php
@@ -27,6 +27,17 @@
+
+
From 21773cb39ead34de9e735e0f7338bb1dbe8157d3 Mon Sep 17 00:00:00 2001
From: int2001
Date: Sun, 23 Jul 2023 12:08:15 +0000
Subject: [PATCH 29/39] Changed Link to deeplink
---
application/views/interface_assets/header.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php
index cd0b2449..ad7ab2e1 100644
--- a/application/views/interface_assets/header.php
+++ b/application/views/interface_assets/header.php
@@ -82,7 +82,7 @@
optionslib->get_option('dxcache_url') != '') { ?>
-
+
From 7f8f7f7ff90c179ce0b2aa0e3d277327bb9cc9e2 Mon Sep 17 00:00:00 2001
From: int2001
Date: Sun, 23 Jul 2023 13:23:42 +0000
Subject: [PATCH 30/39] Fixed small bug, base_url was missing also at dxmap
---
assets/js/sections/bandmap.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/assets/js/sections/bandmap.js b/assets/js/sections/bandmap.js
index dfd89c07..4ba10be4 100644
--- a/assets/js/sections/bandmap.js
+++ b/assets/js/sections/bandmap.js
@@ -173,7 +173,7 @@ $(function() {
var updateFromCAT = function() {
if($('select.radios option:selected').val() != '0') {
radioID = $('select.radios option:selected').val();
- $.getJSON( "radio/json/" + radioID, function( data ) {
+ $.getJSON( base_url + "radio/json/" + radioID, function( data ) {
if (data.error) {
if (data.error == 'not_logged_in') {
From 4919da7909766758595ad9418fb534accab7e842 Mon Sep 17 00:00:00 2001
From: int2001
Date: Sun, 23 Jul 2023 16:38:26 +0000
Subject: [PATCH 31/39] Collapse menus
---
application/views/bandmap/index.php | 2 +-
application/views/bandmap/list.php | 3 +++
assets/js/sections/bandmap.js | 11 +++++++++++
assets/js/sections/bandmap_list.js | 11 +++++++++++
4 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/application/views/bandmap/index.php b/application/views/bandmap/index.php
index f15b9050..0b5897f7 100644
--- a/application/views/bandmap/index.php
+++ b/application/views/bandmap/index.php
@@ -6,7 +6,7 @@
-
+
diff --git a/application/views/bandmap/list.php b/application/views/bandmap/list.php
index 86048ff7..fed6bc5c 100644
--- a/application/views/bandmap/list.php
+++ b/application/views/bandmap/list.php
@@ -16,8 +16,10 @@
diff --git a/assets/js/sections/bandmap_list.js b/assets/js/sections/bandmap_list.js
index f9ee2d69..c2a5227c 100644
--- a/assets/js/sections/bandmap_list.js
+++ b/assets/js/sections/bandmap_list.js
@@ -24,9 +24,10 @@ $(function() {
var data=[];
data[0]=[];
data[0].push(single.when_pretty);
- data[0].push(single.frequency);
+ data[0].push(single.frequency + " kHz");
data[0].push((single.worked_call ?'' : '')+single.spotted+(single.worked_call ? '' : ''));
data[0].push(single.dxcc_spotted.entity);
+ data[0].push(single.spotter);
if (oldtable.length > 0) {
let update=false;
oldtable.each( function (srow) {
@@ -54,7 +55,7 @@ $(function() {
var table=$('.spottable').DataTable();
table.rows().every(function() {
var d=this.data();
- var distance=Math.abs(parseInt(d[1])-qrg);
+ var distance=Math.abs(parseInt(d[1].substring(0,d[1].length-4))-qrg);
if (distance<=20) {
distance++;
alpha=(.5/distance);
@@ -133,7 +134,7 @@ $(function() {
} else {
$(".radio_timeout_error" ).remove();
text = 'TX: '+(Math.round(parseInt(data.frequency)/100)/10000).toFixed(4)+' MHz';
- highlight_current_qrg((parseInt(data.frequency)/1000));
+ highlight_current_qrg((parseInt(data.frequency))/1000);
if(data.mode != null) {
text = text+''+data.mode;
}
From aca4a4f40998a9e82b4c87c979e1542c942f50e2 Mon Sep 17 00:00:00 2001
From: int2001
Date: Sun, 23 Jul 2023 18:48:03 +0000
Subject: [PATCH 35/39] Added (blind) functions to toggle the spotter
---
assets/js/sections/bandmap_list.js | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/assets/js/sections/bandmap_list.js b/assets/js/sections/bandmap_list.js
index c2a5227c..78f1733a 100644
--- a/assets/js/sections/bandmap_list.js
+++ b/assets/js/sections/bandmap_list.js
@@ -82,6 +82,14 @@ $(function() {
fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),30);
});
+ $("#spottertoggle").on("click", function() {
+ if ($('.spottable').DataTable().column(4).visible()) {
+ $('.spottable').DataTable().column(4).visible(false);
+ } else {
+ $('.spottable').DataTable().column(4).visible(true);
+ }
+ });
+
$("#menutoggle").on("click", function() {
if ($('.navbar').is(":hidden")) {
$('.navbar').show();
From 2df9d80b2ae0dd3dffb0e6ab85f1bdb3daa30524 Mon Sep 17 00:00:00 2001
From: int2001
Date: Mon, 24 Jul 2023 08:33:04 +0000
Subject: [PATCH 36/39] Renamaed DXMap and DXList to BandMap and BandList
---
application/views/bandmap/index.php | 4 ++--
application/views/bandmap/list.php | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/application/views/bandmap/index.php b/application/views/bandmap/index.php
index fcdedfce..968fccf2 100644
--- a/application/views/bandmap/index.php
+++ b/application/views/bandmap/index.php
@@ -11,10 +11,10 @@
diff --git a/application/views/bandmap/list.php b/application/views/bandmap/list.php
index ab192bc2..e1249275 100644
--- a/application/views/bandmap/list.php
+++ b/application/views/bandmap/list.php
@@ -23,10 +23,10 @@
From 7f15a94c6b1ad3683d957f6371b86f3a5d3bc103 Mon Sep 17 00:00:00 2001
From: int2001
Date: Mon, 24 Jul 2023 08:44:42 +0000
Subject: [PATCH 37/39] variable typo removed
---
application/controllers/Options.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/application/controllers/Options.php b/application/controllers/Options.php
index 55e7551a..6ab72ab9 100644
--- a/application/controllers/Options.php
+++ b/application/controllers/Options.php
@@ -172,7 +172,7 @@ class Options extends CI_Controller {
$this->session->set_flashdata('success', $this->lang->line('options_dxcluster_decont_changed_to').$this->input->post('dxcluster_decont'));
}
- $dxcluster_url_update = $this->optionslib->update('dxcluster_maxage', $this->input->post('dxcluster_maxage'), 'yes');
+ $dxcluster_maxage_update = $this->optionslib->update('dxcluster_maxage', $this->input->post('dxcluster_maxage'), 'yes');
if($dxcluster_maxage_update == TRUE) {
$this->session->set_flashdata('success', $this->lang->line('options_dxcluster_maxage_changed_to').$this->input->post('dxcluster_maxage'));
}
From 5edab2e44312dffab89f42981e01d1659f4c0b6e Mon Sep 17 00:00:00 2001
From: int2001
Date: Mon, 24 Jul 2023 09:57:03 +0000
Subject: [PATCH 38/39] Take care of maxage for map/list
---
application/views/bandmap/index.php | 1 +
application/views/bandmap/list.php | 1 +
assets/js/sections/bandmap.js | 8 ++++----
assets/js/sections/bandmap_list.js | 8 ++++----
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/application/views/bandmap/index.php b/application/views/bandmap/index.php
index 968fccf2..f5c353b7 100644
--- a/application/views/bandmap/index.php
+++ b/application/views/bandmap/index.php
@@ -1,5 +1,6 @@
diff --git a/application/views/bandmap/list.php b/application/views/bandmap/list.php
index e1249275..e6ba866c 100644
--- a/application/views/bandmap/list.php
+++ b/application/views/bandmap/list.php
@@ -1,6 +1,7 @@
diff --git a/assets/js/sections/bandmap.js b/assets/js/sections/bandmap.js
index e6df82f4..368135aa 100644
--- a/assets/js/sections/bandmap.js
+++ b/assets/js/sections/bandmap.js
@@ -179,14 +179,14 @@ $(function() {
}
});
- set_chart($('#band option:selected').val(), $('#decontSelect option:selected').val(), 30);
- setInterval(function () { update_chart($('#band option:selected').val(),30); },60000);
+ set_chart($('#band option:selected').val(), $('#decontSelect option:selected').val(), dxcluster_maxage);
+ setInterval(function () { update_chart($('#band option:selected').val(),dxcluster_maxage); },60000);
$("#band").on("change",function() {
- set_chart($('#band option:selected').val(), $('#decontSelect option:selected').val(), 30);
+ set_chart($('#band option:selected').val(), $('#decontSelect option:selected').val(), dxcluster_maxage);
});
$("#decontSelect").on("change",function() {
- set_chart($('#band option:selected').val(), $('#decontSelect option:selected').val(), 30);
+ set_chart($('#band option:selected').val(), $('#decontSelect option:selected').val(), dxcluster_maxage);
});
});
diff --git a/assets/js/sections/bandmap_list.js b/assets/js/sections/bandmap_list.js
index 78f1733a..b326e3de 100644
--- a/assets/js/sections/bandmap_list.js
+++ b/assets/js/sections/bandmap_list.js
@@ -68,18 +68,18 @@ $(function() {
$('.spottable').DataTable().order([1, 'asc']);
$('.spottable').DataTable().clear();
- fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),30);
- setInterval(function () { fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),30); },60000);
+ fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),dxcluster_maxage);
+ setInterval(function () { fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),dxcluster_maxage); },60000);
$("#decontSelect").on("change",function() {
$('.spottable').DataTable().clear();
- fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),30);
+ fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),dxcluster_maxage);
});
$("#band").on("change",function() {
$('.spottable').DataTable().order([1, 'asc']);
$('.spottable').DataTable().clear();
- fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),30);
+ fill_list($('#band option:selected').val(), $('#decontSelect option:selected').val(),dxcluster_maxage);
});
$("#spottertoggle").on("click", function() {
From 3b4138990c0f4cd7a7bc69d7b973ca6fa1b620b5 Mon Sep 17 00:00:00 2001
From: int2001
Date: Tue, 25 Jul 2023 05:42:02 +0000
Subject: [PATCH 39/39] Don't rerender list/map if band is not populated
---
assets/js/sections/bandmap.js | 4 ++
assets/js/sections/bandmap_list.js | 85 ++++++++++++++++--------------
2 files changed, 49 insertions(+), 40 deletions(-)
diff --git a/assets/js/sections/bandmap.js b/assets/js/sections/bandmap.js
index 368135aa..096c11b7 100644
--- a/assets/js/sections/bandmap.js
+++ b/assets/js/sections/bandmap.js
@@ -123,6 +123,7 @@ $(function() {
}
function update_chart(band,maxAgeMinutes) {
+ if ((band != '') && (band !== undefined)) {
let dxurl = dxcluster_provider + "/spots/" + band + "/" +maxAgeMinutes;
$.ajax({
url: dxurl,
@@ -141,10 +142,12 @@ $(function() {
bandMapChart.series[0].setData(spots4chart);
bandMapChart.redraw();
});
+ }
}
function set_chart(band, de, maxAgeMinutes) {
+ if ((band != '') && (band !== undefined)) {
let dxurl = dxcluster_provider + "/spots/" + band + "/" +maxAgeMinutes + "/" + de;
$.ajax({
url: dxurl,
@@ -161,6 +164,7 @@ $(function() {
}
bandMapChart=render_chart(band,spots4chart);
});
+ }
}
$("#menutoggle").on("click", function() {
diff --git a/assets/js/sections/bandmap_list.js b/assets/js/sections/bandmap_list.js
index b326e3de..adc1ba30 100644
--- a/assets/js/sections/bandmap_list.js
+++ b/assets/js/sections/bandmap_list.js
@@ -8,47 +8,52 @@ $(function() {
function fill_list(band,de,maxAgeMinutes) {
- let dxurl = dxcluster_provider + "/spots/" + band + "/" +maxAgeMinutes + "/" + de;
- $.ajax({
- url: dxurl,
- cache: false,
- dataType: "json"
- }).done(function(dxspots) {
- var table = $('.spottable').DataTable();
- table.page.len(50);
- let oldtable=table.data();
- table.clear();
- if (dxspots.length>0) {
- dxspots.sort(SortByQrg);
- dxspots.forEach((single) => {
- var data=[];
- data[0]=[];
- data[0].push(single.when_pretty);
- data[0].push(single.frequency + " kHz");
- data[0].push((single.worked_call ?'' : '')+single.spotted+(single.worked_call ? '' : ''));
- data[0].push(single.dxcc_spotted.entity);
- data[0].push(single.spotter);
- if (oldtable.length > 0) {
- let update=false;
- oldtable.each( function (srow) {
- if (JSON.stringify(srow) === JSON.stringify(data[0])) {
- update=true;
- }
- });
- if (!update) { // Sth. Fresh? So highlight
- table.rows.add(data).draw().nodes().to$().addClass("fresh bg-info");
- } else {
- table.rows.add(data).draw();
+ var table = $('.spottable').DataTable();
+ if ((band != '') && (band !== undefined)) {
+ let dxurl = dxcluster_provider + "/spots/" + band + "/" +maxAgeMinutes + "/" + de;
+ $.ajax({
+ url: dxurl,
+ cache: false,
+ dataType: "json"
+ }).done(function(dxspots) {
+ table.page.len(50);
+ let oldtable=table.data();
+ table.clear();
+ if (dxspots.length>0) {
+ dxspots.sort(SortByQrg);
+ dxspots.forEach((single) => {
+ var data=[];
+ data[0]=[];
+ data[0].push(single.when_pretty);
+ data[0].push(single.frequency + " kHz");
+ data[0].push((single.worked_call ?'' : '')+single.spotted+(single.worked_call ? '' : ''));
+ data[0].push(single.dxcc_spotted.entity);
+ data[0].push(single.spotter);
+ if (oldtable.length > 0) {
+ let update=false;
+ oldtable.each( function (srow) {
+ if (JSON.stringify(srow) === JSON.stringify(data[0])) {
+ update=true;
+ }
+ });
+ if (!update) { // Sth. Fresh? So highlight
+ table.rows.add(data).draw().nodes().to$().addClass("fresh bg-info");
+ } else {
+ table.rows.add(data).draw();
+ }
+ } else {
+ table.rows.add(data).draw();
}
- } else {
- table.rows.add(data).draw();
- }
- });
- setTimeout(function(){ // Remove Highlights within 15sec
- $(".fresh").removeClass("bg-info");
- },1000);
- }
- });
+ });
+ setTimeout(function(){ // Remove Highlights within 15sec
+ $(".fresh").removeClass("bg-info");
+ },1000);
+ }
+ });
+ } else {
+ table.clear();
+ table.draw();
+ }
}
function highlight_current_qrg(qrg) {