[PULSE-47] Add uptime monitoring dashboard #15

Merged
uz1mani merged 6 commits from staging into main 2026-02-07 22:38:13 +00:00
3 changed files with 1191 additions and 0 deletions
Showing only changes of commit 027d2f50b6 - Show all commits

View File

@@ -623,14 +623,14 @@ export default function UptimePage() {
loadData() loadData()
}, [loadData]) }, [loadData])
// * Auto-refresh every 30 seconds // * Auto-refresh every 30 seconds; show toast on failure (e.g. network loss or auth expiry)
useEffect(() => { useEffect(() => {
const interval = setInterval(async () => { const interval = setInterval(async () => {
try { try {
const statusData = await getUptimeStatus(siteId) const statusData = await getUptimeStatus(siteId)
setUptimeData(statusData) setUptimeData(statusData)
} catch { } catch {
// * Silent refresh failure toast.error('Could not refresh uptime data. Check your connection or sign in again.')
} }
}, 30000) }, 30000)
return () => clearInterval(interval) return () => clearInterval(interval)
@@ -679,7 +679,7 @@ export default function UptimePage() {
} }
const handleDeleteMonitor = async (monitorId: string) => { const handleDeleteMonitor = async (monitorId: string) => {
if (!confirm('Are you sure you want to delete this monitor? All historical data will be lost.')) return if (!window.confirm('Are you sure you want to delete this monitor? All historical data will be lost.')) return
try { try {
await deleteUptimeMonitor(siteId, monitorId) await deleteUptimeMonitor(siteId, monitorId)
toast.success('Monitor deleted') toast.success('Monitor deleted')