d5ab3a18a4
Per-site pause: [p] key toggles pause for selected monitor in TUI. Paused monitors skip checks, persist to DB, show on status page. Status page: replace full-page reload with fetch-based DOM updates to eliminate scroll-jump on refresh. Add summary bar (UP/DOWN/PAUSED counts), stale-data indicator, and fix SSL EXP CSS class bug. TUI: constrain tables to terminal width via lipgloss .Width() to prevent row wrapping that pushed header off-screen. Add MaxHeight safety net. Bump subtle style from #383838 to #565f89 for readability on dark terminals.
44 lines
861 B
Go
44 lines
861 B
Go
package store
|
|
|
|
import (
|
|
"go-upkeep/internal/models"
|
|
)
|
|
|
|
type Store interface {
|
|
Init() error
|
|
|
|
// Sites
|
|
GetSites() []models.Site
|
|
AddSite(site models.Site)
|
|
UpdateSite(site models.Site)
|
|
UpdateSitePaused(id int, paused bool)
|
|
DeleteSite(id int)
|
|
|
|
// Alerts
|
|
GetAllAlerts() []models.AlertConfig
|
|
GetAlert(id int) (models.AlertConfig, bool)
|
|
AddAlert(name, aType string, settings map[string]string)
|
|
UpdateAlert(id int, name, aType string, settings map[string]string)
|
|
DeleteAlert(id int)
|
|
|
|
// Users
|
|
GetAllUsers() []models.User
|
|
AddUser(username, publicKey, role string) error
|
|
UpdateUser(id int, username, publicKey, role string) error
|
|
DeleteUser(id int) error
|
|
|
|
// Phase 5: Backup & Restore
|
|
ExportData() models.Backup
|
|
ImportData(data models.Backup) error
|
|
}
|
|
|
|
var Current Store
|
|
|
|
func SetGlobal(s Store) {
|
|
Current = s
|
|
}
|
|
|
|
func Get() Store {
|
|
return Current
|
|
}
|