fix(tui,status,store): add delete confirm, input validation, XSS fix, history persistence

Prevent accidental deletes with y/n confirmation dialog. Validate all
numeric form inputs (interval, port, timeout, threshold, retries) with
range checks instead of silently defaulting to zero. Escape user-supplied
data in status page JavaScript to close XSS via monitor names. Persist
check history to new check_history table so sparklines and uptime
percentages survive restarts.
This commit is contained in:
2026-05-14 20:51:06 -04:00
parent 2f8de35d4b
commit e97780ad38
9 changed files with 253 additions and 24 deletions
+5 -1
View File
@@ -27,7 +27,11 @@ type Store interface {
UpdateUser(id int, username, publicKey, role string) error
DeleteUser(id int) error
// Phase 5: Backup & Restore
// History
SaveCheck(siteID int, latencyNs int64, isUp bool)
LoadAllHistory(limit int) map[int][]models.CheckRecord
// Backup & Restore
ExportData() models.Backup
ImportData(data models.Backup) error
}