f06dd5702b
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.
58 lines
1.1 KiB
Go
58 lines
1.1 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
|
|
|
|
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
|
|
}
|
|
|
|
// Phase 5: Backup Structure
|
|
type Backup struct {
|
|
Sites []Site `json:"sites"`
|
|
Alerts []AlertConfig `json:"alerts"`
|
|
Users []User `json:"users"`
|
|
}
|