Openstatus www.openstatus.dev

fix: minor migration issues (#1583)

* fix: only display active monitors

* fix: domain name

authored by

Maximilian Kaske and committed by
GitHub
6029e7fd 873a559f

+4 -4
+1 -1
apps/status-page/src/proxy.ts
··· 44 44 45 45 console.log({ pathname: url.pathname, type, prefix, subdomain }); 46 46 47 - if (url.pathname === "/" && type !== "hostname") { 47 + if (url.pathname === "/" && type !== "hostname" && subdomain !== null) { 48 48 return response; 49 49 } 50 50
+3 -3
packages/api/src/router/statusPage.ts
··· 107 107 108 108 const monitors = _page.monitorsToPages 109 109 // NOTE: we cannot nested `where` in drizzle to filter active monitors 110 - .filter((m) => !m.monitor.deletedAt) 110 + .filter((m) => !m.monitor.deletedAt && m.monitor.active) 111 111 .map((m) => { 112 112 const events = getEvents({ 113 113 maintenances: _page.maintenances, ··· 388 388 if (!_page) return null; 389 389 390 390 const monitors = _page.monitorsToPages.filter( 391 - (m) => !m.monitor.deletedAt, 391 + (m) => !m.monitor.deletedAt && m.monitor.active, 392 392 ); 393 393 394 394 if (monitors.length !== opts.input.monitorIds.length) return null; ··· 754 754 if (!_page) return null; 755 755 756 756 const _monitor = _page.monitorsToPages.find( 757 - (m) => m.monitorId === opts.input.id, 757 + (m) => m.monitorId === opts.input.id && m.monitor.active, 758 758 )?.monitor; 759 759 760 760 if (!_monitor) return null;