fix(gateway): wire standalone missions tab (load, back, refresh) (#2745)

Three parallel wiring gaps in the engine v2 Missions tab — each one was
code that only handled the Projects drill-in (cr-*) path and silently
no-op'd on the standalone tab, so the surface looked empty or frozen
even when the backend returned data:

- switchTab had no branch for 'missions', so opening the tab rendered
  the panel shell but never fetched data. /api/engine/missions returned
  rows; the table stayed empty.
- close-mission-detail only hid the cr-detail drawer, so the Back
  button on the standalone detail view did nothing.
- refreshMissionView refreshed the detail view or the project drill-in
  but not the Missions list, so fire/pause/resume actions succeeded but
  the list stayed stale.

[skip-regression-check]
This commit is contained in:
jinxin
2026-04-20 23:13:01 +08:00
committed by GitHub
parent e0c029c796
commit 4577d0e82f
3 changed files with 8 additions and 1 deletions

View File

@@ -732,6 +732,7 @@ function switchTab(tab) {
// the Projects tab so widgets don't keep running in the background.
crBackToOverview();
}
if (tab === 'missions') loadMissions();
if (tab === 'routines') loadRoutines();
if (tab === 'logs') { connectLogSSE(); applyLogFilters(); }
else if (logEventSource) { logEventSource.close(); logEventSource = null; }

View File

@@ -346,7 +346,11 @@ document.addEventListener('click', function(e) {
openMissionDetail(el.dataset.id);
break;
case 'close-mission-detail':
if (crCurrentProjectId) { document.getElementById('cr-detail').style.display = 'none'; }
if (crCurrentProjectId) {
document.getElementById('cr-detail').style.display = 'none';
} else {
closeMissionDetail();
}
break;
case 'fire-mission':
e.stopPropagation();

View File

@@ -813,6 +813,8 @@ function refreshMissionView(missionId) {
openMissionDetail(missionId);
} else if (crCurrentProjectId) {
drillIntoProject(crCurrentProjectId);
} else if (currentTab === 'missions') {
loadMissions();
}
}