mirror of
https://github.com/smittix/intercept.git
synced 2026-07-19 23:08:10 -07:00
Reset persisted Meteor state on satellite switch
This commit is contained in:
@@ -35,6 +35,7 @@ const WeatherSat = (function() {
|
|||||||
let initialized = false;
|
let initialized = false;
|
||||||
let imageRefreshInterval = null;
|
let imageRefreshInterval = null;
|
||||||
let lastDecodeJobSignature = null;
|
let lastDecodeJobSignature = null;
|
||||||
|
let lastDecodeSatellite = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the Weather Satellite mode
|
* Initialize the Weather Satellite mode
|
||||||
@@ -149,6 +150,7 @@ const WeatherSat = (function() {
|
|||||||
const satSelect = document.getElementById('weatherSatSelect');
|
const satSelect = document.getElementById('weatherSatSelect');
|
||||||
if (satSelect) {
|
if (satSelect) {
|
||||||
satSelect.addEventListener('change', () => {
|
satSelect.addEventListener('change', () => {
|
||||||
|
resetDecodeJobDisplay();
|
||||||
applyPassFilter();
|
applyPassFilter();
|
||||||
loadImages();
|
loadImages();
|
||||||
loadLatestDecodeJob();
|
loadLatestDecodeJob();
|
||||||
@@ -1808,11 +1810,21 @@ const WeatherSat = (function() {
|
|||||||
async function loadLatestDecodeJob() {
|
async function loadLatestDecodeJob() {
|
||||||
const norad = getSelectedMeteorNorad();
|
const norad = getSelectedMeteorNorad();
|
||||||
if (!norad) return;
|
if (!norad) return;
|
||||||
|
const satSelect = document.getElementById('weatherSatSelect');
|
||||||
|
const satellite = satSelect?.value || null;
|
||||||
|
|
||||||
|
if (satellite !== lastDecodeSatellite) {
|
||||||
|
lastDecodeSatellite = satellite;
|
||||||
|
lastDecodeJobSignature = null;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`/ground_station/decode-jobs?norad_id=${encodeURIComponent(norad)}&backend=meteor_lrpt&limit=1`);
|
const response = await fetch(`/ground_station/decode-jobs?norad_id=${encodeURIComponent(norad)}&backend=meteor_lrpt&limit=1`);
|
||||||
const jobs = await response.json();
|
const jobs = await response.json();
|
||||||
if (!Array.isArray(jobs) || !jobs.length) return;
|
if (!Array.isArray(jobs) || !jobs.length) {
|
||||||
|
resetDecodeJobDisplay();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const job = jobs[0];
|
const job = jobs[0];
|
||||||
const details = job.details || {};
|
const details = job.details || {};
|
||||||
@@ -1865,6 +1877,17 @@ const WeatherSat = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resetDecodeJobDisplay() {
|
||||||
|
if (isRunning) return;
|
||||||
|
const captureStatus = document.getElementById('wxsatCaptureStatus');
|
||||||
|
const captureMsg = document.getElementById('wxsatCaptureMsg');
|
||||||
|
const captureElapsed = document.getElementById('wxsatCaptureElapsed');
|
||||||
|
if (captureStatus) captureStatus.classList.remove('active');
|
||||||
|
if (captureMsg) captureMsg.textContent = '--';
|
||||||
|
if (captureElapsed) captureElapsed.textContent = '--';
|
||||||
|
updateStatusUI('idle', 'Idle');
|
||||||
|
}
|
||||||
|
|
||||||
function formatDecodeJobSummary(job, details) {
|
function formatDecodeJobSummary(job, details) {
|
||||||
if (job.status === 'queued') return 'Ground-station decode queued';
|
if (job.status === 'queued') return 'Ground-station decode queued';
|
||||||
if (job.status === 'decoding') return details.message || 'Ground-station decode in progress';
|
if (job.status === 'decoding') return details.message || 'Ground-station decode in progress';
|
||||||
|
|||||||
Reference in New Issue
Block a user