mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-04-29 18:25:58 +00:00
Compare commits
2 Commits
7de3cdc49c
...
8257ec492d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8257ec492d | ||
|
|
02f564b515 |
@@ -200,6 +200,10 @@ class Spot:
|
||||
if self.de_dxcc_id and not self.de_flag:
|
||||
self.de_flag = lookup_helper.get_flag_for_dxcc(self.de_dxcc_id)
|
||||
|
||||
# Remove NaNs in frequency
|
||||
if freq and freq == float("nan"):
|
||||
freq = None
|
||||
|
||||
# Band from frequency
|
||||
if self.freq and not self.band:
|
||||
band = infer_band_from_freq(self.freq)
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<p>This software is dedicated to the memory of Tom G1PJB, SK, a friend and colleague who sadly passed away around the time I started writing it in Autumn 2025. I was looking forward to showing it to you when it was done.</p>
|
||||
</div>
|
||||
|
||||
<script src="/js/common.js?v=1774778476"></script>
|
||||
<script src="/js/common.js?v=1774894144"></script>
|
||||
<script>$(document).ready(function() { $("#nav-link-about").addClass("active"); }); <!-- highlight active page in nav --></script>
|
||||
|
||||
{% end %}
|
||||
@@ -69,8 +69,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="/js/common.js?v=1774778476"></script>
|
||||
<script src="/js/add-spot.js?v=1774778476"></script>
|
||||
<script src="/js/common.js?v=1774894144"></script>
|
||||
<script src="/js/add-spot.js?v=1774894144"></script>
|
||||
<script>$(document).ready(function() { $("#nav-link-add-spot").addClass("active"); }); <!-- highlight active page in nav --></script>
|
||||
|
||||
{% end %}
|
||||
@@ -51,13 +51,13 @@
|
||||
</div>
|
||||
|
||||
<div id="table-container">
|
||||
<table id="table" class="table"><thead><tr class="table-primary"></tr></thead><tbody></tbody></table>
|
||||
<table id="table" class="table"><thead><tr></tr></thead><tbody></tbody></table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="/js/common.js?v=1774778476"></script>
|
||||
<script src="/js/alerts.js?v=1774778476"></script>
|
||||
<script src="/js/common.js?v=1774894144"></script>
|
||||
<script src="/js/alerts.js?v=1774894144"></script>
|
||||
<script>$(document).ready(function() { $("#nav-link-alerts").addClass("active"); }); <!-- highlight active page in nav --></script>
|
||||
|
||||
{% end %}
|
||||
@@ -62,9 +62,9 @@
|
||||
<script>
|
||||
let spotProvidersEnabledByDefault = {% raw json_encode(web_ui_options["spot-providers-enabled-by-default"]) %};
|
||||
</script>
|
||||
<script src="/js/common.js?v=1774778476"></script>
|
||||
<script src="/js/spotsbandsandmap.js?v=1774778476"></script>
|
||||
<script src="/js/bands.js?v=1774778476"></script>
|
||||
<script src="/js/common.js?v=1774894144"></script>
|
||||
<script src="/js/spotsbandsandmap.js?v=1774894144"></script>
|
||||
<script src="/js/bands.js?v=1774894144"></script>
|
||||
<script>$(document).ready(function() { $("#nav-link-bands").addClass("active"); }); <!-- highlight active page in nav --></script>
|
||||
|
||||
{% end %}
|
||||
@@ -46,10 +46,10 @@
|
||||
crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/tinycolor2@1.6.0/cjs/tinycolor.min.js"></script>
|
||||
|
||||
<script src="https://misc.ianrenton.com/jsutils/utils.js?v=1774778476"></script>
|
||||
<script src="https://misc.ianrenton.com/jsutils/storage.js?v=1774778476"></script>
|
||||
<script src="https://misc.ianrenton.com/jsutils/ui-ham.js?v=1774778476"></script>
|
||||
<script src="https://misc.ianrenton.com/jsutils/geo.js?v=1774778476"></script>
|
||||
<script src="https://misc.ianrenton.com/jsutils/utils.js?v=1774894144"></script>
|
||||
<script src="https://misc.ianrenton.com/jsutils/storage.js?v=1774894144"></script>
|
||||
<script src="https://misc.ianrenton.com/jsutils/ui-ham.js?v=1774894144"></script>
|
||||
<script src="https://misc.ianrenton.com/jsutils/geo.js?v=1774894144"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -189,8 +189,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/js/common.js?v=1774778476"></script>
|
||||
<script src="/js/conditions.js?v=1774778476"></script>
|
||||
<script src="/js/common.js?v=1774894144"></script>
|
||||
<script src="/js/conditions.js?v=1774894144"></script>
|
||||
<script>$(document).ready(function() { $("#nav-link-conditions").addClass("active"); }); <!-- highlight active page in nav --></script>
|
||||
|
||||
{% end %}
|
||||
@@ -70,9 +70,9 @@
|
||||
<script>
|
||||
let spotProvidersEnabledByDefault = {% raw json_encode(web_ui_options["spot-providers-enabled-by-default"]) %};
|
||||
</script>
|
||||
<script src="/js/common.js?v=1774778476"></script>
|
||||
<script src="/js/spotsbandsandmap.js?v=1774778476"></script>
|
||||
<script src="/js/map.js?v=1774778476"></script>
|
||||
<script src="/js/common.js?v=1774894144"></script>
|
||||
<script src="/js/spotsbandsandmap.js?v=1774894144"></script>
|
||||
<script src="/js/map.js?v=1774894144"></script>
|
||||
<script>$(document).ready(function() { $("#nav-link-map").addClass("active"); }); <!-- highlight active page in nav --></script>
|
||||
|
||||
{% end %}
|
||||
@@ -79,7 +79,7 @@
|
||||
</div>
|
||||
|
||||
<div id="table-container">
|
||||
<table id="table" class="table"><thead><tr class="table-primary"></tr></thead><tbody></tbody></table>
|
||||
<table id="table" class="table"><thead><tr></tr></thead><tbody></tbody></table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -87,9 +87,9 @@
|
||||
<script>
|
||||
let spotProvidersEnabledByDefault = {% raw json_encode(web_ui_options["spot-providers-enabled-by-default"]) %};
|
||||
</script>
|
||||
<script src="/js/common.js?v=1774778476"></script>
|
||||
<script src="/js/spotsbandsandmap.js?v=1774778476"></script>
|
||||
<script src="/js/spots.js?v=1774778476"></script>
|
||||
<script src="/js/common.js?v=1774894144"></script>
|
||||
<script src="/js/spotsbandsandmap.js?v=1774894144"></script>
|
||||
<script src="/js/spots.js?v=1774894144"></script>
|
||||
<script>$(document).ready(function() { $("#nav-link-spots").addClass("active"); }); <!-- highlight active page in nav --></script>
|
||||
|
||||
{% end %}
|
||||
@@ -59,8 +59,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/js/common.js?v=1774778476"></script>
|
||||
<script src="/js/status.js?v=1774778476"></script>
|
||||
<script src="/js/common.js?v=1774894144"></script>
|
||||
<script src="/js/status.js?v=1774894144"></script>
|
||||
<script>
|
||||
$(document).ready(function() { $("#nav-link-status").addClass("active"); }); <!-- highlight active page in nav -->
|
||||
</script>
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-auto me-auto">
|
||||
Conditions
|
||||
</div>
|
||||
<div class="col-auto d-inline-flex">
|
||||
<button id="close-conditions-button" type="button" class="btn-close btn-close-white" aria-label="Close" onclick="closeConditionsPanel();"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -4,7 +4,7 @@
|
||||
Display
|
||||
</div>
|
||||
<div class="col-auto d-inline-flex">
|
||||
<button id="close-display-button" type="button" class="btn-close btn-close-white" aria-label="Close" onclick="closeDisplayPanel();"></button>
|
||||
<button id="close-display-button" type="button" class="btn-close btn-close" aria-label="Close" onclick="closeDisplayPanel();"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -4,7 +4,7 @@
|
||||
Filters
|
||||
</div>
|
||||
<div class="col-auto d-inline-flex">
|
||||
<button id="close-filters-button" type="button" class="btn-close btn-close-white" aria-label="Close" onclick="closeFiltersPanel();"></button>
|
||||
<button id="close-filters-button" type="button" class="btn-close btn-close" aria-label="Close" onclick="closeFiltersPanel();"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -193,25 +193,18 @@ tr.new td {
|
||||
}
|
||||
}
|
||||
|
||||
/* Fudge apply our own "dark primary" and "dark danger" backgrounds as Bootstrap doesn't do this itself */
|
||||
[data-bs-theme=dark] tr.table-primary {
|
||||
--bs-table-bg: #053680;
|
||||
--bs-table-border-color: #021b42;
|
||||
--bs-table-color: white;
|
||||
}
|
||||
[data-bs-theme=dark] tr.table-danger {
|
||||
--bs-table-bg: #74272e;
|
||||
--bs-table-border-color: #530208;
|
||||
--bs-table-color: white;
|
||||
}
|
||||
|
||||
|
||||
/* TABLE */
|
||||
#table-container {
|
||||
border-radius: 3px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid var(--bs-primary-border-subtle);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#table-container table{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
|
||||
/* MAP */
|
||||
div#map {
|
||||
|
||||
@@ -54,25 +54,25 @@ function updateTable() {
|
||||
let table = $("#table");
|
||||
table.find('thead tr').empty();
|
||||
if (showStartTime) {
|
||||
table.find('thead tr').append(`<th>${useLocalTime ? "Start (Local)" : "Start UTC"}</th>`);
|
||||
table.find('thead tr').append(`<th class="bg-primary-subtle">${useLocalTime ? "Start (Local)" : "Start UTC"}</th>`);
|
||||
}
|
||||
if (showEndTime) {
|
||||
table.find('thead tr').append(`<th>${useLocalTime ? "End (Local)" : "End UTC"}</th>`);
|
||||
table.find('thead tr').append(`<th class="bg-primary-subtle">${useLocalTime ? "End (Local)" : "End UTC"}</th>`);
|
||||
}
|
||||
if (showDX) {
|
||||
table.find('thead tr').append(`<th>DX</th>`);
|
||||
table.find('thead tr').append(`<th class="bg-primary-subtle">DX</th>`);
|
||||
}
|
||||
if (showFreqsModes) {
|
||||
table.find('thead tr').append(`<th class='hideonmobile'>Freq<span class='hideonmobile'>uencie</span>s & Modes</th>`);
|
||||
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Freq<span class='hideonmobile'>uencie</span>s & Modes</th>`);
|
||||
}
|
||||
if (showComment) {
|
||||
table.find('thead tr').append(`<th class='hideonmobile'>Comment</th>`);
|
||||
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Comment</th>`);
|
||||
}
|
||||
if (showSource) {
|
||||
table.find('thead tr').append(`<th class='hideonmobile'>Source</th>`);
|
||||
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Source</th>`);
|
||||
}
|
||||
if (showRef) {
|
||||
table.find('thead tr').append(`<th class='hideonmobile'>Ref.</th>`);
|
||||
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Ref.</th>`);
|
||||
}
|
||||
|
||||
table.find('tbody').empty();
|
||||
@@ -86,22 +86,22 @@ function updateTable() {
|
||||
later = alerts.filter(a => moment.unix(a["start_time"]).utc().subtract(24, 'hours').isSameOrAfter());
|
||||
|
||||
if (onNow.length > 0) {
|
||||
table.find('tbody').append('<tr class="table-primary"><td colspan="100" style="text-align:center;">On Now</td></tr>');
|
||||
table.find('tbody').append('<tr><td colspan="100" class="bg-primary-subtle" style="text-align:center;">On Now</td></tr>');
|
||||
addAlertRowsToTable(table.find('tbody'), onNow);
|
||||
}
|
||||
|
||||
if (next24h.length > 0) {
|
||||
table.find('tbody').append('<tr class="table-primary"><td colspan="100" style="text-align:center;">Starting within 24 hours</td></tr>');
|
||||
table.find('tbody').append('<tr><td colspan="100" class="bg-primary-subtle" style="text-align:center;">Starting within 24 hours</td></tr>');
|
||||
addAlertRowsToTable(table.find('tbody'), next24h);
|
||||
}
|
||||
|
||||
if (later.length > 0) {
|
||||
table.find('tbody').append('<tr class="table-primary"><td colspan="100" style="text-align:center;">Starting later </td></tr>');
|
||||
table.find('tbody').append('<tr><td colspan="100" class="bg-primary-subtle" style="text-align:center;">Starting later </td></tr>');
|
||||
addAlertRowsToTable(table.find('tbody'), later);
|
||||
}
|
||||
|
||||
if (onNow.length == 0 && next24h.length == 0 && later.length == 0) {
|
||||
table.find('tbody').append('<tr class="table-danger"><td colspan="100" style="text-align:center;">No alerts match your filters.</td></tr>');
|
||||
table.find('tbody').append('<tr class="bg-danger-subtle"><td colspan="100" style="text-align:center;">No alerts match your filters.</td></tr>');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ function loadSolarConditions() {
|
||||
|
||||
// HF
|
||||
|
||||
const hfConditionClass = { 'Good': 'table-success', 'Fair': 'table-warning', 'Poor': 'table-danger' };
|
||||
const hfConditionClass = { 'Good': 'bg-success-subtle', 'Fair': 'bg-warning-subtle', 'Poor': 'bg-danger-subtle' };
|
||||
|
||||
if (jsonData.hf_conditions) {
|
||||
Object.entries(jsonData.hf_conditions).forEach(function([key, condition]) {
|
||||
@@ -26,11 +26,11 @@ function loadSolarConditions() {
|
||||
cell.text(condition);
|
||||
let vhfClass;
|
||||
if (condition === 'Band Closed') {
|
||||
vhfClass = 'table-danger';
|
||||
vhfClass = 'bg-danger-subtle';
|
||||
} else if (condition.includes('High')) {
|
||||
vhfClass = 'table-warning';
|
||||
vhfClass = 'bg-warning-subtle';
|
||||
} else {
|
||||
vhfClass = 'table-success';
|
||||
vhfClass = 'bg-success-subtle';
|
||||
}
|
||||
cell.addClass(vhfClass);
|
||||
});
|
||||
@@ -130,8 +130,8 @@ function renderDxStats() {
|
||||
const range = max - min;
|
||||
cells.forEach(function({ cell, count }) {
|
||||
const t = range > 0 ? (count - min) / range : 0;
|
||||
const cls = t === 0 ? 'table-danger' : t < 0.05 ? 'table-warning' : 'table-success';
|
||||
cell.removeClass('table-danger table-warning table-success').addClass(cls);
|
||||
const cls = t === 0 ? 'bg-danger-subtle' : t < 0.05 ? 'bg-warning-subtle' : 'bg-success-subtle';
|
||||
cell.removeClass('bg-danger-subtle bg-warning-subtle bg-success-subtle').addClass(cls);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -111,39 +111,39 @@ function updateTable() {
|
||||
let table = $("#table");
|
||||
table.find('thead tr').empty();
|
||||
if (showTime) {
|
||||
table.find('thead tr').append(`<th>${useLocalTime ? "Local" : "UTC"}</th>`);
|
||||
table.find('thead tr').append(`<th class="bg-primary-subtle">${useLocalTime ? "Local" : "UTC"}</th>`);
|
||||
}
|
||||
if (showDX) {
|
||||
table.find('thead tr').append(`<th>DX</th>`);
|
||||
table.find('thead tr').append(`<th class="bg-primary-subtle">DX</th>`);
|
||||
}
|
||||
if (showFreq) {
|
||||
table.find('thead tr').append(`<th>Freq<span class='hideonmobile'>uency</span></th>`);
|
||||
table.find('thead tr').append(`<th class="bg-primary-subtle">Freq<span class='bg-primary-subtle hideonmobile'>uency</span></th>`);
|
||||
}
|
||||
if (showMode) {
|
||||
table.find('thead tr').append(`<th>Mode</th>`);
|
||||
table.find('thead tr').append(`<th class="bg-primary-subtle">Mode</th>`);
|
||||
}
|
||||
if (showComment) {
|
||||
table.find('thead tr').append(`<th class='hideonmobile'>Comment</th>`);
|
||||
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Comment</th>`);
|
||||
}
|
||||
if (showBearing) {
|
||||
table.find('thead tr').append(`<th class='hideonmobile'>Bearing</th>`);
|
||||
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Bearing</th>`);
|
||||
}
|
||||
if (showType) {
|
||||
table.find('thead tr').append(`<th class='hideonmobile'>Type</th>`);
|
||||
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Type</th>`);
|
||||
}
|
||||
if (showRef) {
|
||||
table.find('thead tr').append(`<th class='hideonmobile'>Ref.</th>`);
|
||||
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>Ref.</th>`);
|
||||
}
|
||||
if (showDE) {
|
||||
table.find('thead tr').append(`<th class='hideonmobile'>DE</th>`);
|
||||
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'>DE</th>`);
|
||||
}
|
||||
if (showWorkedCheckbox) {
|
||||
table.find('thead tr').append(`<th class='hideonmobile'></th>`);
|
||||
table.find('thead tr').append(`<th class='bg-primary-subtle hideonmobile'></th>`);
|
||||
}
|
||||
|
||||
table.find('tbody').empty();
|
||||
if (spots.length == 0) {
|
||||
table.find('tbody').append('<tr class="table-danger"><td colspan="100" style="text-align:center;">No spots match your filters.</td></tr>');
|
||||
table.find('tbody').append('<tr class="bg-danger-subtle"><td colspan="100" style="text-align:center;">No spots match your filters.</td></tr>');
|
||||
}
|
||||
|
||||
// We are regenerating the entire table not just adding a new row, so reset the row counter
|
||||
|
||||
Reference in New Issue
Block a user