feat(models): widen Site struct and DB schema for ping, port, dns, group monitor types

Add Hostname, Port, Timeout, Method, Description, ParentID, AcceptedCodes,
DNSResolveType, DNSServer, and IgnoreTLS fields. Refactor AddSite/UpdateSite
to accept models.Site instead of individual params. Includes DB migrations
for existing databases, per-monitor timeout/TLS in the engine, new type
options in TUI forms, and TYPE column in the sites table.
This commit is contained in:
2026-05-14 17:10:56 -04:00
parent 2bf452d429
commit f06dd5702b
7 changed files with 231 additions and 76 deletions
+23 -13
View File
@@ -6,23 +6,33 @@ type Site struct {
ID int
Name string
URL string
Type string // "http" or "push"
Token string // Secure Token
Type string // "http", "push", "ping", "port", "dns", "group"
Token string
Interval int
AlertID int
CheckSSL bool
ExpiryThreshold int
MaxRetries int
FailureCount int
Status string
StatusCode int
Latency time.Duration
CertExpiry time.Time
HasSSL bool
LastCheck time.Time
SentSSLWarning bool
Hostname string
Port int
Timeout int
Method string
Description string
ParentID int
AcceptedCodes string
DNSResolveType string
DNSServer string
IgnoreTLS bool
FailureCount int
Status string
StatusCode int
Latency time.Duration
CertExpiry time.Time
HasSSL bool
LastCheck time.Time
SentSSLWarning bool
}
type AlertConfig struct {
@@ -36,7 +46,7 @@ type User struct {
ID int
Username string
PublicKey string
Role string
Role string
}
// Phase 5: Backup Structure
@@ -44,4 +54,4 @@ type Backup struct {
Sites []Site `json:"sites"`
Alerts []AlertConfig `json:"alerts"`
Users []User `json:"users"`
}
}