Files
uptop/internal/models/models.go
T
lerko 0396acdc59 feat(cluster): add region affinity, Nodes TUI tab, and probe metrics
Phase 3 of distributed probing:
- Add regions column to sites table for per-monitor probe affinity
- Region-filtered probe assignments (empty regions = all probes)
- New Nodes TUI tab showing connected probes with status/region/last-seen
- Regions input field in site form for configuring probe affinity
- Config-as-code support for regions (export/import/diff)
- Prometheus upkeep_probe_up metric with per-node labels
- Reindex TUI tabs: Sites, Alerts, Logs, Nodes, Users
2026-05-16 11:50:16 -04:00

75 lines
1.3 KiB
Go

package models
import "time"
type Site struct {
ID int
Name string
URL string
Type string // "http", "push", "ping", "port", "dns", "group"
Token string
Interval int
AlertID int
CheckSSL bool
ExpiryThreshold int
MaxRetries int
Hostname string
Port int
Timeout int
Method string
Description string
ParentID int
AcceptedCodes string
DNSResolveType string
DNSServer string
IgnoreTLS bool
Paused bool
Regions string
FailureCount int
Status string
StatusCode int
Latency time.Duration
CertExpiry time.Time
HasSSL bool
LastCheck time.Time
SentSSLWarning bool
}
type AlertConfig struct {
ID int
Name string
Type string
Settings map[string]string
}
type User struct {
ID int
Username string
PublicKey string
Role string
}
type CheckRecord struct {
SiteID int
NodeID string
LatencyNs int64
IsUp bool
CheckedAt time.Time
}
type ProbeNode struct {
ID string
Name string
Region string
LastSeen time.Time
Version string
}
type Backup struct {
Sites []Site `json:"sites"`
Alerts []AlertConfig `json:"alerts"`
Users []User `json:"users"`
}