radio: fix quick log insert (timestamp param), 'ch 16' falls back to the marine channel, ISS list fits half-width cards
Deploy production / deploy (push) Successful in 1m26s
Deploy production / deploy (push) Successful in 1m26s
This commit is contained in:
1 parent
03574a95a7
commit
95a8b76562
2 files changed
+31
-9
No files matched your search
@@ -65,7 +65,8 @@
|
||||
>
|
||||
</div>
|
||||
{/if}
|
||||
{#if days.length}
|
||||
<div class="iss">
|
||||
{#if days.length}
|
||||
{#each days as d (d.key)}
|
||||
<h3 class="day">{d.label}</h3>
|
||||
<ul class="passes">
|
||||
@@ -91,9 +92,10 @@
|
||||
{/each}
|
||||
</ul>
|
||||
{/each}
|
||||
{:else}
|
||||
{:else}
|
||||
<p class="empty">No passes computed yet (the daily refresh fills this).</p>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
{#if !compact && tle}
|
||||
<p class="meta foot">
|
||||
{tle.name} TLE from Celestrak, epoch {tle.epoch ? fmtAgo(tle.epoch) : '?'}, fetched {tle.fetchedAt
|
||||
@@ -177,16 +179,31 @@
|
||||
.foot {
|
||||
margin-top: 0.8rem;
|
||||
}
|
||||
@media (max-width: 640px) {
|
||||
.iss {
|
||||
container-type: inline-size;
|
||||
}
|
||||
@container (max-width: 40rem) {
|
||||
li {
|
||||
grid-template-columns: 1fr auto auto;
|
||||
grid-template-columns: minmax(0, 1fr) auto 1.2rem;
|
||||
row-gap: 0.1rem;
|
||||
}
|
||||
.times {
|
||||
grid-area: 1 / 1;
|
||||
}
|
||||
.el {
|
||||
grid-area: 1 / 2;
|
||||
}
|
||||
.vis {
|
||||
grid-area: 1 / 3;
|
||||
}
|
||||
.dir {
|
||||
grid-column: 1;
|
||||
grid-area: 2 / 1;
|
||||
}
|
||||
.dur {
|
||||
display: none;
|
||||
}
|
||||
.rel {
|
||||
grid-area: 2 / 2 / 3 / 4;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -320,10 +320,15 @@ export async function addLog(form: FormData): Promise<Result> {
|
||||
if (typed && !frequencyId) {
|
||||
const ch = typed.match(/^ch\s*(\d{1,3})$/i);
|
||||
if (ch) {
|
||||
// A scanner memory first; banks 1-3 are empty, so "ch 16" there means marine channel 16.
|
||||
const [r] =
|
||||
await client`SELECT frequency_id FROM radio.channels WHERE channel = ${Number(ch[1])}`;
|
||||
if (!r) return { ok: false, message: `Channel ${ch[1]} is empty.` };
|
||||
frequencyId = r.frequency_id;
|
||||
const [m] = r
|
||||
? [null]
|
||||
: await client`SELECT id FROM radio.frequencies WHERE marine_ch = ${ch[1]}
|
||||
ORDER BY (SELECT count(*) FROM radio.channels c WHERE c.frequency_id = id) DESC, id LIMIT 1`;
|
||||
if (!r && !m) return { ok: false, message: `Channel ${ch[1]} is empty.` };
|
||||
frequencyId = r ? r.frequency_id : m!.id;
|
||||
} else {
|
||||
freqHz = parseFreq(typed);
|
||||
if (!freqHz) return { ok: false, message: 'Frequency not understood.' };
|
||||
@@ -349,7 +354,7 @@ export async function addLog(form: FormData): Promise<Result> {
|
||||
heardAt = fromZoned(+m[1], +m[2], +m[3], +m[4], +m[5]);
|
||||
}
|
||||
await client`INSERT INTO radio.log ${client({
|
||||
heard_at: heardAt,
|
||||
heard_at: heardAt.toISOString(),
|
||||
frequency_id: frequencyId,
|
||||
freq_hz: freqHz,
|
||||
mode,
|
||||
|
||||
Reference in new issue
Block a user