mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Various stuff
This commit is contained in:
@@ -122,7 +122,7 @@ paths:
|
||||
- PSK
|
||||
- BPSK31
|
||||
- OLIVIA
|
||||
- name: mode_family
|
||||
- name: mode_type
|
||||
in: query
|
||||
description: "Limit the spots to only ones from one or more mode families. To select more than one mode family, supply a comma-separated list."
|
||||
required: false
|
||||
@@ -338,7 +338,7 @@ components:
|
||||
- BPSK31
|
||||
- OLIVIA
|
||||
example: SSB
|
||||
mode_family:
|
||||
mode_type:
|
||||
type: string
|
||||
description: Inferred mode "family".
|
||||
enum:
|
||||
@@ -346,6 +346,14 @@ components:
|
||||
- PHONE
|
||||
- DATA
|
||||
example: PHONE
|
||||
mode_source:
|
||||
type: string
|
||||
description: Where we got the mode from. If this was from the spot itself, it's likely quite accurate, but if we had to fall back to the bandplan, it might not be correct.
|
||||
enum:
|
||||
- SPOT
|
||||
- COMMENT
|
||||
- BANDPLAN
|
||||
- NONE
|
||||
freq:
|
||||
type: number
|
||||
description: Frequency, in kHz
|
||||
|
||||
@@ -2,17 +2,4 @@ div#table-container {
|
||||
width: 80%;
|
||||
margin: 0 auto;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
div#table-container table, div#table-container th, div#table-container td {
|
||||
border: 1px solid;
|
||||
border-collapse: collapse
|
||||
}
|
||||
|
||||
div#table-container th, div#table-container td {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
div#table-container th {
|
||||
background-color: dodgerblue;
|
||||
}
|
||||
@@ -1,18 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>Unnamed spot tool</title>
|
||||
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/moment@2.29.4/moment.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI"
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<h1>Unnamed spot tool</h1>
|
||||
<div id="filters">Some filters here</div>
|
||||
<div id="table-container"></div>
|
||||
<div class="container">
|
||||
<header class="d-flex flex-wrap justify-content-center py-3 mb-4 border-bottom">
|
||||
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-dark text-decoration-none">
|
||||
<span class="fs-4">Unnamed Spot Tool</span>
|
||||
</a>
|
||||
|
||||
<script src="js/code.js"></script>
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item"><a href="#" class="nav-link">About</a></li>
|
||||
<li class="nav-item"><a href="/apidocs" class="nav-link">API</a></li>
|
||||
<li class="nav-item"><a href="#" class="nav-link">Status</a></li>
|
||||
<li class="nav-item"><a href="#" class="nav-link">Filters</a></li>
|
||||
</ul>
|
||||
</header>
|
||||
</div>
|
||||
|
||||
<div id="table-container"></div>
|
||||
|
||||
<script src="js/code.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
$.getJSON('/api/spots', function(jsonData) {
|
||||
let headers = Object.keys(jsonData[0]);
|
||||
let table = $('<table>').append('<thead><tr></tr></thead><tbody></tbody>');
|
||||
let table = $('<table class="table table-striped table-hover">').append('<thead><tr class="table-primary"></tr></thead><tbody></tbody>');
|
||||
["Time", "DX", "Frequency", "Mode", "Comment", "Source", "DE"].forEach(header => table.find('thead tr').append(`<th>${header}</th>`));
|
||||
|
||||
jsonData.forEach(row => {
|
||||
let $tr = $('<tr>');
|
||||
$tr.append(`<td>${row["time"]}</td>`);
|
||||
$tr.append(`<td>${row["dx_call"]}</td>`);
|
||||
var time = moment(row["time"], moment.ISO_8601);
|
||||
var time_formatted = time.format("HH:mm")
|
||||
$tr.append(`<td>${time_formatted}</td>`);
|
||||
$tr.append(`<td>${row["dx_flag"]} ${row["dx_call"]}</td>`);
|
||||
$tr.append(`<td>${row["freq"]}</td>`);
|
||||
$tr.append(`<td>${row["mode"]}</td>`);
|
||||
$tr.append('<td>').append(escapeHtml(`${row["comment"]}`)).append('</td>');
|
||||
$tr.append('<td>' + escapeHtml(`${row["comment"]}`) + '</td>');
|
||||
$tr.append(`<td>${row["source"]}</td>`);
|
||||
$tr.append(`<td>${row["de_call"]}</td>`);
|
||||
$tr.append(`<td>${row["de_flag"]} ${row["de_call"]}</td>`);
|
||||
table.find('tbody').append($tr);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user