ADSB & Seismic fixes

This commit is contained in:
2026-06-27 16:02:55 -04:00
parent 85b1d66c02
commit a4f13d87ab
2 changed files with 3 additions and 31 deletions

View File

@@ -10,13 +10,13 @@ const canvas = ref<HTMLCanvasElement | null>(null);
const W = 640, H = 120, MAX_PTS = 120;
const SEG_W = W / (MAX_PTS - 1);
const SUB = 4;
const PAD_SEGS = 3; // segments of breathing room at the right edge
const PAD_SEGS = 0;
let interval: ReturnType<typeof setInterval>;
let rafId: number;
let drawProgress = 0;
let lastTimestamp = 0;
const ANIM_DURATION = 950;
const ANIM_DURATION = 1100;
let pointBuffer: { x: number; y: number }[] = [];
let prevMax = 1.0;
@@ -134,7 +134,7 @@ onUnmounted(() => {
</script>
<style scoped lang="scss">
canvas { width: 100%; height: 60px; }
canvas { width: calc(100% - 16px); height: 60px; }
</style>
<template>

View File

@@ -170,34 +170,6 @@ export function classifyAircraft(row) {
return 'unknown';
}
async function scrapeHexDatabase(icao) {
const url = `https://hexdatabase.com/h/${icao}`;
try {
const resp = await fetch(url);
if (!resp.ok) return null;
const html = await resp.text();
const rowMatch = html.match(new RegExp(`<tr[^>]*>.*?<span[^>]*>.*?${icao}.*?<\/span>.*?<\/tr>`, 's'));
if (!rowMatch) return null;
// 0: Hex (ICAO), 1: Co (Country), 2: Reg (Registration), 3: Atype (Aircraft Type), 4: Operator, 5: Source, 6: MSN (Serial number), 7: Remarks (Description)
const cells = rowMatch.match(/<td[^>]*>.*?<\/td>/g) || [] || null;
const country = cells[1]?.replace(/<[^>]*>/g, '').trim() || null;
const registration = cells[2]?.replace(/<[^>]*>/g, '').trim() || null;
const aircraft = cells[3]?.replace(/<[^>]*>/g, '').trim() || null;
const operator = cells[4]?.replace(/<[^>]*>/g, '').trim() || null;
const serialNumber = cells[6]?.replace(/<[^>]*>/g, '').trim() || null;
return {
country,
registration,
aircraft,
operator,
serialNumber
};
} catch (e) {
return null;
}
}
async function scrapeHexDatabase(icao) {
const url = `https://hexdatabase.com/h/${icao}`;
try {