mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-12-16 00:53:39 +00:00
Update API to have a sensible grouping of sig_refs rather than separate arrays of sig_refs, sig_refs_names and sig_refs_urls
This commit is contained in:
@@ -60,9 +60,12 @@ paths:
|
||||
- GMA
|
||||
- HEMA
|
||||
- ParksNPeaks
|
||||
- ZLOTA
|
||||
- WOTA
|
||||
- Cluster
|
||||
- RBN
|
||||
- APRS-IS
|
||||
- UKPacketNet
|
||||
- name: sig
|
||||
in: query
|
||||
description: "Limit the spots to only ones from one or more Special Interest Groups provided as an argument. To select more than one SIG, supply a comma-separated list."
|
||||
@@ -279,9 +282,12 @@ paths:
|
||||
- GMA
|
||||
- HEMA
|
||||
- ParksNPeaks
|
||||
- ZLOTA
|
||||
- WOTA
|
||||
- Cluster
|
||||
- RBN
|
||||
- APRS-IS
|
||||
- UKPacketNet
|
||||
- name: sig
|
||||
in: query
|
||||
description: "Limit the alerts to only ones from one or more Special Interest Groups. To select more than one SIG, supply a comma-separated list."
|
||||
@@ -513,6 +519,22 @@ paths:
|
||||
|
||||
components:
|
||||
schemas:
|
||||
SIGRef:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: SIG reference ID.
|
||||
example: GB-0001
|
||||
name:
|
||||
type: string
|
||||
description: SIG reference name
|
||||
example: Null Country Park
|
||||
url:
|
||||
type: string
|
||||
description: SIG reference URL, which the user can look up for more information
|
||||
example: "https://pota.app/#/park/GB-0001"
|
||||
|
||||
Spot:
|
||||
type: object
|
||||
properties:
|
||||
@@ -752,21 +774,8 @@ components:
|
||||
sig_refs:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
$ref: '#/components/schemas/SIGRef'
|
||||
description: SIG references. We allow multiple here for e.g. n-fer activations, unlike ADIF SIG_INFO
|
||||
example: GB-0001
|
||||
sig_refs_names:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: SIG reference names
|
||||
example: Null Country Park
|
||||
sig_refs_urls:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: SIG reference URLs, which the user can look up for more information
|
||||
example: "https://pota.app/#/park/GB-0001"
|
||||
activation_score:
|
||||
type: integer
|
||||
description: Activation score. SOTA only
|
||||
@@ -798,9 +807,12 @@ components:
|
||||
- GMA
|
||||
- HEMA
|
||||
- ParksNPeaks
|
||||
- ZLOTA
|
||||
- WOTA
|
||||
- Cluster
|
||||
- RBN
|
||||
- APRS-IS
|
||||
- UKPacketNet
|
||||
example: POTA
|
||||
source_id:
|
||||
type: string
|
||||
@@ -915,15 +927,8 @@ components:
|
||||
sig_refs:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
$ref: '#/components/schemas/SIGRef'
|
||||
description: SIG references. We allow multiple here for e.g. n-fer activations, unlike ADIF SIG_INFO
|
||||
example: GB-0001
|
||||
sig_refs_names:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: SIG reference names
|
||||
example: Null Country Park
|
||||
activation_score:
|
||||
type: integer
|
||||
description: Activation score. SOTA only
|
||||
@@ -943,9 +948,12 @@ components:
|
||||
- GMA
|
||||
- HEMA
|
||||
- ParksNPeaks
|
||||
- ZLOTA
|
||||
- WOTA
|
||||
- Cluster
|
||||
- RBN
|
||||
- APRS-IS
|
||||
- UKPacketNet
|
||||
example: POTA
|
||||
source_id:
|
||||
type: string
|
||||
|
||||
@@ -106,15 +106,11 @@ function getTooltipText(s) {
|
||||
|
||||
// Format sig_refs
|
||||
var sig_refs = "";
|
||||
if (s["sig_refs"] && s["sig_refs_urls"] && s["sig_refs"].length == s["sig_refs_urls"].length) {
|
||||
items = s["sig_refs"].map(s => `<span class='nowrap'>${s}</span>`)
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
items[i] = `<a href='${s["sig_refs_urls"][i]}' target='_new' class='sig-ref-link'>${items[i]}</a>`
|
||||
}
|
||||
sig_refs = items.join(", ");
|
||||
} else if (s["sig_refs"]) {
|
||||
sig_refs = s["sig_refs"].map(s => `<span class='nowrap'>${s}</span>`).join(", ");
|
||||
var items = []
|
||||
for (var i = 0; i < s["sig_refs"].length; i++) {
|
||||
items[i] = `<a href='${s["sig_refs"][i]["url"]}' title='${s["sig_refs"][i]["name"]}' target='_new' class='sig-ref-link'>${s["sig_refs"][i]["id"]}</a>`
|
||||
}
|
||||
sig_refs = items.join(", ");
|
||||
|
||||
// DX
|
||||
ttt = `<span class='nowrap'><span class='icon-wrapper'>${dx_flag}</span> <a href='https://www.qrz.com/db/${dx_call}' target='_blank' class="dx-link">${dx_call}</a></span><br/>`;
|
||||
|
||||
@@ -161,15 +161,11 @@ function updateTable() {
|
||||
|
||||
// Format sig_refs
|
||||
var sig_refs = "";
|
||||
if (s["sig_refs"] && s["sig_refs_urls"] && s["sig_refs"].length == s["sig_refs_urls"].length && s["sig_refs"].length == s["sig_refs_names"].length) {
|
||||
items = s["sig_refs"].map(s => `<span class='nowrap'>${s}</span>`)
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
items[i] = `<a href='${s["sig_refs_urls"][i]}' title='${s["sig_refs_names"][i]}' target='_new' class='sig-ref-link'>${items[i]}</a>`
|
||||
}
|
||||
sig_refs = items.join(", ");
|
||||
} else if (s["sig_refs"]) {
|
||||
sig_refs = s["sig_refs"].map(s => `<span class='nowrap'>${s}</span>`).join(", ");
|
||||
var items = []
|
||||
for (var i = 0; i < s["sig_refs"].length; i++) {
|
||||
items[i] = `<a href='${s["sig_refs"][i]["url"]}' title='${s["sig_refs"][i]["name"]}' target='_new' class='sig-ref-link'>${s["sig_refs"][i]["id"]}</a>`
|
||||
}
|
||||
sig_refs = items.join(", ");
|
||||
|
||||
// Format DE flag
|
||||
var de_flag = "<i class='fa-solid fa-circle-question'></i>";
|
||||
|
||||
Reference in New Issue
Block a user